# Fix Docker Error: “ld.so: LD\_PRELOAD Cannot Be Preloaded” in Dynatrace

**URL:** <https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326>\
**Category:** Container platforms\
**Tags:** container, oneagent, docker\
**Created:** [June 22, 2023, 8:09am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326 "2023-06-22T08:09:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [June 22, 2023, 8:09am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/1 "2023-06-22T08:09:36Z")

</div>

_Summary:&nbsp;This thread explains how to troubleshoot the Docker error `ld.so: LD_PRELOAD cannot be preloaded` when deploying Dynatrace OneAgent. It covers common causes such as missing libraries and provides configuration fixes for container environments._

I am currently trying to set my Docker image with the Dynatrace OneAgent as per the instructions, but I am getting an ERROR ld.so.

Below is my Dockerfile

**FROM node:20-slim**** # Add our code ****ADD . /**** RUN npm install --production ****COPY --from=xxxxx.live.dynatrace.com/linux/oneagent-codemodules:nodejs / /**** ENV LD\_PRELOAD=/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so ****# Run the app.**** CMD [“npm”, “start”]**

---

<div class="post-metadata">

**Author:** ![Islam\_Zedan](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islam_zedan/32/31999_2.png) [@Islam\_Zedan](https://community.dynatrace.com/u/Islam_Zedan)\
**Post date:** [June 22, 2023, 9:29am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/2 "2023-06-22T09:29:06Z")

</div>

Hello,

You need to make sure that you have the below:

- Your Docker environment must allow your OneAgent container to run in privileged mode.
- The&nbsp;/opt&nbsp;directory must exist on the host where you deploy your OneAgent container.

Please check the below document for further details

> **[Set up Dynatrace OneAgent as a Docker container](https://docs.dynatrace.com/docs/ingest-from/setup-on-container-platforms/docker/set-up-dynatrace-oneagent-as-docker-container)**
>
> Install and update Dynatrace OneAgent as a Docker container.

BR,

Islam

---

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [June 22, 2023, 11:10am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/3 "2023-06-22T11:10:54Z")

</div>

I am running base on this document&nbsp;[https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker/set-up-oneagent-on-containers-for-application-only-monitoring](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker/set-up-oneagent-on-containers-for-application-only-monitoring)

and this is the error I get inside the container

2023-06-22 18:50:32 ERROR: ld.so: object ‘/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.  
2023-06-22 18:50:32 ERROR: ld.so: object ‘/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.  
2023-06-22 18:50:32 ERROR: ld.so: object ‘/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.  
2023-06-22 18:50:33 ERROR: ld.so: object ‘/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.  
2023-06-22 18:50:33 ERROR: ld.so: object ‘/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

---

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [June 22, 2023, 11:52am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/4 "2023-06-22T11:52:14Z")

</div>

Also this is the docker run command I am running

**docker run --privileged -p 3000:3000 -e SENDGRID\_API\_KEY=off -e NODE\_ENV=production -e ELEPHANT\_URL=postgres://topsy.db.elephantsql.com/ppp villan-api**

---

<div class="post-metadata">

**Author:** ![Islam\_Zedan](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islam_zedan/32/31999_2.png) [@Islam\_Zedan](https://community.dynatrace.com/u/Islam_Zedan)\
**Post date:** [June 22, 2023, 3:09pm UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/5 "2023-06-22T15:09:48Z")

</div>

Did you completed the login step without any issue, it should be as below :

docker login [xxxxx.live.dynatrace.com](http://xxxxx.live.dynatrace.com) -u xxxxx

Then you should be asked for the Paas token

---

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [June 23, 2023, 2:38am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/6 "2023-06-23T02:38:48Z")

</div>

I did do the docker log in, and used the Pass token.

and as per the screenshot below the oneAgent file was installed in the container

 ![aledevops1_0-1687487905671.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/7/a7ad27542ab3f39c5045a010f1e1204405648f15.png)

---

<div class="post-metadata">

**Author:** ![Islam\_Zedan](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islam_zedan/32/31999_2.png) [@Islam\_Zedan](https://community.dynatrace.com/u/Islam_Zedan)\
**Post date:** [June 23, 2023, 9:07am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/7 "2023-06-23T09:07:51Z")

</div>

Every thing seems normal for me, I think you need to open a support ticket for that.

---

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [July 7, 2023, 3:10am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/8 "2023-07-07T03:10:58Z")

</div>

Dynatrace support was able to help me with this issue.

As I am running my test in an Apple M2, I had to follow the ARM documentation

```auto
<span>#Set up Dynatrce for ARM</span><br><br><span>ENV</span> <span>DT_API_URL</span><span>=</span><span>https://{environmentid}.live.dynatrace.com/api</span><br><br><span>ENV</span> <span>DT_ONEAGENT_TECHNOLOGY</span><span>=</span><span>nodejs</span><br><br><span>ENV</span> <span>DT_PAAS_TOKEN</span><span>=</span><span>Token from your account</span><br><br><span>RUN</span> <span>mkdir</span> <span>-p</span> <span>/opt/dynatrace/oneagent</span> <span>&&</span> <span>ARCHIVE=</span><span>$</span><span>(mktemp)</span> <span>&&</span> <span>wget</span> <span>-O</span> <span>$ARCHIVE</span> <span>"</span><span>$DT_API_URL</span><span>/v1/deployment/installer/agent/unix/paas/latest?Api-Token=</span><span>$DT_PAAS_TOKEN</span><span>&flavor=default&arch=arm&include=</span><span>$DT_ONEAGENT_TECHNOLOGY</span><span>"</span> <span>&&</span> <span>unzip</span> <span>-o</span> <span>-d</span> <span>/opt/dynatrace/oneagent</span> <span>$ARCHIVE</span> <span>&&</span> <span>rm</span> <span>-f</span> <span>$ARCHIVE</span><br><br><span>ENV</span> <span>LD_PRELOAD</span> <span>/opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so</span>

```

---

<div class="post-metadata">

**Author:** ![aledevops1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aledevops1/32/21864_2.png) [@aledevops1](https://community.dynatrace.com/u/aledevops1)\
**Post date:** [July 7, 2023, 3:11am UTC](https://community.dynatrace.com/t/fix-docker-error-ld-so-ld-preload-cannot-be-preloaded-in-dynatrace/40326/9 "2023-07-07T03:11:59Z")

</div>

For ARM please follow steps in =\> [https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/get-started-with-kubernetes-monitoring/set-up-k8s-monitoring-app-only#tabgroup--versions--arm](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/get-started-with-kubernetes-monitoring/set-up-k8s-monitoring-app-only#tabgroup--versions--arm)
