New Relic agent not updating when Java Buildpack is upgraded in VMware TAS for VMs
search cancel

New Relic agent not updating when Java Buildpack is upgraded in VMware TAS for VMs

book

Article ID: 297489

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

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 is referencing the correct new relic agent version:
"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 is referencing the older new relic agent version:
"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.


Resolution

There are two options to fix this issue:

  1. cf curl /v2/apps/$(cf app <APP-NAME> --guid) -X PUT -d '{"command": ""}'
  2. cf push -c null
    
In either case, this will reset the manually specified command on the server to the default command.

Note: Please make sure you save a copy of the custom start command in case it is required.