Networking/DB problems with v18.0.0?

Is anyone experiencing network or database connection problems following the v18.0.0 release? I have a setup in a containerized environment, and I can no longer connect to the database. The setup is the exact same with the exception of the upgrade from the 17.0.1 to 18.0.0 docker images.

Caused by: java.net.UnknownHostException: staging-cluster.xxx.com:5432
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.base/java.net.Socket.connect(Socket.java:609)
 	at org.postgresql.core.PGStream.createSocket(PGStream.java:241)
	at org.postgresql.core.PGStream.<init>(PGStream.java:98)
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:109)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
	... 17 more

It is a function of the new option db-url-port (or KC_DB_URL_PORT env var). You used to be able to specify the host:port in the db-url-host var (or KC_DB_URL_HOST env var), but now it appears you must separate the two and specify them in the db-url-host and db-url-port variables respectively.

This isn’t included in the release notes (Keycloak 18.0.0 released - Keycloak) and probably got missed because most people are using defaults.

1 Like

The db-url-port is mentioned in the blog post, but not, that it’s necessary to use it actually.

Thanks for mentioning it here.

Thanks. I see it now. I think it should be clarified that host:port has to be separated now into those two vars, and can no longer be used together.

2 Likes