cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Docker ERROR: ld.so: LD_PRELOAD cannot be preloaded

aledevops1
Visitor

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"]

 

8 REPLIES 8

islam_zidan
Champion

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

https://www.dynatrace.com/support/help/shortlink/oneagent-docker

 

BR,

Islam

Dynatrace Certified Professional - Dynatrace Partner - Yourcompass.ca

I am running base on this document https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker/s...

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

islam_zidan
Champion

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

Dynatrace Certified Professional - Dynatrace Partner - Yourcompass.ca

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

 

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

Dynatrace Certified Professional - Dynatrace Partner - Yourcompass.ca

aledevops1
Visitor

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

#Set up Dynatrce for ARM

ENV DT_API_URL=https://{environmentid}.live.dynatrace.com/api

ENV DT_ONEAGENT_TECHNOLOGY=nodejs

ENV DT_PAAS_TOKEN=Token from your account

RUN mkdir -p /opt/dynatrace/oneagent && ARCHIVE=$(mktemp) && wget -O $ARCHIVE "$DT_API_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT_PAAS_TOKEN&flavor=default&arch=arm&include=$DT_ONEAGENT_TECHNOLOGY" && unzip -o -d /opt/dynatrace/oneagent $ARCHIVE && rm -f $ARCHIVE

ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
 

 

Featured Posts