502 Bad Gateway
502 Bad Gateway
My system has been working fine for years but yesterday trying to "login" I get 502 Bad Gateway with nguni in small print below that. The hotspot is still working and I can ssh in as well. I was running Pi-Star V4.1.1 and upgraded to 4.1.2 but that did not seem to help.
I normally login with pi-star.local but also tried the ip address but still NG. I can ping it and see that Port 80 is open.
Any help appreciated.
Steve
I normally login with pi-star.local but also tried the ip address but still NG. I can ping it and see that Port 80 is open.
Any help appreciated.
Steve
Re: 502 Bad Gateway
Latest is Pi-Star 4.1.4 so probably another cycle or two of sudo pistar-upgrade should get you to the latest versions and see if the same error occurs then.
Suggest you go to Configuration and then Apply Changes before rebooting.
Suggest you go to Configuration and then Apply Changes before rebooting.
--
Brian G8SEZ
Brian G8SEZ
Re: 502 Bad Gateway
Seeing "502 Bad Gateway" would suggest he cant use any of the dashboard.
Nginx is working (the webserver) or you would never see the 502 message, so its most likely the PHP engine that is broken - the most usual way for that to happen, is that the version changed.
Check what version of PHP you have installed:
Code: Select all
apt list --installed | grep -i php
Code: Select all
pi-star@pi-star(ro):~$ sudo apt list --installed | grep -i php
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-common/stable,now 2:69 all [installed,automatic]
php7.0-cli/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-common/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-fpm/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-json/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-mbstring/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-opcache/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-readline/now 7.0.33-0+deb9u3 armhf [installed,local]
php7.0-zip/now 7.0.33-0+deb9u3 armhf [installed,local]
Code: Select all
pi-star@pi-star(rw):~$ sudo systemctl status php7.0-fpm
● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-06-04 19:35:47 BST; 16min ago
Docs: man:php-fpm7.0(8)
Main PID: 807 (php-fpm7.0)
Status: "Processes active: 0, idle: 2, Requests: 134, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 2181)
CGroup: /system.slice/php7.0-fpm.service
├─ 807 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
├─1145 php-fpm: pool www
└─1146 php-fpm: pool www
Jun 04 19:35:45 pi-star systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Jun 04 19:35:47 pi-star systemd[1]: Started The PHP 7.0 FastCGI Process Manager.
Re: 502 Bad Gateway
This is what I get running the apt list:
pi-star@pi-star(ro):~$ apt list --installed | grep -i php
mount: only root can use "--options" option
mount: only root can use "--options" option
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Problem parsing dependency 52
E: Error occurred while processing jhbuild (NewVersion2)
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_buster_main_binary-armhf_Packages
E: The package lists or status file could not be parsed or opened.
pi-star@pi-star(ro):~$
pi-star@pi-star(ro):~$ apt list --installed | grep -i php
mount: only root can use "--options" option
mount: only root can use "--options" option
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Problem parsing dependency 52
E: Error occurred while processing jhbuild (NewVersion2)
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_buster_main_binary-armhf_Packages
E: The package lists or status file could not be parsed or opened.
pi-star@pi-star(ro):~$
Re: 502 Bad Gateway
What that is... is broken...
Now you could attempt to fix it, and you might, but re-imaging the card is probably quicker....
Now you could attempt to fix it, and you might, but re-imaging the card is probably quicker....
Re: 502 Bad Gateway
Reimaging is no problem but setting the config again is a pain !
Re: 502 Bad Gateway
you can try things like:
and then
See if that sorts it out..
Code: Select all
sudo rm -rf /var/lib/apt/lists/*
Code: Select all
sudo apt update
sudo apt upgrade --fix-missing --fix-broken
Re: 502 Bad Gateway
Unfortunately that must have trashed the OS as it no longer boots. Guess I'm making a new SD card !
Thanks for trying
Steve
Thanks for trying
Steve
Re: 502 Bad Gateway
I shouldn't kill the OS (assuming that the card hasn't died etc) - what that does is dump the caches that apt uses, and that is often enough to let it recover... anyway that asside, it was worth a punt to see if you could get it back.
Re: 502 Bad Gateway
I should have backed it up but it was ages ago.
Nothing like closing the barn door after the cow got out!
Thanks again
Steve
Nothing like closing the barn door after the cow got out!
Thanks again
Steve