question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

502 Bad Gateway after update

See original GitHub issue

Impacted versions

  • Modoboa: 1.12.1
  • installer used: Yes ?
  • Webserver: Nginx

Steps to reproduce

Problem after the update to modoboa 1.12.1 and some plugins

Current behavior

Sorry, I use an automatic translation

502 Bad Gateway when I want to access mail.xxxx.fr Logs Nginx :

2018/11/26 21:52:41 [error] 1725#1725: *9 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/core/"
2018/11/26 22:02:46 [error] 1728#1728: *242 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 22:12:48 [error] 1728#1728: *279 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 22:22:50 [error] 1727#1727: *331 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 22:33:15 [error] 1703#1703: *49 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 22:42:08 [error] 9559#9559: *19 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 22:42:09 [error] 9559#9559: *19 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 22:42:16 [error] 9559#9559: *19 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET / HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 22:42:17 [error] 9559#9559: *19 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 22:43:17 [error] 9559#9559: *33 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 22:53:18 [error] 9557#9557: *103 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 23:02:46 [error] 13697#13697: *31 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET / HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:02:47 [error] 13697#13697: *31 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:03:20 [error] 13697#13697: *34 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 23:11:35 [error] 1592#1592: *4 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET / HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:11:36 [error] 1592#1592: *4 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:13:22 [error] 1592#1592: *8 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 23:23:23 [error] 1592#1592: *15 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 23:29:11 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET / HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:29:12 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:31:05 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /accounts/login/?next=/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:31:06 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:31:09 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /accounts/login/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:31:11 [error] 1592#1592: *21 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr"
2018/11/26 23:33:25 [error] 1592#1592: *30 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"
2018/11/26 23:43:27 [error] 1592#1592: *37 upstream prematurely closed connection while reading response header from upstream, client: XX.XXX.XXX.XX, server: mail.XXXXX.fr, request: "GET /dashboard/ HTTP/2.0", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.XXXXX.fr", referrer: "https://mail.XXXXX.fr/dashboard/"

the problem seems to be coming from uwsgi. the “issue” #1607 to the same problem but I didn’t succeed in doing the same thing. I simply installed uwsgi with pip install.

Expected behavior

Have access to my mailbox and send/receive mails

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fabionadercommented, Jun 17, 2019

that help me with this issue:

https://stackoverflow.com/a/53944279

0reactions
RT4Ucommented, Jul 17, 2019

This fixed the issue for me. https://stackoverflow.com/a/54253374/2748913

This error occurs when uwsgi and psycopg are compiled against two different openssl versions. You have two solution.

disable ssl of django database configuration (the other answer’s solution) Install psyocpg2 from source instead of wheel to install psyocpg2 from source you have to uninstall previous one and try this

pip uninstall psycopg2 pip install --no-binary :all: psycopg2

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix a 502 Bad Gateway Error - Kinsta
1. Try Reloading the Page ... One of the easiest and first things you should try when encountering a 502 bad gateway error...
Read more >
What is a 502 Bad Gateway Error (And How Can I Fix It)?
A 502 Bad Gateway Error means the website you're connected to tried to relay information from another server and encountered an error.
Read more >
How to Fix 502 Bad Gateway Error - Hostinger
1. Refresh the Page · 2. Clear Browser Cache · 3. Try in Incognito Mode · 4. Flush DNS Servers · 5. Test...
Read more >
502 Bad Gateway Error: What It Is and How to Fix It - Lifewire
502 Bad Gateway errors are usually caused by two different internet servers that are having trouble communicating. Here is what to do.
Read more >
502 Bad Gateway - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found