ProjectEKA/consent-manager

docker-compose -f docker-compose-backend.yml up fails at consent-manager_keycloak_setup_1

Closed this issue · 11 comments

Logs: https://paste.ubuntu.com/p/CbyTW4hM8x/

I've got a fresh installation of linux for this project.

Server Environment

Ubuntu 20.04
Docker
Docker-Compose

Any help on what to do would be appreciated.

Hi there,

I tried your suggestion by running the dev setup, but I still get a similar error unfortunately.

The following commands work fine:

docker logs $(docker ps -aqf "name=^cm-db-setup$")
docker logs $(docker ps -aqf "name=^hiu-db-setup$")

but, docker logs $(docker ps -aqf "name=^keycloak-setup$") displays an error:

kavin@home-server:~$ docker logs $(docker ps -aqf "name=^keycloak-setup$")
"docker logs" requires exactly 1 argument.
See 'docker logs --help'.

Usage:  docker logs [OPTIONS] CONTAINER

Fetch the logs of a container

This is likely due the keycloak-setup crashing for me.

Logs: https://paste.ubuntu.com/p/3D4cnbpbZc/

can you check if keycloak is up and running at http://localhost:9001/auth/
from the logs, It might be the case that the keycloak db was not setup. if thats the case running the command below should resolve it

docker-compose -f docker-compose-infra-lite.yml run keycloak_setup

Logs when running that command: https://paste.ubuntu.com/p/8mk6Tj5dPq/

Keycloak seems to be working, I'm able to access it on my LAN network.

image
image

If you see the docker compose file, the keycloak runs on port 8080 and there is a port mapping of 9001 to 8080. Seems like your keycloak is setup properly, but most likely the realms are not set properly. You can add them manually, but may take a little effort to do so. @ganesanarun any particular reason that this should happen?
have you tried pruning all containers and volumes and rerunning the docker-compose again?

Hi @FireMasterK ,

In docker-compose-infra-lite.yml, can you change the KEYCLOAK_SERVER to your machine public ip and port as 9001 and check

KEYCLOAK_SERVER: http://{machine_public_ip}:9001/auth

@leelanakka when I tried your suggestion, I get a different error sometimes when starting it now.
Logs: https://paste.ubuntu.com/p/JSc8Gzh92d/
This leads me to belive that keycloak does not start up on time for the setup.

I tried running the command like 10-30 times, it worked 3 times in total, which makes me belive there's a race condition somewhere.
Like this: https://paste.ubuntu.com/p/XcFQNS8jX6/

If you guys need an environment to replicate the issue, try PWD, while it's slow, the issue can still be replicated on it.

Hi @FireMasterK ,

Thanks for reaching. we found out the issue and fixed it. it should be working fine after I merge #506 PR. Reply here if it doesn’t work

Hi there,

I just tried your changes in the pr.
Logs: https://paste.ubuntu.com/p/6vVYSF5DHs/

Appart from it failing and restarting 2-3 times, it works.

Thanks for getting back. closing this issue as it's resolved.