buildpacks / spec

Specification for Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
250 stars 69 forks source link

Launcher CNB_PLATFORM_API failed to get platform API version #381

Open SAURABH110894 opened 8 months ago

SAURABH110894 commented 8 months ago

Hi Team,

I'm using CNB Apache-Tomcat Image, It was all running fine before, but now we have updated to Apache Tomcat 9.0.82 and we are getting below error.

ERROR: failed to get platform API version; please set 'CNB_PLATFORM_API' to specify the desired platform API version


> root@4c417129d5ee:/workspace# launcher /cnb/process/web
> Setting Active Processor Count to 2
> Calculating JVM memory based on 9998876K available memory
> For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
> Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx9424697K -XX:MaxMetaspaceSize=62178K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 9998876K, Thread Count: 250, Loaded Class Count: 8564, Headroom: 0%)
> Enabling Java Native Memory Tracking
> Adding 137 container CA certificates to JVM truststore
> ERROR: failed to get platform API version; please set 'CNB_PLATFORM_API' to specify the desired platform API version

I'm using launcher, running certain command and triggering launcher /cnb/process/web command.

Could you please help me to fix this error.

Regards Saurabh

SAURABH110894 commented 8 months ago

@natalieparellano , Could you please help us in this issue ?

natalieparellano commented 8 months ago

@SAURABH110894 I believe this error is surfacing because you are calling the launcher with the launcher (/cnb/process/web is a symlink to the launcher). Can you try just /cnb/process/web?

SAURABH110894 commented 8 months ago

@SAURABH110894 I believe this error is surfacing because you are calling the launcher with the launcher (/cnb/process/web is a symlink to the launcher). Can you try just /cnb/process/web?

@natalieparellano Yes I did same,

Below is output.

cnb@b3f95129ae5e:/workspace$ /cnb/process/web Setting Active Processor Count to 8 Calculating JVM memory based on 7379076K available memory For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx6804897K -XX:MaxMetaspaceSize=62178K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 7379076K, Thread Count: 250, Loaded Class Count: 8564, Headroom: 0%) Enabling Java Native Memory Tracking Adding 137 container CA certificates to JVM truststore Using CATALINA_BASE: /layers/paketo-buildpacks_apache-tomcat/catalina-base Using CATALINA_HOME: /layers/paketo-buildpacks_apache-tomcat/tomcat Using CATALINA_TMPDIR: /tmp Using JRE_HOME: /layers/paketo-buildpacks_bellsoft-liberica/jre Using CLASSPATH: /layers/paketo-buildpacks_apache-tomcat/catalina-base/bin/tomcat-logging-support-3.4.0.RELEASE.jar:/layers/paketo-buildpacks_apache-tomcat/tomcat/bin/bootstrap.jar:/layers/paketo-buildpacks_apache-tomcat/tomcat/bin/tomcat-juli.jar Using CATALINA_OPTS: -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --illegal-access=warn -Dio.netty.tryReflectionSetAccessible=true -Xlog:gc*:file=/tmp/gc.log:time,uptime,level,tags:filecount=100,filesize=10m -Dfile.encoding=UTF-8 -XX:ActiveProcessorCount=8 -XX:MaxDirectMemorySize=10M -Xmx6804897K -XX:MaxMetaspaceSize=62178K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics OpenJDK 64-Bit Server VM warning: Native Memory Tracking did not setup properly, using wrong launcher? OpenJDK 64-Bit Server VM warning: PrintNMTStatistics is disabled, because native memory tracking is not enabled [CONTAINER] org.apache.coyote.http11.Http11NioProtocol INFO Initializing ProtocolHandler ["http-nio-8080"] [CONTAINER] org.apache.catalina.startup.Catalina INFO Server initialization in [1142] milliseconds [CONTAINER] org.apache.catalina.core.StandardService INFO Starting service [Catalina] [CONTAINER] org.apache.catalina.core.StandardEngine INFO Starting Servlet engine: [Apache Tomcat/9.0.82] [CONTAINER] org.apache.catalina.startup.HostConfig INFO Deploying web application directory [/workspace/ROOT]

` But Error Came up, This means it's Can't Manage Native Memory Tracking, So CNB features will be Void for us. Below is the Error Message

OpenJDK 64-Bit Server VM warning: Native Memory Tracking did not setup properly, using wrong launcher?

Please help me to resolve this issue.

SAURABH110894 commented 8 months ago

@natalieparellano Looking for your support, I have kept error message on above message.

natalieparellano commented 8 months ago

@SAURABH110894 I'm afraid I don't have good insight into this error. Though the error message mentions the launcher, there is no indication what about it could be "wrong". Could you reach out to the Paketo team (slack.paketo.io)?

SAURABH110894 commented 8 months ago

Thank you so much for Guidance !!!!

@natalieparellano