Mastodon - 502 Bad Gateway

502 Bad Gateway

sudo systemctl status nginx.service 
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: active (running) since Sat 2018-03-10 16:12:09 UTC; 27min ago
  Process: 3743 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 3493 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 3804 (nginx)
   CGroup: /system.slice/nginx.service
           ├─3804 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─3806 nginx: worker process
           ├─3807 nginx: worker process
           ├─3809 nginx: worker process
           └─3810 nginx: worker process

Mar 10 16:12:09 Yunohost systemd[1]: Started A high performance web server and a reverse proxy server.
admin@Yunohost:~$ sudo systemctl status mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service
● mastodon-web.service - mastodon-web
   Loaded: loaded (/etc/systemd/system/mastodon-web.service; enabled)
   Active: failed (Result: start-limit) since Sat 2018-03-10 16:12:25 UTC; 27min ago
  Process: 4814 ExecStart=/opt/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb (code=exited, status=1/FAILURE)
 Main PID: 4814 (code=exited, status=1/FAILURE)

Mar 10 16:12:25 Yunohost systemd[1]: Unit mastodon-web.service entered failed state.
Mar 10 16:12:25 Yunohost systemd[1]: mastodon-web.service holdoff time over, scheduling restart.
Mar 10 16:12:25 Yunohost systemd[1]: Stopping mastodon-web...
Mar 10 16:12:25 Yunohost systemd[1]: Starting mastodon-web...
Mar 10 16:12:25 Yunohost systemd[1]: mastodon-web.service start request repeated too quickly, refusing to start.
Mar 10 16:12:25 Yunohost systemd[1]: Failed to start mastodon-web.
Mar 10 16:12:25 Yunohost systemd[1]: Unit mastodon-web.service entered failed state.

● mastodon-sidekiq.service - mastodon-sidekiq
   Loaded: loaded (/etc/systemd/system/mastodon-sidekiq.service; enabled)
   Active: failed (Result: start-limit) since Sat 2018-03-10 16:12:24 UTC; 27min ago
  Process: 4794 ExecStart=/opt/mastodon/.rbenv/shims/bundle exec sidekiq -c 20 -q default -q mailers -q pull -q push (code=exited, status=1/FAILURE)
 Main PID: 4794 (code=exited, status=1/FAILURE)

Mar 10 16:12:24 Yunohost systemd[1]: mastodon-sidekiq.service: main process exited, code=exited, status=1/FAILURE
Mar 10 16:12:24 Yunohost systemd[1]: Unit mastodon-sidekiq.service entered failed state.
Mar 10 16:12:24 Yunohost systemd[1]: mastodon-sidekiq.service holdoff time over, scheduling restart.
Mar 10 16:12:24 Yunohost systemd[1]: Stopping mastodon-sidekiq...
Mar 10 16:12:24 Yunohost systemd[1]: Starting mastodon-sidekiq...
Mar 10 16:12:24 Yunohost systemd[1]: mastodon-sidekiq.service start request repeated too quickly, refusing to start.
Mar 10 16:12:24 Yunohost systemd[1]: Failed to start mastodon-sidekiq.
Mar 10 16:12:24 Yunohost systemd[1]: Unit mastodon-sidekiq.service entered failed state.

● mastodon-streaming.service - mastodon-streaming
   Loaded: loaded (/etc/systemd/system/mastodon-streaming.service; enabled)
   Active: failed (Result: start-limit) since Sat 2018-03-10 16:13:11 UTC; 26min ago
  Process: 5072 ExecStart=/usr/bin/npm run start (code=exited, status=1/FAILURE)
 Main PID: 5072 (code=exited, status=1/FAILURE)

Mar 10 16:13:10 Yunohost systemd[1]: Unit mastodon-streaming.service entered failed state.
Mar 10 16:13:11 Yunohost systemd[1]: mastodon-streaming.service holdoff time over, scheduling restart.
Mar 10 16:13:11 Yunohost systemd[1]: Stopping mastodon-streaming...
Mar 10 16:13:11 Yunohost systemd[1]: Starting mastodon-streaming...
Mar 10 16:13:11 Yunohost systemd[1]: mastodon-streaming.service start request repeated too quickly, refusing to start.
Mar 10 16:13:11 Yunohost systemd[1]: Failed to start mastodon-streaming.
Mar 10 16:13:11 Yunohost systemd[1]: Unit mastodon-streaming.service entered failed state.

Je demarre donc mastodon

admin@Yunohost:~$ sudo systemctl start mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service

admin@Yunohost:~$ sudo systemctl status mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service
● mastodon-web.service - mastodon-web
   Loaded: loaded (/etc/systemd/system/mastodon-web.service; enabled)
   Active: active (running) since Sat 2018-03-10 16:49:03 UTC; 490ms ago
 Main PID: 5898 (bundle)
   CGroup: /system.slice/mastodon-web.service
           └─5898 /opt/mastodon/.rbenv/versions/2.5.0/bin/ruby /opt/mastodon/.rbenv/versions/2.5.0/bin/bundle exec puma -C config/puma.rb

Mar 10 16:49:03 Yunohost systemd[1]: Stopping mastodon-web...
Mar 10 16:49:03 Yunohost systemd[1]: Starting mastodon-web...
Mar 10 16:49:03 Yunohost systemd[1]: Started mastodon-web.

● mastodon-sidekiq.service - mastodon-sidekiq
   Loaded: loaded (/etc/systemd/system/mastodon-sidekiq.service; enabled)
   Active: active (running) since Sat 2018-03-10 16:49:03 UTC; 499ms ago
 Main PID: 5897 (bundle)
   CGroup: /system.slice/mastodon-sidekiq.service
           └─5897 /opt/mastodon/.rbenv/versions/2.5.0/bin/ruby /opt/mastodon/.rbenv/versions/2.5.0/bin/bundle exec sidekiq -c 20 -q default -q mailers -q pull -q push

Mar 10 16:49:03 Yunohost systemd[1]: mastodon-sidekiq.service holdoff time over, scheduling restart.
Mar 10 16:49:03 Yunohost systemd[1]: Stopping mastodon-sidekiq...
Mar 10 16:49:03 Yunohost systemd[1]: Starting mastodon-sidekiq...
Mar 10 16:49:03 Yunohost systemd[1]: Started mastodon-sidekiq.

● mastodon-streaming.service - mastodon-streaming
   Loaded: loaded (/etc/systemd/system/mastodon-streaming.service; enabled)
   Active: active (running) since Sat 2018-03-10 16:49:02 UTC; 696ms ago
 Main PID: 5890 (npm)
   CGroup: /system.slice/mastodon-streaming.service
           └─5890 npm

Mar 10 16:49:02 Yunohost systemd[1]: Stopping mastodon-streaming...
Mar 10 16:49:02 Yunohost systemd[1]: Starting mastodon-streaming...
Mar 10 16:49:02 Yunohost systemd[1]: Started mastodon-streaming.

Mais j’ai toujours une 502 sur la page de l’instance…
une idée où regarder pour dépanner ???

[EDIT]

admin@Yunohost:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Bon a n’y rien comprendre, plusieurs reboot et finalement c’est repartie… :crazy_face: