Error to connect on databa service (Postgrees) from an api services

I am getting an issue after the build on my backend(node) service on railway: (node:7) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) [ERROR] PrismaClientInitializationError: Can't reach database server at monorail.proxy.rlwy.net:33778 Please make sure your database server is running at monorail.proxy.rlwy.net:33778. at startFn (/app/node_modules/@prisma/client/runtime/index.js:27186:17) { clientVersion: '4.4.0', errorCode: 'P1001' } But the database is running, and while the build we connect to the database for check the migrations and everything works normally, but on the deploy logs the procjet receive this erros. but if i run my project locally and set the database for my database remote from railway, the project works normally
No description
7 Replies
Percy
Percy11mo ago
Project ID: ff5eeed5-c565-48eb-8aab-ab64eab41500
Matheus Benites
Matheus BenitesOP11mo ago
ff5eeed5-c565-48eb-8aab-ab64eab41500
Solution
Matheus Benites
Matheus BenitesOP11mo ago
sure, testing it now. my database url is like: postgresql://[USER]:[PASS]@monorail.proxy.rlwy.net:33778/railway?connect_timeout=30&pool_timeout=30&socket_timeout=30
Brody
Brody11mo ago
yes but please make sure you are using referance variables, never hardcode the connection string https://docs.railway.app/guides/variables#referencing-another-services-variable
Matheus Benites
Matheus BenitesOP11mo ago
It's worked to me, thank you so much
Brody
Brody11mo ago
no problem
Want results from more Discord servers?
Add your server