Page 1 of 1

502 Bad Gateway error while "View Issues"

Posted: Dec 02, 2015 4:11 am
by rtartas
Hi,

For one of my projects created in Mantis, when I press "View Issues" I receive error message:
502 Bad Gateway
nginx/1.6.2
I use MantisBT version 1.2.19.
Any idea how to solve it?
Thanks in advance for help!

Re: 502 Bad Gateway error while "View Issues"

Posted: Dec 10, 2015 4:05 am
by rtartas
Hi,

Can anybody help with this error?

Re: 502 Bad Gateway error while "View Issues"

Posted: Dec 10, 2015 4:19 am
by atrol
This is hardly a Mantis problem, but a problem with your webserver setup.

Search the web for "502 bad gateway nginx" and you will find a lot of hints what might cause the issue, e.g. links like
http://jvdc.me/fix-502-bad-gateway-erro ... ading-php/

Re: 502 Bad Gateway error while "View Issues"

Posted: Apr 12, 2018 5:05 am
by sergeyol
We also have 502 error in several scenarios:
1) Opening "View Issues" in some cases
2) Opening issue that has specific long URLs anywhere in the description or a comment line (e.g. typical SharePoint link).

I would kindly not agree that this is an issue totally unrelated to Mantis. Analysis of logs (PHP, Apache etc.) shows that PHP process is restarting during such call:

[Thu Apr 12 13:02:55 2018] [notice] Parent: child process exited with status 255 -- Restarting.
[Thu Apr 12 13:02:57 2018] [notice] Apache/2.2.22 (Win32) PHP/5.3.11 mod_ssl/2.2.22 OpenSSL/0.9.8t configured -- resuming normal operations
[Thu Apr 12 13:02:57 2018] [notice] Server built: Jan 28 2012 11:16:39
[Thu Apr 12 13:02:58 2018] [notice] Parent: Created child process 5620
[Thu Apr 12 13:03:00 2018] [notice] Child 5620: Child process is running
[Thu Apr 12 13:03:00 2018] [notice] Child 5620: Acquired the start mutex.
[Thu Apr 12 13:03:00 2018] [notice] Child 5620: Starting 64 worker threads.
[Thu Apr 12 13:03:00 2018] [notice] Child 5620: Starting thread to listen on port 443.
[Thu Apr 12 13:03:00 2018] [notice] Child 5620: Starting thread to listen on port 80.

I believe that Mantis thread crashes during preparation interpretation of a page, thus resulting in error 502.

Re: 502 Bad Gateway error while "View Issues"

Posted: Apr 18, 2018 2:22 am
by atrol
@sergeyol are you able to reproduce this on latest Mantis version using a supported PHP version?

I vaguely remember that we had memory issues / PHP crashes in older Mantis versions, using older PHP versions when having long URLs in description or notes.

As you are using a quite outdated PHP 5.3.11, your problem might disappear by upgrading PHP, or changing PHP memory settings.

Re: 502 Bad Gateway error while "View Issues"

Posted: Apr 26, 2018 5:59 pm
by sergeyol
Thanks for the hint, for some reason I haven't considered PHP version. Just tried it with PHP 5.6/Apache 2.4 - error is still there. On the latest version of Mantis running as your demo environment, I was not able to reproduce it.

So I will try to upgrade first to PHP 7, and then to Mantis 2.x