Databases not connecting after a failed payment
I have some services running on Railway for a long time but I missed the payment.
I paid and restarted all services but the databases were not connecting, I have 3 of them.
Kindly help
Solution:Jump to solution
tl;dr: add a 3 second sleep to the beginning of your start command and connect to the database over the private network
76 Replies
Project ID:
N/A
NA
@Brody kindly check this out
#🛂|readme #5
what do you need ?
please read it
I have
I am not sure what to look for
#5
read readme #5
ping
Okay, as i said earlier I have been trying to fix the db connection issue on my railway for about 6 hours now.
They are 3 different services and they are in production.
this affects our business.
are you on pro?
just checked, it's hobby
you should not be running a business on a hobby plan meant only for hobby projects, please upgrade to pro at your earliest convenience
understood
can you see my actual problem in the first message of the thread ?
what is the state of your database deployment
please tell me the state of the deployment
Active
send the deploy logs for postgres please -
https://bookmarklets.up.railway.app/log-downloader/
do i upload here ?
yes
thanks, show me a screenshot of the public networking
try re-deploying the database
thanks
can you connect to it
after showing this for a while, it sometimes open up the data then it disconnects again
please use a proper database client like dbgate
it works before now,
However, my interest is not seeing the db, but to make the connection work on the backend we are using.
The connection issue breaks the backend
are you able to connect to the database with dbgate?
i have been able to connect
using dbgate
have your application connect to the database via the private network
ok
the application log prints the same issue and it's now crashed
can't reach database server @ ....
please include the full error message
what is your current start script
start is default
The database itself fails to connect, so i don't think it is an issue from the application
I don't know what "start is default" means, please tell me what you have for your start script
i am not sure of that but we didnt put anything if it's the start command
please tell me what you have for your start script, if you are unfamiliar with node development, this can be found in your package.json
nest start
try changing that to
sleep 3 && nest start
doesn't work.
please show me your scripts
okay, i will check but just to be clear,
1. if i make a new environment of the databse and enter it to the application, it will work.
2. The app deploys and start properly, there is. no start problem as we have been using it until I noticed subscription ended today
please try my suggested fix
it doesn't work
im not seeing my suggested fix here?
i entered it directly on railway
please show me how you have implemented it
i edited this now, I am waiting for the build
I edited the "start" to with the value you sent
i had previously asked you to have your app connect to the database via the private network, please do that now
yes, i used it and it crashed,
I just tried it now, same thing
please always show the error
it's the same thing, no differnce
every little bit of info helps
im only trying to help you
thank you
is the database in the same project?
what does in the same project mean ?
same railway project
no
please show a screenshot of your railway project
i just tried creating a db in the project now, i deleted it after that.
I have 4 different services running.
1 worked well after making the payment but the remaining have issues with db connection
your database needs to be in the same project to use the private network
got it, what's to be done ?
move your bot service into the same project as the database
i don't see how to move it
its a manual process
i create a new database ?
i did not say that
manual is not clear
you need to deploy your bot service into the same project as the database
ok
this trick works.
Thanks!
no problem
you do need to keep the sleep 3
please dont remove that or you will face issues again
okay.
Why does it need the sleep 3
the private network is not available for the first 3 seconds
okay
but what's wrong with the public network
nothing, you had something missconfigured, so its better to use the private network as that wont result in database <--> service egress fees
okay, but the database doesn't connect as well, so could that be from me ?
this would be due to a misconfiguration on your side, unfortunately i was not able to find out what that is, but either way, using the private network is much preferred
okay, thanks
no problem!
Solution
tl;dr: add a 3 second sleep to the beginning of your start command and connect to the database over the private network