R
Railway2mo ago
Corey

We were unable to connect to the registry for this image.

project id: af3a9477-0f60-4b89-bf4f-fa5ff16bc99b Rails 7.2.1 app that is fairly barebones is having issues building. Locally, the app works fine. There is a Dockerfile present, however I'm not using it when developing locally. But it is the one that auto generates with rails. Looks to me it got through almost all of the build steps, but ultimately failed and says:
=========================

Container failed to start

=========================



We were unable to connect to the registry for this image. If this error persists, please reach out to the Railway team.
=========================

Container failed to start

=========================



We were unable to connect to the registry for this image. If this error persists, please reach out to the Railway team.
Solution:
ultimately, i had to use a database_url within rails to get railway to be happy. once i did that, it all worked. it's possible i wasn't using a db port or some piece of it that was causing the connection via env vars to fail
Jump to solution
20 Replies
Percy
Percy2mo ago
Project ID: af3a9477-0f60-4b89-bf4f-fa5ff16bc99b
Brody
Brody2mo ago
what service? i dont see anything failed
Corey
CoreyOP2mo ago
Believe its service id: fea98c3a-19b1-44cc-8e0d-57c0189aebce
Brody
Brody2mo ago
that service does not exist within the given project
Brody
Brody2mo ago
thank you it looks to be a very missleading message, i think this is user error
Corey
CoreyOP2mo ago
do you have any other information about the issue? Let me try something - I just tweaked some files and got a different output.
Brody
Brody2mo ago
from our logs - open executable: Permission denied we get that when we try starting your container, dont know why the user facing error is mentioning a registry
Corey
CoreyOP2mo ago
I was able to setup the railway cli, and do a deploy up and now I can clearly see the issue.
Brody
Brody2mo ago
awsome
Corey
CoreyOP2mo ago
:thinkingverymuch: I'm still having issues getting my DB connected. It seems like everything is setup correctly. I'm also getting
Attempt #1 failed with service unavailable. Continuing to retry for 4m52s
Attempt #2 failed with service unavailable. Continuing to retry for 4m51s
Attempt #3 failed with service unavailable. Continuing to retry for 4m49s
Attempt #4 failed with service unavailable. Continuing to retry for 4m45s
Attempt #5 failed with service unavailable. Continuing to retry for 4m37s
Attempt #6 failed with service unavailable. Continuing to retry for 4m21s
Attempt #7 failed with service unavailable. Continuing to retry for 3m51s
Attempt #8 failed with service unavailable. Continuing to retry for 3m21s
Attempt #9 failed with service unavailable. Continuing to retry for 2m51s
Attempt #10 failed with service unavailable. Continuing to retry for 2m21s
Attempt #11 failed with service unavailable. Continuing to retry for 1m51s
Attempt #12 failed with service unavailable. Continuing to retry for 1m21s
Attempt #13 failed with service unavailable. Continuing to retry for 51s
Attempt #1 failed with service unavailable. Continuing to retry for 4m52s
Attempt #2 failed with service unavailable. Continuing to retry for 4m51s
Attempt #3 failed with service unavailable. Continuing to retry for 4m49s
Attempt #4 failed with service unavailable. Continuing to retry for 4m45s
Attempt #5 failed with service unavailable. Continuing to retry for 4m37s
Attempt #6 failed with service unavailable. Continuing to retry for 4m21s
Attempt #7 failed with service unavailable. Continuing to retry for 3m51s
Attempt #8 failed with service unavailable. Continuing to retry for 3m21s
Attempt #9 failed with service unavailable. Continuing to retry for 2m51s
Attempt #10 failed with service unavailable. Continuing to retry for 2m21s
Attempt #11 failed with service unavailable. Continuing to retry for 1m51s
Attempt #12 failed with service unavailable. Continuing to retry for 1m21s
Attempt #13 failed with service unavailable. Continuing to retry for 51s
despite this page working just fine: https://relisa-api-production.up.railway.app/up
Corey
CoreyOP2mo ago
Thx. As for the DB, I'm getting:
[2f5ce1fe-5e91-4392-92f8-db953a8d95bd] Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2))
[2f5ce1fe-5e91-4392-92f8-db953a8d95bd] Mysql2::Error::ConnectionError (Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2))
my db config in code:
production:
<<: *default
database: <%= ENV['DATABASE_NAME'] %>
username: <%= ENV['DATABASE_USERNAME'] %>
password: <%= ENV['DATABASE_PASSWORD'] %>
host: <% ENV['DATABASE_HOST'] %>
port: 3306
production:
<<: *default
database: <%= ENV['DATABASE_NAME'] %>
username: <%= ENV['DATABASE_USERNAME'] %>
password: <%= ENV['DATABASE_PASSWORD'] %>
host: <% ENV['DATABASE_HOST'] %>
port: 3306
and I've got those 4 things set in my env in railway. Am I missing something?
Brody
Brody2mo ago
is your app is trying to connect to a socket, then it is most definitely not using those environment variables
Corey
CoreyOP2mo ago
I’m not sure why it’s even doing the socket, I’ve never had a rails app do that. Okay socket must mean by env vars are bad. I’ll try to sort that out.
Brody
Brody2mo ago
sounds good
Corey
CoreyOP2mo ago
Was able to get it all done, thanks @Brody !
Brody
Brody2mo ago
awsome, what was the issue?
Solution
Corey
Corey2mo ago
ultimately, i had to use a database_url within rails to get railway to be happy. once i did that, it all worked. it's possible i wasn't using a db port or some piece of it that was causing the connection via env vars to fail
Brody
Brody2mo ago
sounds good
Want results from more Discord servers?
Add your server