502 Bad Gateway

Discussion on apps, protocols, APIs, specifications, and more. You are welcome to join us as a TOS app developer!
User avatar
drakey83
Posts: 34
Joined: 15 Sep 2020, 22:34

502 Bad Gateway

Post 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.
Attachments
Screenshot 2023-01-27 142444.png
User avatar
outkastm
Posts: 1182
Joined: 29 Dec 2020, 23:52

Re: 502 Bad Gateway

Post by outkastm »

And the apps from App Center works correctly ?
Is your Volume healty ? How many Volumes you have created ?
User avatar
Fdq
Posts: 7
Joined: 01 Feb 2023, 07:49

Re: 502 Bad Gateway

Post 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!
User avatar
Fdq
Posts: 7
Joined: 01 Feb 2023, 07:49

Re: 502 Bad Gateway

Post 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!
User avatar
outkastm
Posts: 1182
Joined: 29 Dec 2020, 23:52

Re: 502 Bad Gateway

Post 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
User avatar
Fdq
Posts: 7
Joined: 01 Feb 2023, 07:49

Re: 502 Bad Gateway

Post 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
User avatar
jhalfhide
Posts: 37
Joined: 31 Dec 2020, 01:19

Re: 502 Bad Gateway

Post 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).
F2-422 running TOS 5.1
Plex/Sonarr/Radarr/Lidarr/SabNZBD
User avatar
Fdq
Posts: 7
Joined: 01 Feb 2023, 07:49

Re: 502 Bad Gateway

Post 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!
User avatar
lincooln
Posts: 23
Joined: 20 Jan 2023, 13:38

Re: 502 Bad Gateway

Post by lincooln »

thanks Fdg it helped me!
User avatar
outkastm
Posts: 1182
Joined: 29 Dec 2020, 23:52

Re: 502 Bad Gateway

Post 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
Post Reply