# App agent blocking application startup with activation leak error

**URL:** <https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708>\
**Category:** APM\
**Tags:** java\
**Created:** [May 17, 2024, 11:32am UTC](https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708 "2024-05-17T11:32:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarund](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tarund](https://discuss.elastic.co/u/tarund)\
**Post date:** [May 17, 2024, 11:32am UTC](https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708/1 "2024-05-17T11:32:37Z")

</div>

**Elasticsearch version** : 7.17.1

**APM Server version** : 7.15.0

**APM Agent language and version** : Java / 1.47.1

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: After adding the transaction\_max\_spans=1 property in the elasticapm.properties file, the application throws below error on startup and crashes.  
**Provide logs and/or server output (if relevant)**:

> 2024-05-16 11:11:02,526 [http-nio-8080-exec-1] WARN co.elastic.apm.agent.impl.transaction.Span - Max spans (1) for transaction '' 00-f20cdf84e12b32f0be889aea2cadc9ba-37559b8798182bac-01 (7fa9ca81) has been reached. For this transaction and possibly others, further spans will be dropped. See config param 'transaction\_max\_spans'.  
> 2024-05-16 11:11:02,430 [http-nio-8080-exec-2] ERROR co.elastic.apm.agent.impl.ActiveStack - Activation stack depth reached its maximum - 1. This is likely related to activation leak. Current transaction: '' 00-161a1f97d7527cb39229d18fb82c9dcd-14c3825251226a79-01 (6554993d)  
> java.lang.Throwable: Stack of threshold-crossing activation:  
> at co.elastic.apm.agent.impl.ActiveStack.activate(ActiveStack.java:89) [elastic-apm-agent.jar:1.47.1]  
> at co.elastic.apm.agent.impl.ElasticApmTracer.activate(ElasticApmTracer.java:865) [elastic-apm-agent.jar:1.47.1]  
> at co.elastic.apm.agent.impl.transaction.ElasticContext.activate(ElasticContext.java:63) [elastic-apm-agent.jar:1.47.1]  
> at co.elastic.apm.agent.impl.transaction.ElasticContext.activate(ElasticContext.java:32) [elastic-apm-agent.jar:1.47.1]  
> at co.elastic.apm.agent.redis.RedisSpanUtils.createRedisSpan(RedisSpanUtils.java:40) [elastic-apm-agent.jar:1.47.1]  
> at co.elastic.apm.agent.jedis.SendCommandAdvice.sendCommandEntry(SendCommandAdvice.java:35) [elastic-apm-agent.jar:?]  
> at redis.clients.jedis.Connection.sendCommand(Connection.java:95) [jedis-2.8.1.jar:?]  
> at redis.clients.jedis.BinaryClient.ping(BinaryClient.java:93) [jedis-2.8.1.jar:?]  
> at redis.clients.jedis.BinaryJedis.ping(BinaryJedis.java:105) [jedis-2.8.1.jar:?]

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [May 17, 2024, 12:19pm UTC](https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708/2 "2024-05-17T12:19:07Z")

</div>

> [@tarund](#):
>
> transaction\_max\_spans=1

that value makes no sense. I'd advise not to set it to 1. No low value makes sense

---

<div class="post-metadata">

**Author:** ![tarund](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tarund](https://discuss.elastic.co/u/tarund)\
**Post date:** [May 17, 2024, 1:20pm UTC](https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708/3 "2024-05-17T13:20:19Z")

</div>

actually, it was working with 0 in older version, after we upgraded the version, started facing this issue. We don't want to store the spans, as it consumes lot of storage and not very useful in our case.  
In either case, Why does a lower value block the application startup ?

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [May 21, 2024, 8:47am UTC](https://discuss.elastic.co/t/app-agent-blocking-application-startup-with-activation-leak-error/359708/4 "2024-05-21T08:47:06Z")

</div>

bug issue opened at [Agent crashes when transaction\_max\_spans=1 · Issue #3642 · elastic/apm-agent-java · GitHub](https://github.com/elastic/apm-agent-java/issues/3642)
