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

ilyahoilik's avatar

Error while deploying to the server

Hello! I have just created new server running Ubuntu 16.04, added it to Forge (configured to use PHP 7.2), logged into root and ran code provided by Forge. Then added the site and attached GitLab repository. Code was deployed from master branch, everything worked fine.

Then I have added new file to the root folder of the repository. As I have enabled Quickly Deploy, Forge tried to deploy latest version from repository. And... it failed. In the output I see following:

Tue Oct 17 21:22:22 UTC 2017
From gitlab.com:foo/bar
 * 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
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Package manifest generated successfully.
[sudo] password for forge: Sorry, try again.
[sudo] password for forge: 
sudo: 1 incorrect password attempt

I'm not sure, but I think system cannot log into forge user. I have checked /home/forge/.ssh/authorized_keys and /root/.ssh/authorized_keys files - SSH key is present in the both of them. I have also checked connection to the server from the Forge homepage - and got Successful status.

Any ideas what I did wrong? How I can fix it?

Thanks. Sincerely, Ilya

0 likes
9 replies
ejdelmonico's avatar

That looks odd. If the forge user can connect via ssh then maybe the DB user is the problem. Forge servers expect a forge user and a forge db user.

ilyahoilik's avatar

I have checked DB user forge. Password for the user is correct :(

ilyahoilik's avatar
ilyahoilik
OP
Best Answer
Level 1

I have recreated the server from scratch and provided SSH key for the root user (Instead of simply providing a password). The problem is gone.

rbayer@sbts.edu's avatar

For others who might run across this, on my deployment through forge the file: sudo vi /etc/sudoers.d/php-fpm had the contents of:

forge ALL=NOPASSWD: /usr/sbin/service php7.2-fpm reload
forge ALL=NOPASSWD: /usr/sbin/service php7.1-fpm reload
forge ALL=NOPASSWD: /usr/sbin/service php7.0-fpm reload
forge ALL=NOPASSWD: /usr/sbin/service php5.6-fpm reload
forge ALL=NOPASSWD: /usr/sbin/service php5-fpm reload

I added:

forge ALL=NOPASSWD: /usr/sbin/service php7.3-fpm reload

And then it started to work.

24 likes
ataub2qf's avatar

I had the same problem (after upgrading from PHP 7.1 to 7.2 and then 7.3).

rbayers solution worked for me :)

oixan's avatar

I accidently upgrade to php 7.3 and my deployment process start to give me the same error.

ataub2qf solution save my days.

tonymasek's avatar

The solution of rbayer worked for me either. Thanks!

Please or to participate in this conversation.