Camunda 8 Self Managed docker compose keycloak not start

Hi,
I run this docker compose configuration camunda-platform/docker-compose.yaml at main · camunda/camunda-platform · GitHub to start a development environment locally.

But the keycloak container don’t start. The message is:

Added 'admin' to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json', restart server to load user -b 0.0.0.0

/opt/jboss/tools/docker-entrypoint.sh: line 165: DB_ADDR: unbound variable

How can I resolve this?
Thanks,

Hey @valiu!
I have tried to reproduce your issue but was not successful. On my machine everything is running perfectly fine. Maybe you should make sure that you do not have any other docker containers up and running. I would especially look out for any other Postgres container. :thinking:

When I run into issues with Docker Desktop I always try to remove as many preexisting containers as possible to make sure everything is cleaned up. :smiley:

If this does not work you could maybe try and run the core docker-compose file which does not include IAM and Security.

Let me know if this works out for you!
Best,
Thomas

Hi @Hafflgav

I removed any containers, camunda8 is the single one, but the problem persist.

The environment is:
MacOS 12.4
Docker Desktop 4.9.1

Camunda 8 Docker Compose Core run without problems, but I am interested in Camunda 8 Docker Compose because I need to evaluate Optimize and Identity.

Thanks,

Hi @valiu,

What processor architecture do you have in your Mac? Is it M1/arm64?

Best,
Aleksander

Hi @aleksander-dytko
Is Intel:

Processor Name: 6-Core Intel Core i7
Processor Speed: 2,6 GHz

Puh… That’s an interesting behaviour. I am running on the exact same versions of Docker and MacOS and do have an Intel CPU as well.
I guess you have already tried out to remove everything (all containers, images, volumes) and retry the docker-compose up command?

If this does not work maybe try to install it via KIND Kubernetes and Helm on your local machine?

Hi @Hafflgav

Indeed I removed everything (containers, images, volumes) but still don’t start the keycloak container.
As for KIND Kubernetes and Helm, I find more difficult to install locally than docker-compose.

Thanks,

Hi @Hafflgav

I managed to start the keycloak container inspired by this post: DB_ADDR unbound variable error - #13 by lmsurpre - Configuring the server - Keycloak

So, I added DB_VENDOR=h2 to keycloak parameters:

  keycloak: # https://hub.docker.com/r/jboss/keycloak
    container_name: keycloak
    image: jboss/keycloak:${KEYCLOAK_VERSION:-16.1.1}
    ports:
      - "18080:8080"
    environment:
      DB_VENDOR: h2
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: admin
    volumes:
      - "./.keycloak/themes/identity:/opt/jboss/keycloak/themes/identity"
    networks:
      - identity-network

But, now Optimize container didn’t start :frowning:
It says:

*Starting Camunda Optimize 3.8.2...*

*15:38:08.026 [main] INFO  o.c.o.s.e.OptimizeElasticsearchClientFactory - Initializing Elasticsearch rest client...*
*15:38:13.735 [main] ERROR o.c.o.s.e.OptimizeElasticsearchClientFactory - Can't connect to any Elasticsearch node [[host=http://elasticsearch:9200]]. Please check the connection!*
*org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused*

Elasticsearch container works. A GET on http://localhost:9200 return:

{
  "name" : "41227efc0e91",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "8lVzr8rgSQOjxmCkaj3_0g",
  "version" : {
    "number" : "7.17.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "bee86328705acaa9a6daede7140defd4d9ec56bd",
    "build_date" : "2022-01-28T08:36:04.875279988Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
1 Like

Thanks @valiu for sharing your solution! :slight_smile:
It is weird that it works with a H2 database but not with PostgreSQL on your machine. At least you have figured out a workaround - that’s great!

1 Like

Can you help me with Optimize, why is not connecting to http://elasticsearch:9200?

thanks,

You are having very weird problems with Docker @valiu :smiley:
If you are using the out of the box docker-compose file I do not experience any problems at all. :thinking:

Maybe it is worth creating a new forum post for this issue and share some log outputs if you do have them.

1 Like

I had the same problem for keycloak. The root cause of the issue is due to the network you are using.I found this issue when I sit in the public coffee shop) , keycloak failed to start. As soon as I switch to my cell phone as a hotspot, it works perfectly.

After a bit digging, keycloak use “getent…” to find the possible DBs on the network. You can run “getent hosts postgres”. For the public network, mine shows “52.26.148.183 app.nyansa.com postgres.nyansa.com” which I have no idea what they are. When I switch to my hotspot, it is nothing returned.

And you are right, if you add the DB_Vendor , that will bypass the getent logic in the start script in keycloak container.

My optimize container seems always work. No idea why yours failed. Well, a simple way maybe just change to a simple network.

Thanks @emailtowalter
I am in my own network so it did not apply your solution.
For Optimize container I found the issue, please see: Camunda 8 Self Managed docker-compose Optimize not starting

Glad to hear your problem is resolved. I was not aware of the volume issue on Mac. Learn something new. Thanks