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

Keycloak container fails to create directory? #813

Open
sorenwacker opened this issue Oct 24, 2024 · 0 comments
Open

Keycloak container fails to create directory? #813

sorenwacker opened this issue Oct 24, 2024 · 0 comments
Labels
Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected

Comments

@sorenwacker
Copy link

sorenwacker commented Oct 24, 2024

I am trying to run webprotege with docker compose.

Unfortunately, the setup suggested at [email protected]:protegeproject/webprotege-deploy.git does not work out-of-the-box without modifications. I mainly change the volumnes to be local subdirectories. And all containers now start, except for keycloak.

This is my setup:

  keycloak:
    image: protegeproject/keycloak
    # ports:
    #   - 8080:8080
    environment:
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: password
      PROXY_ADDRESS_FORWARDING: "true"
      KEYCLOAK_LOGLEVEL: DEBUG
      KEYCLOAK_FRONTEND_URL: "http://webprotege-local.edu/auth"
      KEYCLOAK_IMPORT: /tmp/webprotege.json
      KEYCLOAK_HOSTNAME_ADMIN_URL: "http://webprotege-local.edu/auth"
    volumes:
      - ./data/keycloak-h2:/opt/jboss/keycloak/standalone/data
      - ./data/keycloak-tmp:/tmp
    healthcheck:
      test: [ "CMD", "curl", "--fail", "http://localhost:8080/auth/realms/master" ]
      interval: 30s
      timeout: 10s
      retries: 5

But then it fails with:

keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  |   Using Embedded H2 database
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  |   JBoss Bootstrap Environment
keycloak-1  | 
keycloak-1  |   JBOSS_HOME: /opt/jboss/keycloak
keycloak-1  | 
keycloak-1  |   JAVA: java
keycloak-1  | 
keycloak-1  |   JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true   --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  | 08:55:52,933 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
keycloak-1  | java.lang.IllegalStateException: WFLYSRV0126: Could not create server content directory: /opt/jboss/keycloak/standalone/data/content
keycloak-1  | 	at [email protected]//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:494)
keycloak-1  | 	at [email protected]//org.jboss.as.server.Main.determineEnvironment(Main.java:407)
keycloak-1  | 	at [email protected]//org.jboss.as.server.Main.main(Main.java:96)
keycloak-1  | 	at org.jboss.modules.Module.run(Module.java:353)
keycloak-1  | 	at org.jboss.modules.Module.run(Module.java:321)
keycloak-1  | 	at org.jboss.modules.Main.main(Main.java:617)
keycloak-1  | 08:55:53,590 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1
keycloak-1  | 
keycloak-1 exited with code 1

I tried to create that folder for the tool manually as suggested here.

data/keycloak-h2/
└── content

But then another error is raised:

keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  |   Using Embedded H2 database
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  |   JBoss Bootstrap Environment
keycloak-1  | 
keycloak-1  |   JBOSS_HOME: /opt/jboss/keycloak
keycloak-1  | 
keycloak-1  |   JAVA: java
keycloak-1  | 
keycloak-1  |   JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true   --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
keycloak-1  | 
keycloak-1  | =========================================================================
keycloak-1  | 
keycloak-1  | 09:09:17,634 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
keycloak-1  | java.lang.IllegalStateException: WFLYSRV0231: Could not read or create the server UUID in file: /opt/jboss/keycloak/standalone/data/kernel/process-uuid
keycloak-1  | 	at [email protected]//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:594)
keycloak-1  | 	at [email protected]//org.jboss.as.server.Main.determineEnvironment(Main.java:407)
keycloak-1  | 	at [email protected]//org.jboss.as.server.Main.main(Main.java:96)
keycloak-1  | 	at org.jboss.modules.Module.run(Module.java:353)
keycloak-1  | 	at org.jboss.modules.Module.run(Module.java:321)
keycloak-1  | 	at org.jboss.modules.Main.main(Main.java:617)
keycloak-1  | Caused by: java.nio.file.AccessDeniedException: /opt/jboss/keycloak/standalone/data/kernel
keycloak-1  | 	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
keycloak-1  | 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
keycloak-1  | 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
keycloak-1  | 	at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
keycloak-1  | 	at java.base/java.nio.file.Files.createDirectory(Files.java:690)
keycloak-1  | 	at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:797)
keycloak-1  | 	at java.base/java.nio.file.Files.createDirectories(Files.java:783)
keycloak-1  | 	at [email protected]//org.jboss.as.controller.operations.common.ProcessEnvironment.obtainProcessUUID(ProcessEnvironment.java:193)
keycloak-1  | 	at [email protected]//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:592)
keycloak-1  | 	... 5 more
keycloak-1  | 09:09:18,260 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1
keycloak-1  | 
keycloak-1 exited with code 1
@sorenwacker sorenwacker added Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Should be the default status for issues that have been acknowledged, but not yet processed. Type: Bug Indicates that WebProtege is not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant