New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 error on logout under a load-balancer #147

Farfaday opened this Issue Jan 16, 2018 · 3 comments


None yet
2 participants

Farfaday commented Jan 16, 2018

we are using phpmyadmin/phpmyadmin:4.7.7-1 in a mesos/marathon environment, with marathon-lb in front of it. PMA_ABSOLUTE_URI is set. Everything works fine, only the logout button leads to a 502 error.

I could get from the log /var/log/nginx-error.log of the container:

2018/01/16 18:35:38 [error] 81#81: *43 upstream sent too big header while reading response header from upstream, client: 10.x.x.x, server: _, request: "POST /logout.php?db=&server=6&token=5f7d0300a1e27379e35c78f551ee4931 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: ""

I tried some answers of that post with no success.

A tcpdump on port 80 inside the container showed :

HTTP: POST /logout.php?db=&server=6&token=48eec371c0925813ed8fcce538353743 HTTP/1.1
POST /logout.php?db=&server=6&token=48eec371c0925813ed8fcce538353743 HTTP/1.1
Content-Length: 38
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: null
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: _ga=GA1.2.1639812356.1480524090; sidebarCollapsed=null; pmaCookieVer=5; pma_lang=de; pma_collation_connection=utf8mb4_unicode_ci; pma_console_height=92; pma_console_config=%7B%22alwaysExpand%22%3Afalse%2C%22startHistory%22%3Afalse%2C%22currentQuery%22%3Atrue%2C%22enterExecutes%22%3Afalse%2C%22darkTheme%22%3Afalse%7D; pma_console_mode=collapse; pmaUser-2=%7B%22iv%22%3A%22FQDVroW5UEyD%5C%2FhFb5TR4qA%3D%3D%22%2C%22mac%22%3A%22a569c4b97c999236d25cad70fa9d05cac8a454c0%22%2C%22payload%22%3A%22aNZyNkzhjaTUWWtb2oFbWg%3D%3D%22%7D; pmaAuth-2=%7B%22iv%22%3A%22kdv7jaPIkI9kPr%2BBmcZ5Tw%3D%3D%22%2C%22mac%22%3A%22c566a2473b8b6a0ebd06c730081ca04713a5b51f%22%2C%22payload%22%3A%22STyRGKmcXBkwv9b%5C%2FDxtiApiFSe%5C%2FZjSwYfeaqo3M4%2Bkw%3D%22%7D; phpMyAdmin=dd0a03aa7e74b56cfaf0134566ab0123; pmaUser-6=%7B%22iv%22%3A%22y6jHtpG5lNkOLlcIC0d6FA%3D%3D%22%2C%22mac%22%3A%22b08508f963f2ed287490445a4e12900586378bb7%22%2C%22payload%22%3A%22raEWHDsHABg3bGT4vGVGzQ%3D%3D%22%7D; pmaAuth-6=%7B%22iv%22%3A%22zrGXWE%5C%2FxVYpCWZ%5C%2FdXs%5C%2FiSQ%3D%3D%22%2C%22mac%22%3A%22579fb0556a7971b30317159a7613875b56f44445%22%2C%22payload%22%3A%22TsJQjNoKkoF0slMVofq1%2B8ZnDOT6cYskkHPfRgjujTE%3D%22%7D
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Forwarded-For: 10.x.x.x
Connection: close

and then the answer:

HTTP/1.1 502 Bad Gateway
Server: nginx
Date: Tue, 16 Jan 2018 18:55:43 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 568
Connection: close
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

Let me what I could do to help you fix that issue :)



This comment has been minimized.


nijel commented Jan 16, 2018

Can't you just increase limit on headers? The problem probably is in cookies.

PS: The 4.8.0 release will use much less cookies, see phpmyadmin/phpmyadmin#11688


This comment has been minimized.

Farfaday commented Jan 16, 2018

I tried adding

client_header_buffer_size 128k;
large_client_header_buffers 24 24k;

to /etc/nginx/nginx.conf and then did a supervisorctl restart nginx but it doesn't help.

What do you mean exactly ?

I just tested edge-4.8, also got a 502 :(

@nijel nijel self-assigned this Feb 12, 2018

@nijel nijel added the bug label Feb 12, 2018

@nijel nijel closed this in 5e02108 Feb 12, 2018


This comment has been minimized.

Farfaday commented Feb 12, 2018

Works ! Many Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment