# AWS fargate issues

**URL:** <https://community.dynatrace.com/t/aws-fargate-issues/49551>\
**Category:** Container platforms\
**Tags:** aws, ecs, fargate\
**Created:** [January 2, 2025, 2:50pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551 "2025-01-02T14:50:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cath](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Cath](https://community.dynatrace.com/u/Cath)\
**Post date:** [January 2, 2025, 2:50pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/1 "2025-01-02T14:50:22Z")

</div>

Hi,

We have some spring boot application, running in a docker container with AWS fargate.

We used the runtime injection described here [Monitor AWS Fargate — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/amazon-web-services/integrate-into-aws/aws-fargate)

Everything was working fine.

That is, until security showed up, saying we shouldn’t use “root” to start the container.

So add added the user in the dockerfile, made the proper chown / chmod to /opt/dynatrace. The first part goes well, downloading the agent, unzipping… Then, when the app starts, one agent isn’t started. No initialization logs, no error logs. Just nothing. Note that&nbsp;DT\_LOGLEVELCON is set to&nbsp;FINEST

Removing USER my\_user from the docker file fix it, but don’t fix the security issue.

Yet no matter what I do, no monitoring unless I start as root.

At this point I’m thinking the only way out is to switch to build-time injection.

Any clues, what could a possible be missing ?

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 6, 2025, 11:46am UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/2 "2025-01-06T11:46:44Z")

</div>

You have either permission issues with loading oneagent (but you write you did a chown/chmod) or your preloading applies to root user - which is most likely. Try to add ENV LD\_PRELOAD command from the docs for the user - meaning after the USER statement in the Dockerfile.

---

<div class="post-metadata">

**Author:** ![Cath](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Cath](https://community.dynatrace.com/u/Cath)\
**Post date:** [January 8, 2025, 10:18am UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/3 "2025-01-08T10:18:49Z")

</div>

Tanks.

Did try that. But no chance.

Though about some missing capacities, but my tries there where unsuccessful as well.

I went into the container to manually call  
dynatrace-agant.sh java my\_app.jar

as root, you see the one agant logs. As my custom user, you see using DT\_HOME … then the process seams to hang for a little while, and the app starts.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 8, 2025, 10:25am UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/4 "2025-01-08T10:25:17Z")

</div>

Can you share how does your Dockerfile look like? And can you show the runtime configuration of the container? Env variables / command?

Looking for the method how OneAgent gets loaded in your case.

---

<div class="post-metadata">

**Author:** ![Cath](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Cath](https://community.dynatrace.com/u/Cath)\
**Post date:** [January 8, 2025, 1:48pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/5 "2025-01-08T13:48:40Z")

</div>

```auto
RUN mkdir -p /opt/dynatrace/oneagent && chown -R myuser:myuser/opt/dynatrace && chmod -R 777 /opt/dynatrace

USER myuser
VOLUME ["/opt/dynatrace/oneagent"]

ENV DT_DEBUG="true"
ENV DT_LOGLEVELCON="DEBUG"
ENV LD_PRELOAD="/opt/dynatrace/oneagent/agent/lib64/liboneagentloader.so"

ENTRYPOINT ["/bin/sh", "./docker_args.sh"]

```

where docker\_args.sh do java -jar myapp.jar

Originally it was also in the task definition with the same values.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 8, 2025, 2:37pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/6 "2025-01-08T14:37:48Z")

</div>

[@Cath](https://community.dynatrace.com/user/84911)&nbsp;are you using the runtime injection?&nbsp;[Monitor AWS Fargate — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/aws-fargate#runtime)

Based on your Dockerfile I belive you don’t have correct permissions on the OneAgent files in the volume you are mounting.&nbsp; Can you check that if you run a shell in your container?

If you can run a shell for myuser user, just run:

```markup
LD_PRELOAD="/opt/dynatrace/oneagent/agent/lib64/liboneagentloader.so" java -jar myapp.jar

```

It should give an stderr error if library cannot be preloaded.

---

<div class="post-metadata">

**Author:** ![Cath](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Cath](https://community.dynatrace.com/u/Cath)\
**Post date:** [January 8, 2025, 3:24pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/7 "2025-01-08T15:24:51Z")

</div>

Ok. your remark got me to try some stuff with export LD\_PRELOAD= ..

and it seam in some situation,&nbsp;LD\_PRELOAD is just… ignored.

[https://unix.stackexchange.com/questions/757484/ld-preload-does-not-work-and-ld-debug-shows-nothing](https://unix.stackexchange.com/questions/757484/ld-preload-does-not-work-and-ld-debug-shows-nothing)

I did add capabilities.

Don’t fix the trouble yet, but at least it a clue.

---

<div class="post-metadata">

**Author:** ![Cath](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Cath](https://community.dynatrace.com/u/Cath)\
**Post date:** [January 8, 2025, 4:41pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/8 "2025-01-08T16:41:46Z")

</div>

Soo.

I replaced the 777 by +x, removed capacities on the java process.

Our app don’t start, can’t bind port 80. But, dynatrace agent starts. All along we where looking for not enough permission. It was a problem of too many permissions triggering linux security.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 8, 2025, 8:20pm UTC](https://community.dynatrace.com/t/aws-fargate-issues/49551/9 "2025-01-08T20:20:57Z")

</div>

[@Cath](https://community.dynatrace.com/user/84911)&nbsp;yes of course it did not start as it was already started in the container. So your permissions in the volume with OneAgent data must be fixed.
