Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sirix-keycloak-1 | User with username 'admin' already added to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json' #581

Open
AlvinKuruvilla opened this issue Feb 21, 2023 · 7 comments

Comments

@AlvinKuruvilla
Copy link
Contributor

Describe the bug
When running sirix with docker compose up or docker compose up keycloak it initially adds an admin user to the JSON. However, if afterwards you stop the container and rerun it, keycloak will continuously try to add the admin user again and keep failing, giving output like this:
image

To Reproduce

  1. Run docker compose up or docker compose up keycloak
  2. After everything is setup stop the container and rerun the command again

Expected behavior
I would suspect that it should not fail if the admin user already exists

Additional context
I know in the error it gives a path to /opt where a JSON file is; I tried looking for it there but all I could find was an empty sirix-data folder
This issue also makes it impossible to visit the keycloak web UI

@JohannesLichtenberger
Copy link
Member

Can you check what’s wrong in the proposed fix in #541 and the PR?

@AlvinKuruvilla
Copy link
Contributor Author

I'll take a look thanks

@AlvinKuruvilla
Copy link
Contributor Author

Thanks for the suggestion @JohannesLichtenberger the PR fixed the issue I was having, I think we should consider merging that in.

@JohannesLichtenberger
Copy link
Member

The sirix-rest-api tests failed, as I think the user will not be created anymore, IIRC. Can you confirm that or make a new PR and we can have a look?

@AlvinKuruvilla
Copy link
Contributor Author

I went into bundles/sirix-rest-api and then ran gradle build -x test like the README suggests and I get the following error:
image

@redwanulsourav
Copy link
Contributor

For future references, I also followed same issue while working on the project on Windows using Docker. According to this answer on stackoverflow, it happens if keycloak was interrupted during boot. But for my case my keycloak wasn't interrupted still I got the same error.

The fix mentioned in the answer worked for me.

I also noticed that this didn't happen when I switched to a Linux machine. (Though it happen only once, then I stopped the container and restarted it and it was fixed)

@JohannesLichtenberger
Copy link
Member

Strange, though the tests failed with the PR, sadly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants