[resolved]Suddenly 502 Bad Gateway

  • Used Zammad version: I am not sure (where can I see it?)
  • Used Zammad installation source: (deb)
  • Operating system: Ubuntu 18.04
  • Browser + version: Any

Expected behavior:

To work

Actual behavior:

502 Bad Gateway

Steps to reproduce the behavior:

No idea


Hello Everyone,

I installed Zammad 3 months ago and it was running without problems. Today, suddenly I get 502 Bad Gateway

I have checked online for the problem, tried several solutions, none fixed my problem.

I see that I have nothing running on ports 3000 and 6042 even though it is configured in my /etc/sites-enabled/zammad.conf

In my /var/log/nginx/zammad.error.log I get:

2019/08/13 08:52:37 [error] 1181#1181: *61 connect() failed (111: Connection refused) while connecting to upstream, client: 10.75.240.24, server: support.domain.org, request: "GET /ws HTTP/1.1", upstream: "http://127.0.0.1:6042/ws", host: "support.domain.org"
2019/08/13 11:45:32 [error] 1341#1341: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.75.240.53, server: support.domain.org, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "support.domain.org"

In my /var/log/syslog I get:

Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-worker-1.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-worker-1.service: Failed with result 'exit-code'.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-web-1.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-web-1.service: Failed with result 'exit-code'.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-websocket-1.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-websocket-1.service: Failed with result 'exit-code'.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-worker-1.service: Service hold-off time over, scheduling restart.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-worker-1.service: Scheduled restart job, restart counter is at 2.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-web-1.service: Service hold-off time over, scheduling restart.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-web-1.service: Scheduled restart job, restart counter is at 2.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-websocket-1.service: Service hold-off time over, scheduling restart.
Aug 13 12:00:30 lo00ts01 systemd[1]: zammad-websocket-1.service: Scheduled restart job, restart counter is at 2.
Aug 13 12:00:30 lo00ts01 systemd[1]: Stopped zammad-websocket-1.service.
Aug 13 12:00:30 lo00ts01 systemd[1]: Started zammad-websocket-1.service.
Aug 13 12:00:30 lo00ts01 systemd[1]: Stopped zammad-web-1.service.
Aug 13 12:00:30 lo00ts01 systemd[1]: Started zammad-web-1.service.
Aug 13 12:00:30 lo00ts01 systemd[1]: Stopped zammad-worker-1.service.
Aug 13 12:00:30 lo00ts01 systemd[1]: Started zammad-worker-1.service.

After a while it gives up:

Aug 13 12:03:00 lo00ts01 zammad-web-1.service[13667]:   script/rails:6:in `<top (required)>'
Aug 13 12:03:00 lo00ts01 systemd[1]: zammad-web-1.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 12:03:00 lo00ts01 systemd[1]: zammad-web-1.service: Failed with result 'exit-code'.
Aug 13 12:03:01 lo00ts01 systemd[1]: zammad-web-1.service: Service hold-off time over, scheduling restart.
Aug 13 12:03:01 lo00ts01 systemd[1]: zammad-web-1.service: Scheduled restart job, restart counter is at 10.
Aug 13 12:03:01 lo00ts01 systemd[1]: Stopped zammad-web-1.service.
Aug 13 12:03:01 lo00ts01 systemd[1]: zammad-web-1.service: Start request repeated too quickly.
Aug 13 12:03:01 lo00ts01 systemd[1]: zammad-web-1.service: Failed with result 'exit-code'.
Aug 13 12:03:01 lo00ts01 systemd[1]: Failed to start zammad-web-1.service.

Please help

Ok this is very weird.

As I said, I installed Zammad 3 months ago, and haven’t touch the configuration since then, and today stopped working.

Now I did

apt-upgrade

Noticed that my /opt/zammad/config/database.yml had the wrong configuration

Restored the correct configuration

Ran:

zammad run rails r "Setting.set('es_url', 'http://127.0.0.1:9200')"

zammad run rake searchindex:rebuild

zammad run rake db:migrate

systemctl restart nginx

And everything works again.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.