Closed lmsurpre closed 3 years ago
I checked the docker-entrypoint.sh
and it should only get to this line if DB_VENDOR is set to "postgres". I looked all over and I cannot understand what could be setting that. I ended up working around the issue by dropping this line into KeycloakContainer.configure:
withEnv("DB_VENDOR", "H2");
With that, its now working for me.
This seems to be a configuration issue with your local/used environment, not with the Keycloak Testcontainer itself.
See also here, perhaps there's an approach which may help you: https://keycloak.discourse.group/t/db-addr-unbound-variable-error/2077
Thanks @dasniko. I still have no clue why Keycloak thinks it should use Postgres (I double-checked that I have no related env vars in my session), but as I mentioned above I was able to override that by explicitly setting DB_VENDOR to H2. I agree thats not an issue with this project, so let's mark this one closed.
Figured out the cause of my issue and posted it at https://keycloak.discourse.group/t/db-addr-unbound-variable-error/2077/12
The keycloak db type detection algorithm seems a bit brittle, so it might be a good idea to recommend folks to set DB_VENDOR explicitly.
Good hint, @lmsurpre Will think about setting this as a default. Thank you!
I grabbed the latest from master, loaded it into eclipse, and tried to execute KeycloakContainerTest.java but the container failed to start.
I thought it had worked for me the first time, but I have no idea why it would suddenly stop working, and so I'm guessing that I had just missed the log output that said it failed.