Skip to content
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

Bad gateway upon connecting to postal frontend #18

Closed
mu-arch opened this issue Apr 26, 2017 · 12 comments
Closed

Bad gateway upon connecting to postal frontend #18

mu-arch opened this issue Apr 26, 2017 · 12 comments

Comments

@mu-arch
Copy link

mu-arch commented Apr 26, 2017

Getting an error upon attempting to connect to my site via it's IP.

502 Bad Gateway

nginx/1.10.0 (Ubuntu)
@adamcooke
Copy link
Contributor

Is postal running? Can you run 'postal status' to see what's running?

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

When I ran that prior I got the error:
Error: The PID directory (/opt/postal/app/tmp/pids) is not empty. Cannot start unless things are clean.

So I presumed it was running.

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

Upon looking through my active processes I don't see Postal in there, I'm not sure if that's the name it goes by. Plenty of other database processes running though.

@adamcooke
Copy link
Contributor

Sounds like it might have died at some point. The log/procodile.log should give you a clue as to why that happened.

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

Here are the contents of that log:

22:01:46 system          | Procodile supervisor started with PID 2292
22:01:46 system          | Application root is /opt/postal/app
22:01:46 system          | Reloading configuration
22:01:46 web.1           | Started with PID 2298
22:01:46 fast.1          | Started with PID 2300
22:01:46 worker.1        | Started with PID 2302
22:01:46 cron.1          | Started with PID 2304
22:01:46 smtp.1          | Started with PID 2306
22:01:46 requeuer.1      | Started with PID 2309
22:01:46 control         | Listening at /opt/postal/app/tmp/pids/procodile.sock
22:01:50 web.1           | => Puma starting in single mode...
22:01:50 web.1           | => * Version 3.8.2 (ruby 2.3.4-p301), codename: Sassy Salamander
22:01:50 web.1           | => * Min threads: 5, max threads: 5
22:01:50 web.1           | => * Environment: production
22:02:10 cron.1          | => E, [2017-04-26T22:02:10.402921 #2304] ERROR -- #<Bunny::Session:0x5e6d980 postal@127.0.0.1:
5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was ref
used using authentication mechanism PLAIN. For details see the broker logfile.
22:02:10 worker.1        | => E, [2017-04-26T22:02:10.421348 #2302] ERROR -- #<Bunny::Session:0x524cc00 postal@127.0.0.1:
5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was ref
used using authentication mechanism PLAIN. For details see the broker logfile.
22:02:10 worker.1        | => rake aborted!
22:02:10 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your c
onnection settings. Username: postal, vhost: /postal, password length: 27
22:02:10 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `ope
n_connection'
22:02:10 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `star
t'
22:02:10 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:10 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:10 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:10 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:10 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:10 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:10 worker.1        | => Tasks: TOP => postal:worker
22:02:10 worker.1        | => (See full trace by running task with --trace)
22:02:13 web.1           | => * Listening on tcp://127.0.0.1:5000
22:02:13 web.1           | => Use Ctrl-C to stop
22:02:13 worker.1        | Process has stopped. Respawning...
22:02:13 worker.1        | Started with PID 2355
22:02:17 worker.1        | => E, [2017-04-26T22:02:17.941287 #2355] ERROR -- #<Bunny::Session:0x4d45978 postal@127.0.0.1:
5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was ref
used using authentication mechanism PLAIN. For details see the broker logfile.
22:02:17 worker.1        | => rake aborted!
22:02:17 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your c
onnection settings. Username: postal, vhost: /postal, password length: 27
22:02:17 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `ope
n_connection'
t'
22:02:17 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `start'
22:02:17 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:17 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:17 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:17 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:17 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:17 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:17 worker.1        | => Tasks: TOP => postal:worker
22:02:17 worker.1        | => (See full trace by running task with --trace)
22:02:19 worker.1        | Process has stopped. Respawning...
22:02:19 worker.1        | Started with PID 2605
22:02:25 worker.1        | => E, [2017-04-26T22:02:25.200974 #2605] ERROR -- #<Bunny::Session:0x5ee60b0 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:02:25 worker.1        | => rake aborted!
22:02:25 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your connection settings. Username: postal, vhost: /postal, password length: 27
22:02:25 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `open_connection'
22:02:25 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `start'
22:02:25 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:25 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:25 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:25 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:25 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:25 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:25 worker.1        | => Tasks: TOP => postal:worker
22:02:25 worker.1        | => (See full trace by running task with --trace)
22:02:25 worker.1        | Process has stopped. Respawning...
22:02:25 worker.1        | Started with PID 2832
22:02:29 worker.1        | => E, [2017-04-26T22:02:29.190409 #2832] ERROR -- #<Bunny::Session:0x63a5f60 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:02:29 worker.1        | => rake aborted!
22:02:29 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your connection settings. Username: postal, vhost: /postal, password length: 27
22:02:29 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `open_connection'
22:02:29 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `start'
22:02:29 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:29 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:29 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:29 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:29 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:29 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:29 worker.1        | => Tasks: TOP => postal:worker
22:02:29 worker.1        | => (See full trace by running task with --trace)
22:02:31 worker.1        | Process has stopped. Respawning...
22:02:31 worker.1        | Started with PID 2842
22:02:34 worker.1        | => E, [2017-04-26T22:02:34.462391 #2842] ERROR -- #<Bunny::Session:0x5707150 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:02:34 worker.1        | => rake aborted!
22:02:34 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your connection settings. Username: postal, vhost: /postal, password length: 27
22:02:34 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `open_connection'
22:02:34 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `start'
22:02:34 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:34 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:34 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:34 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:34 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:34 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:34 worker.1        | => Tasks: TOP => postal:worker
22:02:34 worker.1        | => (See full trace by running task with --trace)
22:02:37 worker.1        | Process has stopped. Respawning...
22:02:37 worker.1        | Started with PID 2849
22:02:41 worker.1        | => E, [2017-04-26T22:02:41.150982 #2849] ERROR -- #<Bunny::Session:0x6110868 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:02:41 worker.1        | => rake aborted!
22:02:41 worker.1        | => Bunny::AuthenticationFailureError: Authentication with RabbitMQ failed. Please check your connection settings. Username: postal, vhost: /postal, password length: 27
22:02:41 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:1082:in `open_connection'
22:02:41 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/bunny-2.5.1/lib/bunny/session.rb:304:in `start'
22:02:41 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:15:in `create_connection'
22:02:41 worker.1        | => /opt/postal/app/lib/postal/rabbit_mq.rb:20:in `create_channel'
22:02:41 worker.1        | => /opt/postal/app/lib/postal/worker.rb:171:in `job_channel'
22:02:41 worker.1        | => /opt/postal/app/lib/postal/worker.rb:15:in `work'
22:02:41 worker.1        | => /opt/postal/app/lib/tasks/postal.rake:5:in `block (2 levels) in <top (required)>'
22:02:41 worker.1        | => /opt/postal/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
22:02:41 worker.1        | => Tasks: TOP => postal:worker
22:02:41 worker.1        | => (See full trace by running task with --trace)
22:02:43 worker.1        | Warning: this process has been respawned 5 times and keeps dying.
22:02:43 worker.1        | It will not be respawned automatically any longer and will no longer be managed.
22:02:43 worker.1        | Removed PID file
22:03:10 cron.1          | => E, [2017-04-26T22:03:10.502543 #2304] ERROR -- #<Bunny::Session:0x4b947a0 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:04:10 cron.1          | => E, [2017-04-26T22:04:10.575284 #2304] ERROR -- #<Bunny::Session:0x4b5f960 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:05:10 cron.1          | => E, [2017-04-26T22:05:10.636816 #2304] ERROR -- #<Bunny::Session:0x5f2e6a8 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:06:10 cron.1          | => E, [2017-04-26T22:06:10.698126 #2304] ERROR -- #<Bunny::Session:0x5f72218 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:07:10 cron.1          | => E, [2017-04-26T22:07:10.767730 #2304] ERROR -- #<Bunny::Session:0x5faf000 postal@127.0.0.1:5672, vhost=/postal, addresses=[127.0.0.1:5672]>: Authentication with RabbitMQ failed: 403 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
22:07:29 system          | Supervisor received TERM signal
22:07:29 system          | Stopping Procodile supervisor

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

Seems rabbitMQ has incorrect credentials?

@adamcooke
Copy link
Contributor

Looks like your credentials for connecting to RabbitMQ in the config file are wrong.

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

sudo rabbitmqctl add_user postal XXX

At this step in the guide I replaced XXX with my own password, was that not correct?

@adamcooke
Copy link
Contributor

That certainly is correct, yes. Did you add it to postal.yml too?

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

Yes I configured passwords for main_db, message_db, and rabbitmq in postal.yml. I suppose it is possible I made a typo but I don't think so.

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

I have just changed all the passwords to confirm I did not make a mistake. I am still getting the error :(

@mu-arch
Copy link
Author

mu-arch commented Apr 26, 2017

I solved the problem by deleting the contents of /opt/postal/app/tmp/pids and then running postal start again.

I can now access the control panel. I don't have any idea what happened there, perhaps it was caused by a reboot I did during the installation steps.

Thanks for the help.

@mu-arch mu-arch closed this as completed Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants