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

make docker-offsets fails with "error obtaining VCS status: exit status 128" #814

Open
damemi opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@damemi
Copy link
Contributor

damemi commented May 3, 2024

Describe the bug

Running make docker-offsets to generate offsets in a container fails with the following:

$ make docker-offsets
docker run --rm -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock -v /home/mikedame/opentelemetry-go-instrumentation:/app golang:1.22 /bin/sh -c "cd ../app && make offsets"
Unable to find image 'golang:1.22' locally
1.22: Pulling from library/golang
1468e7ff95fc: Pull complete 
2cf9c2b42f41: Pull complete 
c4c40c3e3cdf: Pull complete 
18445a9ea386: Pull complete 
869f438912de: Pull complete 
35955cffce03: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:d5302d40dc5fbbf38ec472d1848a9d2391a13f93293a6a5b0b87c99dc0eaa6ae
Status: Downloaded newer image for golang:1.22
cd ./internal/tools && \
go build -o /app/.tools/offsetgen go.opentelemetry.io/auto/./internal/tools/inspect/cmd/offsetgen
go: downloading github.com/go-logr/logr v1.4.1
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading github.com/docker/docker v26.1.0+incompatible
go: downloading golang.org/x/sync v0.7.0
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/docker/go-units v0.5.0
go: downloading github.com/moby/docker-image-spec v1.3.1
go: downloading github.com/distribution/reference v0.5.0
go: downloading github.com/opencontainers/go-digest v1.0.0
go: downloading github.com/opencontainers/image-spec v1.0.2
go: downloading github.com/pkg/errors v0.9.1
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0
go: downloading go.opentelemetry.io/otel/trace v1.26.0
go: downloading go.opentelemetry.io/otel v1.26.0
go: downloading golang.org/x/net v0.24.0
go: downloading github.com/felixge/httpsnoop v1.0.4
go: downloading go.opentelemetry.io/otel/metric v1.26.0
go: downloading github.com/gogo/protobuf v1.3.2
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
make: *** [Makefile:28: /app/.tools/offsetgen] Error 1
make: *** [Makefile:114: docker-offsets] Error 2

Environment

  • OS: Linux
  • Go Version: 1.22 (golang:1.22 image)
  • Version: main

To Reproduce

Steps to reproduce the behavior:

  1. Run make docker-offsets

Expected behavior

Offsets file is generated

Additional context

Running make offsets (not in a container) does not have this issue.

Adding -buildvcs=false to the build command (as done in #790 - https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/790/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R29) seems to fix it, but I would like to debug why this started and decide if that's actually the right solution or a bandaid

@damemi damemi added the bug Something isn't working label May 3, 2024
@damemi
Copy link
Contributor Author

damemi commented May 3, 2024

This seems to be due to the fact that my local user owns my .git dir, but when running in a container as root that user doesn't have permission.

I found this by running the container directly:

$ docker run -it --rm -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/app golang:1.22 /bin/sh
# cd /app
# git status
fatal: detected dubious ownership in repository at '/app'
To add an exception for this directory, call:

	git config --global --add safe.directory /app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant