502 Bad Gateway only for VestaCP
502 Bad Gateway only for VestaCP
So as the title says, I receive the error 502 Bad Gateway, but only when I try and access the VetaCP. All other sites on the box work as normal, which is good, except I kinda need access the CP too. ;)
It is a Ubuntu 15.04 VPS, it's name is node01 and the URL that I am using is https://node01.domain.com:8083/
Recent changes on the box:
- I think it auto updated Vesta to the recently released version
- I rebooted the box tonight after 60 days of uptime because I wanted to see how much memory it was using after a recent reboot. I used the VestaCP to initiate the reboot, and when it came back up the CP gave the 502 error.
- I rebooted through ssh after receiving the error, which did not seem to make any difference in the situation.
Not sure what info is helpful here, so I'll share what I have seen asked for in other threads, but I am going to skip the logs for Nginx, and php since the other sites on this server are working fine, and I think it is something with the Vesta service that is broken, but if anyone needs, wants, or think that those or other logs would be of help just let me know what files to post.
Thanks in advance,
Dustin
File: /var/log/vesta/nginx-error.log
It is a Ubuntu 15.04 VPS, it's name is node01 and the URL that I am using is https://node01.domain.com:8083/
Recent changes on the box:
- I think it auto updated Vesta to the recently released version
- I rebooted the box tonight after 60 days of uptime because I wanted to see how much memory it was using after a recent reboot. I used the VestaCP to initiate the reboot, and when it came back up the CP gave the 502 error.
- I rebooted through ssh after receiving the error, which did not seem to make any difference in the situation.
Not sure what info is helpful here, so I'll share what I have seen asked for in other threads, but I am going to skip the logs for Nginx, and php since the other sites on this server are working fine, and I think it is something with the Vesta service that is broken, but if anyone needs, wants, or think that those or other logs would be of help just let me know what files to post.
Thanks in advance,
Dustin
Code: Select all
root@node01:~# service vesta restart
Job for vesta.service failed. See "systemctl status vesta.service" and "journalctl -xe" for details.
Code: Select all
root@node01:~# systemctl status vesta.service -l
● vesta.service - LSB: starts the vesta control panel
Loaded: loaded (/etc/init.d/vesta)
Active: failed (Result: exit-code) since Wed 2016-07-06 00:33:06 PDT; 9min ago
Docs: man:systemd-sysv-generator(8)
Process: 1313 ExecStart=/etc/init.d/vesta start (code=exited, status=78)
CGroup: /system.slice/vesta.service
├─874 nginx: master process /usr/local/vesta/nginx/sbin/vesta-ngin
└─883 nginx: worker process
Jul 06 00:33:06 node01 vesta[1313]: * Starting vesta-nginx vesta-nginx
Jul 06 00:33:06 node01 vesta[1313]: ...done.
Jul 06 00:33:06 node01 vesta[1313]: * Starting vesta-php vesta-php
Jul 06 00:33:06 node01 vesta[1313]: PHP: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 2
Jul 06 00:33:06 node01 vesta[1313]: [06-Jul-2016 00:33:06] ERROR: failed to load configuration file '/usr/local/vesta/php/etc/php-fpm.conf'
Jul 06 00:33:06 node01 vesta[1313]: [06-Jul-2016 00:33:06] ERROR: FPM initialization failed
Jul 06 00:33:06 node01 systemd[1]: vesta.service: control process exited, code=exited status=78
Jul 06 00:33:06 node01 systemd[1]: Failed to start LSB: starts the vesta control panel.
Jul 06 00:33:06 node01 systemd[1]: Unit vesta.service entered failed state.
Jul 06 00:33:06 node01 systemd[1]: vesta.service failed.
Code: Select all
root@node01:~# journalctl -xe
Jul 06 00:40:01 node01 CRON[1543]: pam_unix(cron:session): session closed for user admin
Jul 06 00:40:02 node01 sudo[1547]: pam_unix(sudo:session): session closed for user root
Jul 06 00:40:02 node01 CRON[1542]: pam_unix(cron:session): session closed for user admin
Jul 06 00:40:41 node01 systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Jul 06 00:40:41 node01 systemd-tmpfiles[1728]: [/etc/tmpfiles.d/device-simfs.conf:1] Duplicate line for path "/dev/simfs", ignoring.
Jul 06 00:40:41 node01 systemd-tmpfiles[1728]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.
Jul 06 00:40:41 node01 systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Jul 06 00:43:31 node01 systemd[1]: Cannot add dependency job for unit systemd-vconsole-setup.service, ignoring: Unit console-setup.service failed to load: No such file
Jul 06 00:43:31 node01 systemd[1]: Starting LSB: starts the vesta control panel...
-- Subject: Unit vesta.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vesta.service has begun starting up.
Jul 06 00:43:31 node01 vesta[1741]: * Starting vesta-nginx vesta-nginx
Jul 06 00:43:31 node01 vesta[1741]: ...done.
Jul 06 00:43:31 node01 vesta[1741]: * Starting vesta-php vesta-php
Jul 06 00:43:31 node01 vesta[1741]: PHP: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 2
Jul 06 00:43:31 node01 vesta[1741]: [06-Jul-2016 00:43:31] ERROR: failed to load configuration file '/usr/local/vesta/php/etc/php-fpm.conf'
Jul 06 00:43:31 node01 vesta[1741]: [06-Jul-2016 00:43:31] ERROR: FPM initialization failed
Jul 06 00:43:31 node01 systemd[1]: vesta.service: control process exited, code=exited status=78
Jul 06 00:43:31 node01 systemd[1]: Failed to start LSB: starts the vesta control panel.
-- Subject: Unit vesta.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit vesta.service has failed.
--
-- The result is failed.
Jul 06 00:43:31 node01 systemd[1]: Unit vesta.service entered failed state.
Jul 06 00:43:31 node01 systemd[1]: vesta.service failed.
File: /var/log/vesta/nginx-error.log
Code: Select all
2016/06/14 13:51:06 [error] 854#0: *374 open() "/usr/local/vesta/web/admin/i18n/readme.txt" failed (2: No such file or directory), client: 199.115.117.99, server: _, r$
2016/07/06 00:21:43 [crit] 848#0: *1 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:21:45 [crit] 848#0: *1 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:21:45 [error] 848#0: *1 open() "/usr/local/vesta/web/favicon.ico" failed (2: No such file or directory), client: 71.197.165.150, server: _, request: "GET$
2016/07/06 00:21:45 [error] 848#0: *2 open() "/usr/local/vesta/web/favicon.ico" failed (2: No such file or directory), client: 71.197.165.150, server: _, request: "GET$
2016/07/06 00:21:47 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:21:51 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:22:14 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:22:16 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:22:17 [error] 848#0: *2 open() "/usr/local/vesta/web/favicon.ico" failed (2: No such file or directory), client: 71.197.165.150, server: _, request: "GET$
2016/07/06 00:22:29 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:23:04 [crit] 848#0: *2 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:26:06 [crit] 883#0: *1 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:29:22 [crit] 883#0: *7 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
2016/07/06 00:29:26 [crit] 883#0: *7 connect() to unix:/var/run/vesta-php.sock failed (2: No such file or directory) while connecting to upstream, client: 71.197.165.1$
Code: Select all
root@node01:~# df -h
Filesystem Size Used Avail Use% Mounted on
/vz/private/53382 60G 18G 43G 30% /
devtmpfs 512M 0 512M 0% /dev
tmpfs 512M 0 512M 0% /dev/shm
tmpfs 512M 6.6M 506M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 512M 0 512M 0% /sys/fs/cgroup
tmpfs 512M 0 512M 0% /tmp
none 512M 0 512M 0% /run/shm
Re: 502 Bad Gateway only for VestaCP
Those steps will help you, I hope:
- make folder /usr/local/vesta/data/sessions
- change permissions: drwxrwx--- 2 admin admin
- check config vesta-php /usr/local/vesta/php/etc/php-fpm.conf - session folder - /usr/local/vesta/data/sessions
- make folder /usr/local/vesta/data/sessions
- change permissions: drwxrwx--- 2 admin admin
- check config vesta-php /usr/local/vesta/php/etc/php-fpm.conf - session folder - /usr/local/vesta/data/sessions
Code: Select all
php_admin_value[memory_limit] = 256M
php_admin_value[post_max_size] = 512M
php_admin_value[upload_max_filesize] = 512M
php_admin_value[max_execution_time] = 600
php_admin_value[max_input_time] = 600
php_admin_value[session.save_path] = /usr/local/vesta/data/sessions
Re: 502 Bad Gateway only for VestaCP
The folder '/usr/local/vesta/data/sessions' already exsisted.
I checked the permissions of that folder and these were the permissions
I then renamed that folder and created a new sessions folder, and set the permissions
I then checked the config '/usr/local/vesta/php/etc/php-fpm.conf' and everything was already set as instructed.
I then rebooted, but conditions remain unchanged with the VestaCP giving error 502 and all the other sites working fine.
I checked the permissions of that folder and these were the permissions
Code: Select all
root@node01:/usr/local/vesta/data/sessions# ls -la
total 32
drwxrwx--- 2 admin admin 4096 Jun 29 18:50 .
drwxr-xr-x 9 root root 4096 Jun 28 04:35 ..
-rw------- 1 admin admin 505 May 11 12:39 sess_5g1okr17ck7ebvmmu8q6sj4dr4
-rw------- 1 admin admin 827 Jul 6 00:21 sess_att9o746cgt1fvk29bjln93890
-rw------- 1 admin admin 825 May 19 12:03 sess_fcu4j8ngpk3u1raqsc9b8ud0l2
-rw------- 1 admin admin 1076 Jun 29 18:51 sess_gckj1942e0eju021eh2o9luim2
-rw------- 1 admin admin 505 May 12 16:31 sess_m1jbqpmttrk2bhdkgj1tvq1mv0
-rw------- 1 admin admin 822 May 13 23:06 sess_pimldv35k97ko045o58vjh3bk4
Code: Select all
root@node01:~# ls -la /usr/local/vesta/data/sessions
total 8
drwxrwx--- 2 admin admin 4096 Jul 6 08:18 .
drwxr-xr-x 10 root root 4096 Jul 6 08:18 ..
I then checked the config '/usr/local/vesta/php/etc/php-fpm.conf' and everything was already set as instructed.
I then rebooted, but conditions remain unchanged with the VestaCP giving error 502 and all the other sites working fine.
Re: 502 Bad Gateway only for VestaCP
Note sure if this is of any help but,
When I go to https://ip_address:8083 I receive the 502 error, though I do get the warning that the cert is not for that domain before I get the 502 error.
When I go to http://ip_address:8083 it auto redirects to https, giving the cert error, then the 502 error.
When I go to https://node01.domain.com:8083/ the cert is good, and I receive the 502 error.
and here is a shot of the error page:

When I go to https://ip_address:8083 I receive the 502 error, though I do get the warning that the cert is not for that domain before I get the 502 error.
When I go to http://ip_address:8083 it auto redirects to https, giving the cert error, then the 502 error.
When I go to https://node01.domain.com:8083/ the cert is good, and I receive the 502 error.
and here is a shot of the error page:

Re: 502 Bad Gateway only for VestaCP
Dustin, PM me, can I take a look?
Re: 502 Bad Gateway only for VestaCP
Thanks for access, fixed.
As I say before, but this value was a little incorrect.
Code: Select all
php_admin_value[session.save_path] = /usr/local/vesta/data/sessions
Re: 502 Bad Gateway only for VestaCP
Thanks man :)
Re: 502 Bad Gateway only for VestaCP
Have a nice day.
Closed.
Closed.