You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "unreal91 (via GitHub)" <gi...@apache.org> on 2025/01/24 12:22:01 UTC

[I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

unreal91 opened a new issue, #23891:
URL: https://github.com/apache/pulsar/issues/23891

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Read release policy
   
   - [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
   
   
   ### Version
   
   Running on docker in Mac OS Version 15.2
   Version:    27.4.0
   Context:    desktop-linux
   
   Pulsar versions 3.3.2, 4.0.2
   
   ### Minimal reproduce step
   
   When we run command 
   `docker run -it -p 6650:6650  -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:4.0.2 bin/pulsar standalone`
   
   Error is as below:
   
   `Error: Pulsar requires Java 17 or later.`
   
   Below docker compose also fails
   ```version: '3'
   services:
     zookeeper:
       image: apachepulsar/pulsar:latest
       container_name: zookeeper
       networks:
         - pulsar
       volumes:
         - ./data/zookeeper:/pulsar/data/zookeeper
       environment:
         - metadataStoreUrl=zk:zookeeper:2181
         - PULSAR_MEM=-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m
       command: >
         bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \
                bin/generate-zookeeper-config.sh conf/zookeeper.conf && \
                exec bin/pulsar zookeeper"
       healthcheck:
         test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"]
         interval: 10s
         timeout: 5s
         retries: 30
   
     pulsar-init:
       container_name: pulsar-init
       hostname: pulsar-init
       image: apachepulsar/pulsar:latest
       networks:
         - pulsar
       command: >
         bash -c "bin/pulsar initialize-cluster-metadata \
         --cluster cluster-a \
         --zookeeper zookeeper:2181 \
         --configuration-store zookeeper:2181 \
         --web-service-url http://broker:8080 \
         --broker-service-url pulsar://broker:6650"
       depends_on:
         zookeeper:
           condition: service_healthy
   
     bookie:
       image: apachepulsar/pulsar:latest
       container_name: bookie
       restart: on-failure
       networks:
         - pulsar
       environment:
         - clusterName=cluster-a
         - zkServers=zookeeper:2181
         - metadataServiceUri=metadata-store:zk:zookeeper:2181
         # otherwise every time we run docker compose uo or down we fail to start due to Cookie
         # See: https://github.com/apache/bookkeeper/blob/405e72acf42bb1104296447ea8840d805094c787/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java#L57-68
         - advertisedAddress=bookie
         - BOOKIE_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
       depends_on:
         zookeeper:
           condition: service_healthy
         pulsar-init:
           condition: service_completed_successfully
       # Map the local directory to the container to avoid bookie startup failure due to insufficient container disks.
       volumes:
         - ./data/bookkeeper:/pulsar/data/bookkeeper
       command: bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf && exec bin/pulsar bookie"
   
     broker:
       image: apachepulsar/pulsar:latest
       container_name: broker
       hostname: broker
       restart: on-failure
       networks:
         - pulsar
       environment:
         - metadataStoreUrl=zk:zookeeper:2181
         - zookeeperServers=zookeeper:2181
         - clusterName=cluster-a
         - managedLedgerDefaultEnsembleSize=1
         - managedLedgerDefaultWriteQuorum=1
         - managedLedgerDefaultAckQuorum=1
         - advertisedAddress=broker
         - advertisedListeners=external:pulsar://127.0.0.1:6650
         - PULSAR_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
       depends_on:
         zookeeper:
           condition: service_healthy
         bookie:
           condition: service_started
       ports:
         - "6650:6650"
         - "8080:8080"
       command: bash -c "bin/apply-config-from-env.py conf/broker.conf && exec bin/pulsar broker"
   
   networks:
     pulsar:
       external: true
       name: web-admin_default
     ```
   
   ### What did you expect to see?
   
   Run pulsar as normal. 
   
   ### What did you see instead?
   
   Error is as below:
   `Error: Pulsar requires Java 17 or later.`
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615070670

   @unreal91 What Apple chip do you run on? Is it Apple M4? In that case, it could be this JVM bug: https://bugs.openjdk.org/browse/JDK-8345296 / https://github.com/corretto/corretto-21/issues/85 . The workaround is to pass `-XX:UseSVE=0` JVM option.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "unreal91 (via GitHub)" <gi...@apache.org>.
unreal91 commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615058077

   @lhotari 
   
   docker run --rm apachepulsar/pulsar:4.0.2 java -version
   
   Output for above command
   
   ```
   #
   # A fatal error has been detected by the Java Runtime Environment:
   #
   #  SIGILL (0x4) at pc=0x0000ffff9793fc5c, pid=1, tid=7
   #
   # JRE version:  (21.0.5+11) (build )
   # Java VM: OpenJDK 64-Bit Server VM (21.0.5+11-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
   # Problematic frame:
   # j  java.lang.System.registerNatives()V+0 java.base
   #
   # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
   #
   # An error report file with more information is saved as:
   # /tmp/hs_err_pid1.log
   [0.073s][warning][os] Loading hsdis library failed
   #
   # The crash happened outside the Java Virtual Machine in native code.
   # See problematic frame for where to report the bug.
   ```
   
   I will try on a different machine, I am not sure whats the issue with my machine, it was working earlier and then stopped working, when it pulled new images using latest.
   
   What I did is downloaded the standalone binary zip, extracted it, created a dockerfile with FROM openjdk:24-jdk-slim and ran it using `/bin/pulsar standalone` command, this works on my machine, its something to do with the Java base image that is in the `apachepulsar/pulsar:latest` image.
   my new dockerfile looks something like below:
   ```
   FROM openjdk:24-jdk-slim
   
   WORKDIR /usr/src/app
   COPY . /usr/src/app
   ```
   
   dokcer-compose.yml
   ```
   services:
     pulsar:
       build:
         context: .
         dockerfile: Dockerfile
       command: [bin/pulsar, standalone ]
       image: pulsar-service
       ports:
         - '6650:6650'
         - '8080:8080'
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615087017

   This problem will be fixed in Pulsar 4.0.3 docker images which will include a Corretto version that includes the fix.
   The fix became available a few days ago, https://github.com/corretto/corretto-21/issues/85#issuecomment-2605714791.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2614913354

   > ### Version
   > Running on docker in Mac OS Version 15.2 Version: 27.4.0 Context: desktop-linux
   > 
   > Pulsar versions 3.3.2, 4.0.2
   > 
   > ### Minimal reproduce step
   > When we run command `docker run -it -p 6650:6650 -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:4.0.2 bin/pulsar standalone`
   
   @unreal91 I'm not able to reproduce with these instructions. It's some issue in your environment. Have you had a chance to try on a different computer?
   
   What happens when you run this command?
   ```shell
   docker run --rm apachepulsar/pulsar:4.0.2 java -version
   ```
   
   Please ensure that `Digest: sha256:8c0729055f56a8e30dec5d3cc7f85bd1aea9485858e95da57b96b9e43833b910` is what you see when you run `docker pull apachepulsar/pulsar:4.0.2` (or check the Id with `docker inspect apachepulsar/pulsar:4.0.2`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Pulsar Docker container fails to start on Apple M4 / Sequoia 15.2 with error "Pulsar requires Java 17 or later" [pulsar]

Posted by "Shawyeok (via GitHub)" <gi...@apache.org>.
Shawyeok commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-3220780904

   @unreal91 
   Feel free to close this issue if it's resolved.
   
   ```shell
   docker run -e --rm apachepulsar/pulsar:4.0.6 java -version
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Pulsar Docker container fails to start on Apple M4 / Sequoia 15.2 with error "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #23891: [Bug] Pulsar Docker container fails to start on Apple M4 / Sequoia 15.2 with error "Pulsar requires Java 17 or later"
URL: https://github.com/apache/pulsar/issues/23891


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615034833

   If you are running on Docker Desktop, it's possible that it's in bad state. Clearing all data in the docker environment could be one way to resolve such issues. Obviously that will delete all data stored in docker containers, images and volumes.
   
   ![Image](https://github.com/user-attachments/assets/c80b2259-0b66-40f6-b346-5cf793b8da89)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Pulsar Docker container fails to start on Apple M4 / Sequoia 15.2 with error "Pulsar requires Java 17 or later" [pulsar]

Posted by "unreal91 (via GitHub)" <gi...@apache.org>.
unreal91 commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615128820

   @lhotari thank you for the workaround, yes I am running on Apple M4 chip, really appreciate for the quick update on this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Run pulsar in docker container is failing with "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-2615079615

   Does this command work:
   
   ```shell
   docker run -e "_JAVA_OPTIONS=-XX:UseSVE=0" --rm apachepulsar/pulsar:4.0.2 java -version
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Pulsar Docker container fails to start on Apple M4 / Sequoia 15.2 with error "Pulsar requires Java 17 or later" [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23891:
URL: https://github.com/apache/pulsar/issues/23891#issuecomment-3220813436

   Closing this issue since it's resolved since 4.0.3.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org