I'm on Ubuntu 20, working on a Rails 7 project. I've succesfully created a Heroku app using heroku create appname
and then deployed the Rails app using git push heroku master
.
The app/website is accessible and works fine on Heroku, but I'm not being able to run most console commands using the Heroku cli
.
I can deploy as described above, and also set environment variables via heroku config:set TWILIO_KEY='123'
, but commands like heroku run rails db:migrate
, heroku run rails console
and most if not any other commands that I try to run via heroku run command
return the following error (IP changes every time):
Running rails console on ⬢ appname... done
Error: connect ECONNREFUSED 54.175.164.234:5000
Right after I run any of these commands from my console, I can see the app logs on Heroku updating accordingly and throwing an error.
For example, for the heroku run rails console
command executed above, the app logs show:
2022-05-31T00:42:11.048694 00:00 app[api]: Starting process with command `rails console` by user [email protected]
2022-05-31T00:44:34.314621 00:00 heroku[run.6356]: Awaiting client
2022-05-31T00:44:34.307905 00:00 heroku[run.6356]: State changed from starting to up
2022-05-31T00:45:04.332589 00:00 heroku[run.6356]: Process exited with status 128
2022-05-31T00:45:04.332006 00:00 heroku[run.6356]: Error R13 (Attach error) -> Failed to attach to process
2022-05-31T00:45:04.389840 00:00 heroku[run.6356]: State changed from up to complete
The Heroku docs do not provide more information on R13 or status 128 error codes.
The error code itself does not provide any other information regarding the connection to what is failing either. Could it be the DB? The connection to Heroku itself is clearly not the problem.
Any help would be appreciated.
CodePudding user response:
This problem was related to my ISP blocking connections using port 5000, and it was evident when running a telnet
I could not connect directly to the server either.
A workaround that works if you can't get your ISP to fix it is using a VPN.