After upgrading the Java Buildpack version, some of the java apps failed to restart, restage.
In the application log, you could see something similar to the following:
ERR Error opening zip file or JAR manifest missing : /home/vcap/app/.java-buildpack/new_relic_agent/new_relic_agent-5.12.1.jar
When running cf curl /v2/apps/$(cf app <APP-NAME> -guid)/summary, you could fine the following:
"detected_start_command": "JAVA_OPTS=\"-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext -javaagent:$PWD/.java-buildpack/new_relic_agent/new_relic_agent-5.13.0.jar -Dnewrelic.home=$PWD/.java-buildpack/new_relic_agent "
"command": "JAVA_OPTS=\"-agentpath:$PWD/.java-buildpack/open_jdk_jre/bin/jvmkill-1.16.0_RELEASE=printHeapHistogram=1 -Djava.io.tmpdir=$TMPDIR -XX:ActiveProcessorCount=$(nproc) -Djava.ext.dirs=$PWD/.java-buildpack/container_security_provider:$PWD/.java-buildpack/open_jdk_jre/lib/ext -javaagent:$PWD/.java-buildpack/new_relic_agent/new_relic_agent-5.12.1.jar -Dnewrelic.home=$PWD/.java-buildpack/new_relic_agent "
This happens when a user manually specifies a command for the application. A manually specified command will override the detected_start_command, causing it to look for an older New Relic agent version.
VMware Tanzu Support does not recommend manually setting a start command when using the Java Buildpack. The generated commands are complex and subject to change between versions of the Java Buildpack. This can result in application failures after upgrading the Java Buildpack.
There are two options to fix this issue:
cf push -c null