New Relic agent is installed but never attached to the JVM (v5.0.4 and later)
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Domínio
- build-system, cloud
Direção de pesquisa
Start with the New Relic framework code in new_relic.go and the 9.x entries in manifest.yml, which show the bare agent jar with a .zip name. The fix that matters is upstream in buildpacks-ci, where the watcher downloads the wrong artifact, and an open pull request (#714) already exists for this. Done means an integration test that checks newrelic.jar and the license key in the running JVM's arguments, and passes for New Relic 9.x.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
With a newrelic service binding, staging succeeds and the log says the agent is installed, but the running JVM has no New Relic -javaagent and no license key. The only hint is a warning during finalize:
WARNING Failed to finalize framework New Relic Agent: failed to locate newrelic.jar: newrelic.jar not found in /tmp/contents.../deps/0/new_relic_agent
Datadog and SkyWalking bound to the same app are present in the JVM arguments, New Relic is not.
How it was found: while writing an integration test that binds several agents at once (New Relic, Datadog, SkyWalking) and checks the running JVM's arguments instead of only the staging log. This is part of an upcoming improvement of the integration tests, so that every framework is verified in the running JVM. So far 17 of the 23 frameworks that attach an agent (-javaagent or -agentpath) have been checked this way: 16 pass and New Relic is the only one that fails. The other 6 are not checked: AppDynamics, Checkmarx, Introscope and Riverbed are skipped because they need vendor credentials, and Seeker and Java Memory Assistant have no test.
Cause: new_relic.go expects newrelic/newrelic.jar inside the unpacked dependency, as in the vendor distribution newrelic-java-<version>.zip (used up to 8.15.0). The 9.x dependencies in manifest.yml (9.2.0 to 9.5.0, first shipped in v5.0.4) are the bare agent jar with a .zip name. libbuildpack unpacks .zip dependencies, so the jar is exploded and no newrelic.jar remains.
The pipeline produced this: the newrelic watcher in buildpacks-ci downloads newrelic-agent-<version>.jar (cloudfoundry/buildpacks-ci#633), while the binary-builder recipe names the artifact newrelic-java-<version>.zip (cloudfoundry/binary-builder#111). The recipe never opens the file, so the .zip extension comes from its expected file name, not from the content.
Fix: make the watcher download newrelic-java-<version>.zip. The distribution exists for 9.2.0, 9.4.0 and 9.5.0 and contains newrelic/newrelic.jar (the same 41,319,404 bytes as the published bare jar for 9.5.0). I plan to open that PR in buildpacks-ci, plus an integration test here that asserts newrelic.jar and the license key in the running JVM's arguments. The corrected artifact is published when the pipeline next builds a New Relic version; I have not checked whether 9.5.0 can be rebuilt on demand.
Why it went unnoticed: the integration test only asserts New Relic Agent in the staging log, which is printed before the failing step. A failed Finalize is only a warning, while Supply failures are fatal. Making Finalize failures fatal is a separate behaviour change worth discussing.
v4: the Ruby buildpack used a bare jar (download_jar) and added -javaagent directly, so this worked.
- Linguagem predominante
- Go
- Estrelas
- 455
- Forks
- 2.5k
- Merge médio
- 22h 9min
- PRs com merge (30d)
- 69
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cloudfoundry/java-buildpack
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 12/100
cloudfoundry/java-buildpack#1549 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
cloudfoundry/java-buildpack#1521 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 10/100
cloudfoundry/java-buildpack#1469 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated XmxAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
cloudfoundry/java-buildpack#1377 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
cloudfoundry/java-buildpack#1364 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de cloudfoundry/java-buildpack
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/github-mcp-server#3865 ·
Mantenedores costumam responder em até 2 dias
-
kind/features
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
TencentBlueKing/bk-nodemgr#4017 ·
Mantenedores costumam responder em até 1 dia
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyTalvez já em andamento @schdief assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
equinor/radix-operator#2066 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
microsoft/terraform-provider-msgraph#188 · 1 reação ·
Mantenedores costumam responder em até 1 dia