Npgsql.npgsqlException (0x80004005) Failed to connect to 76.76.21.21:5432

Hi! im trying to connect to an ASP.Net core 6 to railway.app for the first time and i receive the indicated error message. can somebody help me? Npgsql.npgsqlException (0x80004005) Failed to connect to 76.76.21.21:5432
25 Replies
Percy
Percy13mo ago
Project ID: a19b97b8-4fef-403c-afd7-4ce7f8a5b775
Nando Aracena
Nando Aracena13mo ago
a19b97b8-4fef-403c-afd7-4ce7f8a5b775
ThallesComH
ThallesComH13mo ago
is your database hosted on Vercel?
Nando Aracena
Nando Aracena13mo ago
i dont know im using postgreSQL
ThallesComH
ThallesComH13mo ago
that errors mean you're trying to connect to an IP from Vercel on the 5432 port, you probably don't want that did you created a postgres database in railway?
Nando Aracena
Nando Aracena13mo ago
yes is empty
ThallesComH
ThallesComH13mo ago
did you set the enviroment variables correctly?
Nando Aracena
Nando Aracena13mo ago
no, i didnt set anything i followed a youtube tutorial and they dont explained there i supossed was not necessary
ThallesComH
ThallesComH13mo ago
ok so after you create a database on railway, you can reference the environment variables from there
No description
ThallesComH
ThallesComH13mo ago
and in your code you use that enviroment variables to start the connection.
Nando Aracena
Nando Aracena13mo ago
ok, i will try Hi! I don't understand how to do it. Is there some video to help with this?
Adam
Adam13mo ago
the variables referenced above are available in your database. share those variables to your other services and reference them to connect
Nando Aracena
Nando Aracena13mo ago
So, for example PGPORT = 3000 and fill out all the variables?
ThallesComH
ThallesComH13mo ago
No, by reference we mean that the Postgres database fill out those for you automatically. So, if you choose PGPASSWORD from the dropdown above
No description
Want results from more Discord servers?
Add your server