[error]instance refused connection.

Hi! I have successfully deployed my rails app, but some times i have this errors in my logs that do slow my app. What is it and how i can fix it?

otp [error]instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2023-05-20T11:10:43Z proxy[148e613c715489] otp [error]instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2023-05-20T11:10:45Z proxy[148e613c715489] otp [error]instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)

Pretty much all that is saying is that your server didn’t start, and to look at your log files to see why.

If you run locally, you will see that when rails starts up, it listens on that port:

% rails server -e production
=> Booting Puma
=> Rails 7.0.4.3 application starting in production 
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.6.5 (ruby 3.2.2-p53) ("Birdie's Version")
*  Min threads: 5
*  Max threads: 5
*  Environment: production
*          PID: 78030
* Listening on http://0.0.0.0:3000
Use Ctrl-C to stop

So the puzzle to be solved is why didn’t your server start? And the answer is in the logs.

1 Like

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