mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 08:56:02 +03:00
[GH-ISSUE #1486] 502 Bad Gateway - Clean installation using installer on a fresh Debian 9.4. No other errors. #1169
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @desavil on GitHub (May 3, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1486
Impacted versions
Steps to reproduce
Output:
Current behavior
When I open: https://hostname.domain.tld i get this error:
Logs:
/var/log/nginx/hostname.domain.tld-error.log
/var/log/uwsgi/app/modoboa_instance.log
@esbeeb commented on GitHub (May 7, 2018):
Exact same thing happens to me. 502 error seen even when I visit https://localhost in a web browser on the server I installed to.
@esbeeb commented on GitHub (May 7, 2018):
These error messages get generated with each 502 error, generated in /var/log/nginx/mail.example.domain.com-error.log:
2018/05/06 20:42:38 [error] 476#476: *18 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: mail.example.domain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/app/modoboa_instance/socket:", host: "mail.example.domain.com:443", referrer: "https://mail.example.domain.com:443/"
@esbeeb commented on GitHub (May 7, 2018):
Here's the error message I see in my /var/log/uwsgi/app/modoboa_instance.log, when one of these 502 errors gets generated:
Traceback (most recent call last):
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 157, in call
response = self.get_response(request)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
response = self._middleware_chain(request)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 43, in inner
response = response_for_exception(request, exc)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 93, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 142, in handle_uncaught_exception
callback, param_dict = resolver.resolve_error_handler(500)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 418, in resolve_error_handler
callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "./instance/urls.py", line 4, in
url(r'', include('modoboa.urls')),
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/urls.py", line 31, in
url("admin/", include("modoboa.admin.urls", namespace="admin")),
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/urls.py", line 10, in
from .views import (
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/views/export.py", line 22, in
from backports import csv
ImportError: No module named backports
mail.example.domain.com:443 [pid: 2087|app: 1|req: 3/4] x.x.x.x () {50 vars in 763 bytes} [Mon May 7 13:44:13 2018] GET / => generated 0 bytes in 2919 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
@tonioo commented on GitHub (May 9, 2018):
You need to remove your pip cache. Can you try this before restarting the installer:
@desavil commented on GitHub (May 9, 2018):
@tonioo Reproduce my installation steps and you will see for yourself.
modoboa/env - directory not found (after first install command)
modoboa/.cache - directory not found (after first install command)
The problem is still not solved.
I think I will be forced to give up modoboa, and it looked promising. :(
@tonioo commented on GitHub (May 9, 2018):
@desavil I wont reproduce your installation, I don't have time for this.
Anyway, I misread the issue's description: your initial command line was wrong. Do not pass
hostname.domain.tldas first argument but justdomain.tld.@xGruntx commented on GitHub (May 9, 2018):
@desavil It's problem in installer https://github.com/modoboa/modoboa-installer/issues/197#issuecomment-385621392 . Workaround is working , but dkim is not . After third reinstall - actually, I'm beat. Doing the same manually i've lost less time .
@desavil commented on GitHub (May 9, 2018):
@tonioo It does not change anything.
I installed the clean system again and performed only:
sudo ./run.py domain.tld [enter: y]And I get exactly the same error.
As you can see, more people have this problem.
@xGruntx Thank you very much! It's works for me.
So, my work full install command is now:
@xGruntx commented on GitHub (May 9, 2018):
@desavil send thanks to @altergui 👍
@tonioo commented on GitHub (May 10, 2018):
@desavil Without a proper trace created using the --debug trace, I can't help you.
@fluboi commented on GitHub (May 10, 2018):
Same problem here. Unable to have a working install using modoboa-installer on a fresh Debian 9.4.
In /var/log/uwsgi/app/modoboa_instance.log trace ending with:
@desavil commented on GitHub (May 10, 2018):
Full log with --debug:
@fluboi commented on GitHub (May 10, 2018):
Seems to work as a quick fix:
@esbeeb commented on GitHub (Jul 14, 2018):
I just updated my Debian, then I just did a fresh "git clone", then a fresh install of modoboa, got the same "502 Bad Gateway" error. Then I tried the 4-liner fix just above. BTW, couldn't just run "bash" (on line 2), had to run "/bin/bash". Then when I ran "pip install backports.weakref", here's output seen:
Collecting backports.weakref
Downloading https://files.pythonhosted.org/packages/88/ec/f598b633c3d5ffe267aaada57d961c94fdfa183c5c3ebda2b6d151943db6/backports.weakref-1.0.post1-py2.py3-none-any.whl
modoboa-radicale 1.3.2 has requirement django-filter==1.1.0, but you'll have django-filter 1.0.4 which is incompatible.
Installing collected packages: backports.weakref
Successfully installed backports.weakref-1.0.post1
The bolded line mentioning "incompatible" is shown in red. When I reload my web page, I still get the "502 Bad Gateway" error, so I think this issue is far from closed.
@tonioo commented on GitHub (Jul 16, 2018):
@esbeeb Looks like your setup is not so "fresh" because you're trying to install outdated package versions... For example, the latest version of the modoboa-radicale package is 1.3.4.
@Ramalama2 commented on GitHub (Oct 5, 2018):
same here on centos 7....
@JOduMonT commented on GitHub (Oct 13, 2018):
if I may try to help
@desavil if I read well your debug
your Debian is not up 2 date
and you have an issue with amavis and his CGROUP
I'm also using Debian 9 with Modoboa; I had few issue during my few first try but I did'nt give up
because 1st I have a non standard configuration like
partitionning my harddrive + using noexec,nodev,nosuid, ...
enforcing AppArmor + CGroups through the grub...
1. what kind of machine, which host ?
- I means if you are inside a unprivileged lxc, the system is restricted and postfix works badly in these condition.
you could try these command to have some output :
dmidecode -s 'system-product-name',cat /proc/cpuinfo,systemd-detect-virt2. Question is : Do you have any non standard config/habit you made ?
- FYI you can't have noexec on /srv and /tmp
3. Question: could you do this on your system before installing modoboa
4. Question: ensure me you don't sudo as root
@Illizion commented on GitHub (Nov 13, 2018):
lmaooo that last question 🤣 👌