# Deployment of OneAgent fails inside Docker

**URL:** <https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342>\
**Category:** Open Q&A\
**Tags:** installation, oneagent, docker\
**Created:** [April 18, 2023, 11:48am UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342 "2023-04-18T11:48:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tb01](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@tb01](https://community.dynatrace.com/u/tb01)\
**Post date:** [April 18, 2023, 11:48am UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342/1 "2023-04-18T11:48:07Z")

</div>

Hello.

Having created the deloyment ‘package’ through the “deploy dynatrace” steps on our portal, I proceed to select ‘Kubernetes’, fill out the necessary details an dtokens, download the dynakube.yaml file, verified its content, then running the 4 script steps that use kubectl.

This results in getting 5 pods in the dynatrace namespace, with 4 of them running ok (webhook, operator, activegate) with the 5th (oneagent) running an endless crash-restart.

Checking the log files the first error we saw was related to missing “/OPT” which was easily remedied.

The next error is printed out as

“XZ compressed archive is corrupted or memory allocation failed. Installation aborted.”

checking the oneagent install log, I see that the line above this error prints out

/opt/dynatrace/oneagent/Dynatrace-OneAgent-Linux.sh: line 3023: /opt/dynatrace/oneagent/xzdec: not found

when inspecting the installation script&nbsp;Dynatrace-OneAgent-Linux.sh I see it contains the instalation files as base64, and after having extracted the .tar file, I see that this contains the xzdec file in question so I am guessing it is the extraction that fails?

--

2023-04-18 08:31:01 UTC [INFO] Unpacking. This may take a while…  
2023-04-18 08:31:01 UTC [INFO] /opt/dynatrace/oneagent/agent\_install\_75237 does not exist, skipping removal  
2023-04-18 08:31:01 UTC [INFO] Creating temporary unpack folder /opt/dynatrace/oneagent/agent\_install\_75237  
2023-04-18 08:31:01 UTC [INFO] Creating directory /opt/dynatrace/oneagent/agent\_install\_75237 with rights 755  
2023-04-18 08:31:01 UTC [INFO] Unpacking without cache  
2023-04-18 08:31:01 UTC [INFO] Determining begin of tar archive…  
2023-04-18 08:31:01 UTC [INFO] tarBegin=4947 tarEnd=3501054  
2023-04-18 08:31:01 UTC [INFO] tarLength=3496107  
/opt/dynatrace/oneagent/Dynatrace-OneAgent-Linux.sh: line 3023: /opt/dynatrace/oneagent/xzdec: not found  
tar: short read  
2023-04-18 08:31:03 UTC [ERROR] XZ compressed archive is corrupted or memory allocation failed. Installation aborted.

--

Looking into the container as the installation is ongoing I see there is a targile\_xxxxx.base64 file, but this is only 5.1M which is far from the size of the original which should be around 217M

From what I read, tar short read is regarding a corrupted tar file, but since this is reading from the large text file is this why getting the out of memory error then the tar error pointing to a corrupt file is because it didn’t extract the whole installation tarball?

Is there a Dynatrace docker install where the script and the .tar file are separate entities?

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [April 18, 2023, 12:10pm UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342/2 "2023-04-18T12:10:28Z")

</div>

Hi&nbsp;[@tb01](https://community.dynatrace.com/user/61951),

For Kubernetes-based environments, I recommend using Dynatrace Operator. You can find full instructions in the link below.

> **[Deployment](https://docs.dynatrace.com/docs/ingest-from/setup-on-k8s/deployment)**
>
> Deploy Dynatrace Operator on Kubernetes

or

> **[GitHub - Dynatrace/dynatrace-operator: Automate Kubernetes observability with Dynatrace](https://github.com/Dynatrace/dynatrace-operator)**
>
> Automate Kubernetes observability with Dynatrace

You can also try to install OA directly on Docker based on this instruction.

> **[Set up OneAgent on containers for application-only monitoring](https://docs.dynatrace.com/docs/ingest-from/setup-on-container-platforms/docker/set-up-oneagent-on-containers-for-application-only-monitoring)**
>
> Install, update, and uninstall OneAgent on containers for application-only monitoring.

Here’s how to change OA installation paths in case you don’t have a standard file system on your system:

> **[Customize OneAgent installation on Linux](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/installation-and-operation/linux/installation/customize-oneagent-installation-on-linux)**
>
> Learn how to use the Linux installer with command line parameters.

Radek

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [April 18, 2023, 12:14pm UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342/3 "2023-04-18T12:14:49Z")

</div>

Please see [@Julius\_Loman](https://community.dynatrace.com/user/3364)’s answer in another topic, as you may have a situation where your setup is not supported.

[https://community.dynatrace.com/t5/Container-platforms/Docker-for-Mac-OneAgent-fails-with-quot-Archive-is-corrupted/m-p/30662](https://community.dynatrace.com/post/30662)

---

<div class="post-metadata">

**Author:** ![tb01](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@tb01](https://community.dynatrace.com/u/tb01)\
**Post date:** [April 18, 2023, 12:43pm UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342/4 "2023-04-18T12:43:31Z")

</div>

Thanks for reply.

Yea, I was kinda hoping that there had been some updates since 2017 to this situation.

From the scenario portrayed there and what I see I got a sense that this situation was different, as it talks about missing GNU coreutils. It is using Base64 and being told a parameter is incorrect. In my case, Base64 does not report an error, but the outfile has the incorrect size and doesn’t extract.

I assumed if you get docker running and install the docker oneagent, it would work in docker.

Anyway, I haven’t given up.

---

<div class="post-metadata">

**Author:** ![tb01](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@tb01](https://community.dynatrace.com/u/tb01)\
**Post date:** [April 18, 2023, 1:02pm UTC](https://community.dynatrace.com/t/deployment-of-oneagent-fails-inside-docker/39342/5 "2023-04-18T13:02:03Z")

</div>

I see your other answer now. Thanks, i’ll check it out.
