# NPE using APM Agent 1.33.0

**URL:** <https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702>\
**Category:** APM\
**Tags:** docker, java\
**Created:** [August 23, 2022, 12:32pm UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702 "2022-08-23T12:32:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Stolwijk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_stolwijk/32/109983_2.png) [@Nick\_Stolwijk](https://discuss.elastic.co/u/Nick_Stolwijk)\
**Post date:** [August 23, 2022, 12:32pm UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/1 "2022-08-23T12:32:48Z")

</div>

We are getting NPE's with the Elastic APM Agent 1.33.0.

**APM Agent language and version** :

```auto
elastic-apm-agent-1.33.0.jar: OK
INFO: Downloaded: elastic-apm-agent-1.33.0.jar
INFO: Mount /init-seed found. APM copied to: /init-seed/elastic-apm-agent.jar

```

**Provide logs and/or server output (if relevant)**:

```auto
java.lang.NullPointerException
        at co.elastic.apm.agent.impl.transaction.Span.afterEnd(Span.java:294)
        at co.elastic.apm.agent.impl.transaction.AbstractSpan.end(AbstractSpan.java:563)
        at co.elastic.apm.agent.impl.transaction.AbstractSpan.end(AbstractSpan.java:542)
        at co.elastic.apm.agent.jdbc.StatementInstrumentation$ExecuteWithQueryInstrumentation$AdviceClass.onAfterExecute(StatementInstrumentation.java:113)
        at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
        at nl.customcode.ExecuteProvider.execute

```

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [August 24, 2022, 8:13am UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/2 "2022-08-24T08:13:19Z")

</div>

Thanks for reporting that @Nick_Stolwijk and welcome to our forum.

Can you tell us at which frequency does this happens ? is that happening once, randomly or on every call the the database ?

I am currently investigating why this might happen, I'll keep you updated about my findings.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [August 24, 2022, 2:49pm UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/3 "2022-08-24T14:49:20Z")

</div>

We found a potential cause of this issue and opened [#2755](https://github.com/elastic/apm-agent-java/pull/2755) to fix it.

As it seems to be quite rare and tricky to reproduce, would you mind testing [this snapshot](https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/PR-2755/3/artifact/src/github.com/elastic/apm-agent-java/elastic-apm-agent/target/elastic-apm-agent-1.33.1-SNAPSHOT.jar) and tell us if the issue is fixed or not in your application ? If that's the case, then it means the fix could be shipped in the next agent release.

---

<div class="post-metadata">

**Author:** ![Nick\_Stolwijk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_stolwijk/32/109983_2.png) [@Nick\_Stolwijk](https://discuss.elastic.co/u/Nick_Stolwijk)\
**Post date:** [August 25, 2022, 7:38am UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/4 "2022-08-25T07:38:17Z")

</div>

I saw it once, but in multiple K8S pods. After a restart it was gone again. I tried the snapshot and it works as expected. I don't think I can be any help in reproducing it unfortunately.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [August 26, 2022, 9:01am UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/5 "2022-08-26T09:01:37Z")

</div>

Thanks for testing the snapshot, it was definitely a rare bug that might be quite hard to reproduce. We have merged the PR in the mean time, so it will be included in the next release and should already be in the daily snapshot too.

Don't hesitate to ping us if you see this happening again either with the snapshot or the next release.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 16, 2022, 5:02am UTC](https://discuss.elastic.co/t/npe-using-apm-agent-1-33-0/312702/6 "2022-09-16T05:02:02Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
