# \[AWS Lambda java Agent\] Tool agent requires sharing to be disabled

**URL:** <https://discuss.elastic.co/t/aws-lambda-java-agent-tool-agent-requires-sharing-to-be-disabled/295726>\
**Category:** APM\
**Tags:** java\
**Created:** [January 28, 2022, 5:21pm UTC](https://discuss.elastic.co/t/aws-lambda-java-agent-tool-agent-requires-sharing-to-be-disabled/295726 "2022-01-28T17:21:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miltonhit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miltonhit/32/101047_2.png) [@miltonhit](https://discuss.elastic.co/u/miltonhit)\
**Post date:** [January 28, 2022, 5:21pm UTC](https://discuss.elastic.co/t/aws-lambda-java-agent-tool-agent-requires-sharing-to-be-disabled/295726/1 "2022-01-28T17:21:14Z")

</div>

**Kibana version** :  
7.16.3

**Elasticsearch version** :  
7.16.3

**APM Server version** :  
7.16.3

**APM Agent language and version** :  
elastic-apm-java-aws-lambda-layer-1.28.4.zip

> **[Releases · elastic/apm-agent-java](https://github.com/elastic/apm-agent-java/releases)**
>
> Elastic APM Java Agent. Contribute to elastic/apm-agent-java development by creating an account on GitHub.

**Original install method** :

> **[Get started with Lambda (Experimental) | APM Java Agent Reference \[1.x\] |...](https://www.elastic.co/guide/en/apm/agent/java/current/aws-lambda.html#aws-lambda-extension)**

**Steps to reproduce** :

1. Create a AWS Lambda with sample handler and version: java8.al2
2. Instrument this lambda with install method above and put these env vars:

```auto
AWS_LAMBDA_EXEC_WRAPPER: /opt/elastic-apm-handler
ELASTIC_APM_APPLICATION_PACKAGES: ttt,fff
ELASTIC_APM_ENVIRONMENT: tst
ELASTIC_APM_LAMBDA_APM_SERVER: https://XXXXXXXX.apm.us-east-1.aws.cloud.es.io:443
ELASTIC_APM_LOG_LEVEL: TRACE
ELASTIC_APM_SECRET_TOKEN: XXXXXXXXXXXX

```

1. Install elastic-apm-java-aws-lambda-layer-1.28.4.zip as a lambda layer with runtime java8.al2 and x86\_64

2. Configure your lambda to use this layer

3. Execute this lambda from console AWS "Test Button"

**Log/Output Cloudwatch** :

```auto
START RequestId: 8f939239-aa2a-4605-bdc6-0ffc7221811f Version: $LATEST
Picked up JAVA_TOOL_OPTIONS: -javaagent:/opt/elastic-apm-agent-1.28.4.jar
2022-01-28T13:56:07.450-03:00	An error has occurred while processing the shared archive file.
2022-01-28T13:56:07.450-03:00	Tool agent requires sharing to be disabled.
2022-01-28T13:56:07.450-03:00	Error occurred during initialization of VM
2022-01-28T13:56:07.450-03:00	Unable to use shared archive.
END RequestId: 8f939239-aa2a-4605-bdc6-0ffc7221811f

```

---

<div class="post-metadata">

**Author:** ![alexander.wert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander.wert/32/95085_2.png) [@alexander.wert](https://discuss.elastic.co/u/alexander.wert)\
**Post date:** [February 2, 2022, 12:45pm UTC](https://discuss.elastic.co/t/aws-lambda-java-agent-tool-agent-requires-sharing-to-be-disabled/295726/2 "2022-02-02T12:45:46Z")

</div>

Hi @miltonhit ,

thank you for reporting this bug!

We investigated this and started a PR to fix this behavior.  
Please, follow [this PR](https://github.com/elastic/apm-agent-java/pull/2438) for status updates on this issue.

---

<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:** [February 23, 2022, 8:46am UTC](https://discuss.elastic.co/t/aws-lambda-java-agent-tool-agent-requires-sharing-to-be-disabled/295726/3 "2022-02-23T08:46:39Z")

</div>

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