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

[build] docker stats receiver test fails #7023

Closed
codeboten opened this issue Jan 4, 2022 · 10 comments
Closed

[build] docker stats receiver test fails #7023

codeboten opened this issue Jan 4, 2022 · 10 comments
Labels
bug Something isn't working ci-cd CI, CD, testing, build issues closed as inactive receiver/dockerstats Stale

Comments

@codeboten
Copy link
Contributor

The following error occurs in TestDefaultReceivers in the collector repo:

=== RUN   TestDefaultReceivers/docker_stats
     receivers_test.go:288: 
        	Error Trace:	receivers_test.go:288
        	            				receivers_test.go:254
        	Error:      	Received unexpected error:
        	            	Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.22/containers/json?filters=%7B%22status%22%3A%5B%22running%22%5D%7D&limit=0": dial unix /var/run/docker.sock: connect: permission denied
        	Test:       	TestDefaultReceivers/docker_stats
@codeboten codeboten added the bug Something isn't working label Jan 4, 2022
@codeboten codeboten changed the title [build] docker stats receiver fails [build] docker stats receiver test fails Jan 4, 2022
@codeboten codeboten added the ci-cd CI, CD, testing, build issues label Jan 4, 2022
@jpkrohling
Copy link
Member

@rmfitzpatrick, as the code owner, could you take a look?

@rmfitzpatrick
Copy link
Contributor

Attempted to address this in open-telemetry/opentelemetry-collector#4643 but potentially hit diminishing returns. Opened #7056.

@prashant-shahi
Copy link
Contributor

@jpkrohling Encountered a similar issue when running the docker_stats receiver in OtelCollector Agent running in a container.

I had to do a couple of things to resolve from my end:

  • chmod 666 /var/run/docker.sock
  • volume bind /var/run/docker.sock from host to container

@jpkrohling
Copy link
Member

chmod 666 /var/run/docker.sock should never be part of the solution, at least not for a production setup. Perhaps you should just add the relevant user to the docker user group?

@prashant-shahi
Copy link
Contributor

@jpkrohling Yes, agreed. I do understand the security implications of it and turned to it as last resort to get docker_stats to work inside of a container.

Perhaps you should just add the relevant user to the docker user group

Just for confirmation, do you mean adding the currently logged-in user to the docker group using usermod?
If yes, I have already done that and it still returned the same permission error.

@prashant-shahi
Copy link
Contributor

OtelCollector is running as user 10001 inside the container. I am unable to add that user from host machine as the user doesn't exist.

Nevertheless, I am now the running the agent as systemd service with docker_stats instead.

sudo usermod -aG docker otelcol-contrib

@jpkrohling Thanks for the suggestion on the latter.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions
Copy link
Contributor

Pinging code owners: @rmfitzpatrick @jamesmoessis. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 24, 2023
animetauren pushed a commit to animetauren/opentelemetry-collector-contrib that referenced this issue Apr 4, 2023
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci-cd CI, CD, testing, build issues closed as inactive receiver/dockerstats Stale
Projects
None yet
Development

No branches or pull requests

4 participants