Page 1 of 2

502 Bad Gateway

Posted: 28 Jan 2023, 04:30
by drakey83
What am I missing? any of the community apps that I install either give me a 502 Bad Gateway error or I cant enable them? I have the latest TOS 5.1 beta installed and my devices is a F4-421. Ive tried to install Unifi, Tautulli, ModBase, and FileBrowser. I have tried reinstalling them many time and rebooting the NAS, nothing works.

Re: 502 Bad Gateway

Posted: 28 Jan 2023, 06:37
by outkastm
And the apps from App Center works correctly ?
Is your Volume healty ? How many Volumes you have created ?

Re: 502 Bad Gateway

Posted: 01 Feb 2023, 17:53
by Fdq
Hi outcastm.

I have the same 502 error for all the community apps I have installed (Sonarr, radarr, mono, etc.) and the worked fine until one-two days ago.
They still work, but the support & help iframe does not load anymore and gives a 502 error.
They all used to work until a couple of days ago.

Official apps work ok. For example I've installed cloudsynk and checked that its iframe loads properly.

Volume is healthy, and just using Volume1 on Tos 5.1.13-00292 on F5-221
Any idea?
Thanks!

Re: 502 Bad Gateway

Posted: 02 Feb 2023, 00:58
by Fdq
Hi outkastm.

I re-installed 5.1.13-00292 (over the same) and nothing changed - still I have the 502 error.
But, again, all apps work if I access them on their port (e.g. sonarr, qBitorrent 4.5, etc.)
Thansk!

Re: 502 Bad Gateway

Posted: 02 Feb 2023, 06:55
by outkastm
Run these commands in SSH and send me the results

Code: Select all

ls -L /usr/www | grep ModBase1
ls -l /usr/www | grep ModBase1
ls -Ls /usr/www | grep ModBase1
ls -L /usr/www | grep UniFi
ls -l /usr/www | grep UniFi
ls -Ls /usr/www | grep UniFi
ls -L /usr/www | grep Radarr
ls -l /usr/www | grep Radarr
ls -Ls /usr/www | grep Radarr

Re: 502 Bad Gateway

Posted: 02 Feb 2023, 17:42
by Fdq
Here we go.
Thanks!

Code: Select all

[Superxxx@Terra ~]# ls -L /usr/www | grep ModBase1
ModBase1
[Superxxx@Terra ~]# ls -l /usr/www | grep ModBase1
lrwxrwxrwx  1 Superxxx Superxxx   29 Feb  1 11:52 ModBase1 -> /Volume1/@apps/ModBase1/webui
[Superxxx@Terra ~]# ls -Ls /usr/www | grep ModBase1
4 ModBase1
[Superxxx@Terra ~]# ls -L /usr/www | grep UniFi
[Superxxx@Terra ~]# ls -l /usr/www | grep UniFi
[Superxxx@Terra ~]# ls -Ls /usr/www | grep UniFi
[Superxxx@Terra ~]# ls -L /usr/www | grep Radarr
Radarr
[Superxxx@Terra ~]# ls -l /usr/www | grep Radarr
lrwxrwxrwx  1 Superxxx Superxxx   27 Jan 28 14:52 Radarr -> /Volume1/@apps/Radarr/webui
[Superxxx@Terra ~]# ls -Ls /usr/www | grep Radarr
4 Radarr

Re: 502 Bad Gateway

Posted: 06 Feb 2023, 01:57
by jhalfhide
Same issue as above. Always been the way since TOS 5 upgrade (Now on TOS 5.1.13).

Applications still work perfectly (apart from my issue with Radarr not starting at the moment).

Re: 502 Bad Gateway

Posted: 08 Feb 2023, 01:20
by Fdq
I do not know what caused it, but after some investigation I discovered PHP was not working because of a missing library, and therefore caused the 502 errors.

I did this to solve (via SSH):

Code: Select all

cd /usr/lib
ln -s libpcre2-8.so.0.10.1 libpcre2-8.so
ln -s libpcre2-8.so.0.10.1 libpcre2-8.so.0
/etc/init.d/php-fpm start
Maybe it works for others.
Thanks!

Re: 502 Bad Gateway

Posted: 08 Feb 2023, 01:38
by lincooln
thanks Fdg it helped me!

Re: 502 Bad Gateway

Posted: 08 Feb 2023, 05:43
by outkastm
{L_BUTTON_AT}Fdq
Indeed, the missing of running php-fpm process will give a 502 bad gateway when accessing 3rd party apps WebUI. I wasn't able to reproduce this on my NAS F4-423 (TOS5 was fresh installed with 5.0.176 and updated step by step to latest beta 5.1.17 when new firmware was available) Never experienced 502 bad gateway as php-fpm was correctly running on my device. The symbolic link libraries which seems they are missing on some devices, are dated from 17/dec/2021 on my device.

Code: Select all

   4 -rwxr-xr-x  1       937 Dec 17  2021 libpcre2-8.la
  0 lrwxrwxrwx  1       20  Dec 17  2021 libpcre2-8.so -> libpcre2-8.so.0.10.1
  0 lrwxrwxrwx  1        20 Dec 17  2021 libpcre2-8.so.0 -> libpcre2-8.so.0.10.1
324 -rwxr-xr-x  1    329760 Dec 17  2021 libpcre2-8.so.0.10.1
Thx for figuring this out on your NAS. Maybe TM support will step in to check why the symbolic link libraies are missing on some devices and prevent php-fpm from running