R
Railway•10mo 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•10mo ago
Project ID: c0c4f992-a272-4995-86d2-dc367a7b9f81
kenluzu
kenluzuOP•10mo ago
c0c4f992-a272-4995-86d2-dc367a7b9f81
Brody
Brody•10mo ago
what errors are you getting
kenluzu
kenluzuOP•10mo ago
java.net.UnknownHostException: [postgres.railway.internal]
kenluzu
kenluzuOP•10mo ago
jdbc postgres docs says that I must enclose with []
No description
Solution
Brody
Brody•10mo ago
that's for ipv6 addresses, that's a domain name not an ipv6 address
kenluzu
kenluzuOP•10mo ago
sorry, how I get the ipv6 address to define in the datasource.url ?I thought that's enough x.x
Brody
Brody•10mo 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
kenluzuOP•10mo ago
I thought I saw that they didn't support IPv4 D:
Brody
Brody•10mo ago
it's just a domain
kenluzu
kenluzuOP•10mo ago
it works 🥲 Sorry
Want results from more Discord servers?
Add your server