Can't connect to MongoDB

I added a variable reference of MONGO_PRIVATE_URL to one of my other services in the same project with the MongoDB. However, my backend keeps showing the following error:
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: mongodb.railway.internal:27017: [Errno -2] Name or service not known (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 6696c14bd809eb13faaf84ac, topology_type: Unknown, servers: [<ServerDescription ('mongodb.railway.internal', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('mongodb.railway.internal:27017: [Errno -2] Name or service not known (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: mongodb.railway.internal:27017: [Errno -2] Name or service not known (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 6696c14bd809eb13faaf84ac, topology_type: Unknown, servers: [<ServerDescription ('mongodb.railway.internal', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('mongodb.railway.internal:27017: [Errno -2] Name or service not known (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
I think the url is correctly configured because the error message explicitly states mongodb.railway.internal:27017, however it can't seem to reach the URL. Project ID: 89fdc23e-198d-43a2-8668-61b5b0306414 Service ID: a83ed6ae-fd71-4dab-b09a-771f7b82a336 Deployment ID: 0a0364b3-c4e4-4ec6-91a2-305a8c8e2162
Solution:
enable it
Jump to solution
8 Replies
Percy
Percy5mo ago
Project ID: 89fdc23e-198d-43a2-8668-61b5b0306414,a83ed6ae-fd71-4dab-b09a-771f7b82a336,0a0364b3-c4e4-4ec6-91a2-305a8c8e2162
Brody
Brody5mo ago
do you get this during build or runtime?
heyronii
heyroniiOP5mo ago
runtime, sorry if I tagged this wrong
Brody
Brody5mo ago
do you have the V2 runtime enabled?
heyronii
heyroniiOP5mo ago
No, I do not
Solution
Brody
Brody5mo ago
enable it
heyronii
heyroniiOP5mo ago
Waiting for "Deploy › Creating containers...", it's taking a bit of time. Will let you know if it resolves it @Brody it's deployed and it's working. Thank you
Brody
Brody5mo ago
no problem!
Want results from more Discord servers?
Add your server