502 Bad Gateway

Discussion on apps, protocols, APIs, specifications, and more. You are welcome to join us as a TOS app developer!
User avatar
Fdq
Posts: 7
Joined: 01 Feb 2023, 07:49

Re: 502 Bad Gateway

Post by Fdq »

The strange thing is that it worked for me for a while, and at a certain point it did not anymore. Meaning that the libraries (or better, the links to the library) must have been deleted by something?
Anyway, it is OK and stable now.
User avatar
drakey83
Posts: 34
Joined: 15 Sep 2020, 22:34
United States of America

Re: 502 Bad Gateway

Post by drakey83 »

Fdq wrote: 08 Feb 2023, 01:20 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!
This fixed my issue too! thank you so much for the response!
User avatar
outkastm
Posts: 1185
Joined: 29 Dec 2020, 23:52

Re: 502 Bad Gateway

Post by outkastm »

Actually this issue is caused by official qbittorrent app.
If this app is installed from App Store, it will replace the TOS symlinks for libpcre2-8.so.0, libpcre2-posix.so.0 with his own symlinks pointing to qbittorrent folder.
Once the app is removed, the symlinks are also removed.
This will make the start of php-fpm to fail after restart the app or reboot the NAS, as is searching for the symlink libpcre2-8.so.

To completely restore the symlinks after the official qbittorrent app is removed run this commands

Code: Select all

cd /usr/lib
ln -sf libpcre2-8.so.0 libpcre2-8.so 
ln -sf libpcre2-8.so.0.10.1 libpcre2-8.so.0 
ln -sf libpcre2-posix.so.2 libpcre2-posix.so
ln -sf libpcre2-posix.so.2.0.3 libpcre2-posix.so.2
/etc/init.d/php-fpm start
@TMROY, please ask to have the qbittorrent app fixed
User avatar
TMroy
TerraMaster Team
Posts: 2578
Joined: 10 Mar 2020, 14:04
China

Re: 502 Bad Gateway

Post by TMroy »

Thank you! will forward to the tech team.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Support team: support(at)terra-master.com (for technical support only)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
TMroy
TerraMaster Team
Posts: 2578
Joined: 10 Mar 2020, 14:04
China

Re: 502 Bad Gateway

Post by TMroy »

outkastm wrote: 04 Mar 2023, 05:47
@TMROY, please ask to have the qbittorrent app fixed
It has been fixed.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Support team: support(at)terra-master.com (for technical support only)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
PriestyUK
Posts: 39
Joined: 15 Jan 2022, 17:23

Re: 502 Bad Gateway

Post by PriestyUK »

{L_BUTTON_AT}outkastm

When i'm trying to do this to fix the 502 Bad Gateway error on the your apps I installed:

Radarr
Sonarr
Sabnz
Ombi
Modbase
Mono

I get this error in SSH

[05-Dec-2023 01:58:26] ERROR: FPM initialization failed
failed

Can anyone help?
User avatar
outkastm
Posts: 1185
Joined: 29 Dec 2020, 23:52

Re: 502 Bad Gateway

Post by outkastm »

Unfortunatelly this needs to be checked with TM as is related to TOS builtin PHP. You can try to install the Qbitorrent from app store (not mandatory to have it running) , restart your NAS and see if this issue persist.
Post Reply