Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

agamblin's avatar

Not able to deploy

Hi I have some problems to deploy my applications by clicking the button "deploy now"

It appears that it have the wrong sudo password. I mean I managed to deploy my application by accessing with ssh the server but the deploy now is not fonctionning here is the output:

Sat Dec 8 02:11:34 UTC 2018
From gitlab.com:xxxxx/foodline-api
 * branch            master     -> FETCH_HEAD
Already up to date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/passport
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
[sudo] password for forge: Sorry, try again.
[sudo] password for forge: 
sudo: 1 incorrect password attempt

I precise this is the output of the script "Deploy now", the sudo password they gave me is working when I enter it manually. Any idea how to change that password for the script ?

I'm kinda new to laravel, any help would be greatly appreciated

Have a good day !!!

Arthur

0 likes
7 replies
sustained's avatar

Odd. Personally I'd first try just destroying and recreating the app and/or server.

Nash's avatar

That shouldn't happen. Have you added anything that requires root privileges to your deployment script? Can you show your deployment script?

agamblin's avatar

Hi, First thanks a lot for your response guys !

Actually my deploy script looks like this:

cd /home/forge/default
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.3-fpm reload

if [ -f artisan ]
then
    php artisan migrate --force
    php artisan passport:install
    php artisan db:seed
fi

Actually I found a similar subject and he said he resolved it by recreating the server from scratch and providing SSH key for the root user (Instead of simply providing a password).

But I don't know what he means ? Any clue ?

Thanks again

agamblin's avatar

I don't understand it ...

It asks me to check /root/.ssh/authorized_keys and /home/forge/authorized_keys and see if Forge public key is set right.

So I just went to my server config > meta > Forge's public key

I copied it and pasted it in both authorized_keys to be sure. But now it's not even connecting when I click on refresh status, it fails and ask me to check again these two files.

I don't understand anything

Nash's avatar

It may be easier to just provision a new server and set things up from scratch if it's messed up. Here's a guide on solving public key problems in Forge (though it probably won't solve your sudo problem).

agamblin's avatar

This is what I'm testing right now after 6 or 7 try, I'll try again :/

I followed this guide and this is what screw me up. Every time I touch the files in /root/.ssh/authorized_keys or /home/forge/.ssh/authorized_keys I can't connect to my server from forge.

I'll git you and update in 10 min,

Thanks again man

agamblin's avatar
agamblin
OP
Best Answer
Level 1

Ok guys it's solved

So what I did is reacreting the server from scratch and I think I did a mistake in my composer.json. I was using php 7.1 but registered a server using php7.3.

I don't know how it's related but things seems to work now.

Thanks all for your help :-)

Have a good day !!!

Please or to participate in this conversation.