Summary: 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 codeADD . /RUN npm install --productionCOPY --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”]
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 /opt directory must exist on the host where you deploy your OneAgent container.
Please check the below document for further details
BR,
Islam
I am running base on this document 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.
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
Did you completed the login step without any issue, it should be as below :
docker login xxxxx.live.dynatrace.com -u xxxxx
Then you should be asked for the Paas token
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
Every thing seems normal for me, I think you need to open a support ticket for that.
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
<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>