Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer during getting docker id from fargate metadata when start up #2247

Open
ravenadesk opened this issue Feb 27, 2025 · 1 comment
Labels
bug Something isn't working as designed/intended

Comments

@ravenadesk
Copy link

ravenadesk commented Feb 27, 2025

Description

We are using the java agent 8.14.0 in our application. We observed that the start up of the application takes 2 minutes longer than before.

As a comparison, we tested 8.12.0, 8.13.0 and the newest 8.18.0, and found that starting from 8.13.0, the DockerData.java was modified and start to use the java.net.URL class to retrieve the docker id.

Although the log detail is hidden since 8.17.0, I still located it according to 8.13.0's log that when attempting retrieve the docker id, exception occurs at InstrumentationImpl::noticeTracer. The call of URL.openStream and the underlying call of HttpURLConnection.getInputStream cannot complete.

We also observed that the agent attempted twice to obtain the docker id by different uri, and each costed around 1 minute.

Expected Behavior

The exception happend during tracing should not interfere with the woven class's(java.net.HttpURLConnection) behavior.

Troubleshooting or NR Diag results

newrelic_agent.log(8.13.0)

java.lang.NullPointerException: Cannot invoke "com.newrelic.agent.profile.ProfilerService.getTransactionProfileService()" because the return value of "com.newrelic.agent.service.ServiceFactory.getProfilerService()" is null
        at com.newrelic.agent.instrumentation.InstrumentationImpl.noticeTracer(InstrumentationImpl.java:381) [newrelic.jar:8.13.0]

newrelic_agent.log(8.18.0)

XXXX-XX-XXT21:31:57 ... INFO: Attempting to fetch ECS Fargate container id from URL (V4): http://xxxxx
...
XXXX-XX-XXT21:32:58 ... FINEST: Exception in noticeTracer. This may affect thread profile v2. Tracer:null. Error message: Cannot invoke "com.newrelic.agent.profile.ProfilerService.getTransactionProfileService()" because the return value of "com.newrelic.agent.service.ServiceFactory.getProfilerService()" is null
XXXX-XX-XXT21:32:58 ... WARN: Error opening input stream retrieving AWS Fargate metadata
XXXX-XX-XXT21:32:58 ... INFO: Attempting to fetch ECS Fargate container id from URL (unversioned): http://xxxxx
...
XXXX-XX-XXT21:33:58 ... FINEST: Exception in noticeTracer. This may affect thread profile v2. Tracer:null. Error message: Cannot invoke "com.newrelic.agent.profile.ProfilerService.getTransactionProfileService()" because the return value of "com.newrelic.agent.service.ServiceFactory.getProfilerService()" is null
XXXX-XX-XXT21:33:58 ... WARN: Error opening input stream retrieving AWS Fargate metadata

Steps to Reproduce

It is not easy to share, but I will provide the detailed environment description.

Your Environment

New Relic Java Agent 8.13.0/8.18.0
AWS ECS (ECS_CONTAINER_METADATA_URI_V4 avaliable)
Docker image from amazoncorretto:21.0.2-alpine3.19
springboot(3.3.0) application
I tried to connet to the ECS task right after it starts up, and found that the accessibility to metadata uri is no problem.

Additional context

@ravenadesk ravenadesk added the bug Something isn't working as designed/intended label Feb 27, 2025
@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as designed/intended
Projects
Development

No branches or pull requests

1 participant