R
Railway•7mo ago
kenluzu

Cannot connect with private network in spring boot to postgres

I'm trying to connect with private network from my api rest. This is the config to connect in the source code jdbc:postgresql://[${PRIVATE_HOST}]:${PRIVATE_PORT}/${PROD_DB_NAME} variables PRIVATE_PORT: 5432 PRIVATE_HOST: postgres.railway.internal I'm not using own dockerfile I don't know what i'm doing wrong.
Solution:
that's for ipv6 addresses, that's a domain name not an ipv6 address
Jump to solution
11 Replies
Percy
Percy•7mo ago
Project ID: c0c4f992-a272-4995-86d2-dc367a7b9f81
kenluzu
kenluzu•7mo ago
c0c4f992-a272-4995-86d2-dc367a7b9f81
Brody
Brody•7mo ago
what errors are you getting
kenluzu
kenluzu•7mo ago
java.net.UnknownHostException: [postgres.railway.internal]
kenluzu
kenluzu•7mo ago
jdbc postgres docs says that I must enclose with []
No description
Solution
Brody
Brody•7mo ago
that's for ipv6 addresses, that's a domain name not an ipv6 address
kenluzu
kenluzu•7mo ago
sorry, how I get the ipv6 address to define in the datasource.url ?I thought that's enough x.x
Brody
Brody•7mo ago
you don't want to get the ipv6 address, I'm saying it's not an ipv6 address, therefore you don't need to enclose it with brackets
kenluzu
kenluzu•7mo ago
I thought I saw that they didn't support IPv4 D:
Brody
Brody•7mo ago
it's just a domain
kenluzu
kenluzu•7mo ago
it works 🥲 Sorry
Want results from more Discord servers?
Add your server