R
Railway13mo ago
agid6052

Unknown Host Exception

Hey guys! I'm currently facing a weird issue by trying to deploy my spring boot backend to railway. I always get the following error: Caused by: java.net.UnknownHostException project-id: 21fe5f38-a6b5-4843-b296-a6dde62aaa19 github-repository: https://github.com/Aegid1/Webtech_Projekt
GitHub
GitHub - Aegid1/Webtech_Projekt
Contribute to Aegid1/Webtech_Projekt development by creating an account on GitHub.
40 Replies
Percy
Percy13mo ago
Project ID: N/A
Brody
Brody13mo ago
bruh
agid6052
agid605213mo ago
do you know why this occurrs or did i configure my project just very badly? haha
Brody
Brody13mo ago
my bruh is directed towards you sending your plaintext database url
agid6052
agid605213mo ago
fixed it my bad, didnt know that is a problem
Brody
Brody13mo ago
its a public form lol
agid6052
agid605213mo ago
I am sorry
Brody
Brody13mo ago
show me a screenshot of your service variables please
agid6052
agid605213mo ago
with the corresponding values of the variables?
Brody
Brody13mo ago
we just went over this lol
agid6052
agid605213mo ago
Brody
Brody13mo ago
where is your database hosted
agid6052
agid605213mo ago
on postgres on railway
Brody
Brody13mo ago
okay redo that screenshot but no cropping
agid6052
agid605213mo ago
Brody
Brody13mo ago
delete the current database variables and setup variable references for all database variables https://docs.railway.app/develop/variables#reference-variables and then another screenshot when thats done please
agid6052
agid605213mo ago
agid6052
agid605213mo ago
the error is still there
Brody
Brody13mo ago
do you have private networking turned on in your service settings
agid6052
agid605213mo ago
i dont think so is this neccessary?
Brody
Brody13mo ago
just check
agid6052
agid605213mo ago
its not enabled
Brody
Brody13mo ago
@alex for your sins, you have to help
alex
alex13mo ago
@agid6052 can you send the whole error
agid6052
agid605213mo ago
agid6052
agid605213mo ago
well i think i also have to mention there are also some more errors above, but they just say: org.postgresql.util.PSQLException: The connection attempt failed. i dont know if that helps
alex
alex13mo ago
can you send me the connection code the code you're using to connect to it
agid6052
agid605213mo ago
you mean the code in my application.properties of my backend, right?
alex
alex13mo ago
sure im like 65% sure i know what your problem is just need to confirm
agid6052
agid605213mo ago
alex
alex13mo ago
line 1
- jbdc:{DATABASE_URL}
+ jbdc:postgresql://{PGHOST}:{PGPORT}/{PGDATABASE}
- jbdc:{DATABASE_URL}
+ jbdc:postgresql://{PGHOST}:{PGPORT}/{PGDATABASE}
sorry lemme edit a little more corrected the changes go do that
agid6052
agid605213mo ago
alright i give it a try
alex
alex13mo ago
SORRY i missed something check the new changes
agid6052
agid605213mo ago
now i get the following error
alex
alex13mo ago
welp thats all i can do for ya chief soz
agid6052
agid605213mo ago
can this error occurr due to my software logic? i also tried deploying a new SpringBoot app with the same configurations but no logic and for this case the deployment worked immediately thank you for your patience with me @Brody @alex thank you for your support guys, literally the fastest support ive ever seen haha. I just try to figure it out by myself now
alex
alex13mo ago
check the configuration differences did you use my configurations? or did you use your old ones
agid6052
agid605213mo ago
i used your ones yours*
agid6052
agid605213mo ago
alex
alex13mo ago
welp, its probably a you problem then haha keep trying you'll get it eventually i've ocme across this problem befoer and changing the configuration fixed it