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

exec: no such file or directory on v0.116.0 images #783

Closed
damemi opened this issue Dec 17, 2024 · 10 comments
Closed

exec: no such file or directory on v0.116.0 images #783

damemi opened this issue Dec 17, 2024 · 10 comments
Labels

Comments

@damemi
Copy link
Contributor

damemi commented Dec 17, 2024

Hi, running the latest images for the collector and contrib gives the following errors:

collector:

$ docker run --rm otel/opentelemetry-collector:latest
Unable to find image 'otel/opentelemetry-collector:latest' locally
latest: Pulling from otel/opentelemetry-collector
8f7858a9e10a: Download complete 
25b3dbd41aa1: Download complete 
1ab3cc28ef42: Download complete 
Digest: sha256:91d0e8dcd0cf4c0f2b1002a3be5979dfb20be235af96ef51063164548e2ccff6
Status: Downloaded newer image for otel/opentelemetry-collector:latest
exec /otelcol: no such file or directory

contrib:

$ docker run --rm otel/opentelemetry-collector-contrib:latest
Unable to find image 'otel/opentelemetry-collector-contrib:latest' locally
latest: Pulling from otel/opentelemetry-collector-contrib
786f0d5741dd: Download complete 
1ae9138cffe0: Download complete 
93f09e4df467: Download complete 
Digest: sha256:70217a89d27c678ead44f196d80aa8c2717cb68d0301dbdc40331dbec0a3e605
Status: Downloaded newer image for otel/opentelemetry-collector-contrib:latest
exec /otelcol-contrib: no such file or directory
Copy link

dosubot bot commented Dec 17, 2024

Hello, @damemi! I'm here to help you with bugs, answer questions, and assist you in becoming a contributor. Let's work together to resolve the issue you're facing while waiting for a human maintainer.

The error message exec: no such file or directory suggests that the expected entrypoint files (/otelcol for the collector and /otelcol-contrib for the contrib) are missing or not executable in the Docker images.

For the contrib image, the expected entrypoint is "/otelcol-contrib" [1]. This indicates that the issue might be related to the image build or the file permissions.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Verify Image Integrity: Ensure that the images are correctly pulled and not corrupted. You can try removing the images and pulling them again:

    docker rmi otel/opentelemetry-collector:latest
    docker rmi otel/opentelemetry-collector-contrib:latest
    docker pull otel/opentelemetry-collector:latest
    docker pull otel/opentelemetry-collector-contrib:latest
  2. Check Entrypoint and CMD: Verify that the entrypoint and command in the Dockerfile are correctly set. You can inspect the image to check the entrypoint:

    docker inspect --format='{{.Config.Entrypoint}}' otel/opentelemetry-collector:latest
    docker inspect --format='{{.Config.Entrypoint}}' otel/opentelemetry-collector-contrib:latest
  3. Run with Shell: Try running the container with a shell to manually check the presence and permissions of the entrypoint file:

    docker run -it --entrypoint /bin/sh otel/opentelemetry-collector:latest
    docker run -it --entrypoint /bin/sh otel/opentelemetry-collector-contrib:latest
  4. Check for Known Issues: Look for any known issues or updates related to the v0.116.0 release that might address this problem.

If these steps do not resolve the issue, it might be necessary to check for any updates or patches from the maintainers of the OpenTelemetry Collector images.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added artifact:docker bug Something isn't working labels Dec 17, 2024
@TylerHelmuth
Copy link
Member

@jackgopack4 could #726 be the culprit?

@MrAlias
Copy link

MrAlias commented Dec 17, 2024

Just for reference, this seems to be affecting GitHub actions uses this container as well: https://github.com/open-telemetry/opentelemetry-go-instrumentation/actions/runs/12377825359/job/34549117158?pr=1431

@TylerHelmuth
Copy link
Member

I think it must be. If I do docker pull johnpeterson785/opentelemetry-collector-contrib:latest (one of the test images from your fork) I get the same error

@jackgopack4
Copy link
Contributor

This combined with the refactor ticket means we should probably go back to the drawing board on the PIE mode build. Apologies as I am out of office for the next week or two.

@jangaraj
Copy link

jangaraj commented Dec 17, 2024

For some reason binary is linked dynamically (and of course those libraries are not included in the image, so exec is not able to execute it):

$ echo 'from otel/opentelemetry-collector-contrib:0.116.0' | docker build --output type=tar,dest=test-docker.tar -
$ mkdir extracted
$ tar xf test-docker.tar -C extracted
$ file extracted otelcol-contrib
otelcol-contrib: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=TTn6apZLcG8urBvh5wlg/syfHGI8yjym98BvlT06c/fiHPdif5aRWfep2K1XGj/vhe5_bPdnxo1cGSTIpWA, stripped

For the record binary extracted from 0.115.1:

$ file extracted otelcol-contrib
otelcol-contrib: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=gH_CHYN923xi796vlLHk/RbV58RO4_ec-IQaNysi5/_6o9hxDC57Xwcyw3036y/dhb4CKhp-bZIqwiFURI4, stripped

Quick dirty hack - just mount missing library (it depends on used architecture), e.g.

docker run --rm -ti \
  -v /lib64/ld-linux-x86-64.so.2:/lib64/ld-linux-x86-64.so.2 \
   otel/opentelemetry-collector-contrib:0.116.0 

And then you have everything in the container, so exec will be able to execute it.

I'm not sure about golang build options, but I guess pie can be also linked statically: https://stackoverflow.com/questions/64019336/go-compile-to-static-binary-with-pie

@CodeBlanch
Copy link
Member

We ran into this as well over on OpenTelemetry .NET. Our OtlpExporter integration tests (which use otel/opentelemetry-collector) are blowing up: https://github.com/open-telemetry/opentelemetry-dotnet/actions/runs/12379183379/job/34553658657?pr=6032#step:3:239

@jackgopack4
Copy link
Contributor

jackgopack4 commented Dec 17, 2024

It was supposed to be internal linking but I guess I didn't configure it properly?

@songy23
Copy link
Member

songy23 commented Dec 17, 2024

New images 0.116.1 have been pushed, I tested with docker run --rm otel/opentelemetry-collector:0.116.1 it's working fine.

@alorenzo175
Copy link

alorenzo175 commented Dec 19, 2024

The otel/opentelemetry-collector-builder:0.116.0 image has the same issue (exec /usr/local/bin/ocb: no such file or directory), and I don't see any 0.116.1 tag. Maybe it was missed in the update to 0.116.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants