Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"tar" executable not found in Elasticsearch 7.15.0-SNAPSHOT Docker image #76695

Closed
jmlrt opened this issue Aug 19, 2021 · 4 comments
Closed

"tar" executable not found in Elasticsearch 7.15.0-SNAPSHOT Docker image #76695

jmlrt opened this issue Aug 19, 2021 · 4 comments
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team

Comments

@jmlrt
Copy link
Member

jmlrt commented Aug 19, 2021

Elasticsearch version (bin/elasticsearch --version): 7.15.0-SNAPSHOT, Build: default/docker/bc278d661f0b0d72ce292aa636fbb1db96427c40/2021-08-17T13:27:20.599610018Z, JVM: 16.0.2

OS version (uname -a if on a Unix-like system): Linux 658e2dc4afe5 4.4.0-185-generic #215-Ubuntu SMP Mon Jun 8 21:53:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior: tar command is not found in the Docker image

Steps to reproduce:

~ docker run -it docker.elastic.co/elasticsearch/elasticsearch:7.15.0-SNAPSHOT bash
bash-4.4# tar
bash: tar: command not found

Can also be reproduced while trying to do a kubectl cp into an Elasticsearch pod (kubectl cp command require tar binary in the container):

~ kubectl get pod elasticsearch-master-0                                        
NAME                     READY   STATUS    RESTARTS   AGE
elasticsearch-master-0   1/1     Running   0          24m~ kubectl get pod elasticsearch-master-0 -o json | jq '.spec.containers[].image'
"docker.elastic.co/elasticsearch/elasticsearch:7.15.0-SNAPSHOT"~ touch foo                                                                     ~ kubectl cp foo elasticsearch-master-0:/tmp/foo                 
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"tar\": executable file not found in $PATH": unknown
command terminated with exit code 126

Note that tar command is present in the other images, examples:

~ docker run -it docker.elastic.co/elasticsearch/elasticsearch:7.14.0 tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.~ docker run -it docker.elastic.co/elasticsearch/elasticsearch:7.14.1-SNAPSHOT tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.~ docker run -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

cc @elastic/es-delivery

@jmlrt jmlrt added >bug needs:triage Requires assignment of a team area label labels Aug 19, 2021
@pugnascotia
Copy link
Contributor

@jmlrt what are you doing with the image that requires tar?

@jmlrt
Copy link
Member Author

jmlrt commented Aug 19, 2021

@jmlrt what are you doing with the image that requires tar?

Our Helm charts tests required that we copy a file in the container using kubectl cp.
It seems that kubectl cp command is using internally the tar binary which should be present in the container (see kubernetes/kubernetes#58512 feature request to stop depending of tar for kubectl cp).

@pugnascotia
Copy link
Contributor

...wow. OK, I'll add that in.

pugnascotia added a commit to pugnascotia/elasticsearch that referenced this issue Aug 19, 2021
Closes elastic#76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in elastic#75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
@pgomulka pgomulka added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts and removed needs:triage Requires assignment of a team area label labels Aug 19, 2021
@elasticmachine elasticmachine added the Team:Delivery Meta label for Delivery team label Aug 19, 2021
pugnascotia added a commit that referenced this issue Aug 19, 2021
Closes #76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in #75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
pugnascotia added a commit that referenced this issue Aug 19, 2021
Closes #76695.

Due to a Kubernetes quirk, we need to ensure that the `tar` CLI tool is
present in the Docker image. It was removed in #75079 because we
reworked how the image was built, and anything not explicitly installed
was left out.
@mark-vieira
Copy link
Contributor

This was closed by #76696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests

5 participants