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

fix(system): reduce log verbosity for Docker connection error [EE-5372] #11944

Closed
wants to merge 1 commit into from

Conversation

hhromic
Copy link
Contributor

@hhromic hhromic commented Jun 13, 2024

This simple PR fixes the long standing bug described in #8806.

A Docker socket is not always directly available to the Portainer process. This is common and normal when using remote Portainer agents, and causes excessive, useless and confusing logging messages in Portainer.

This PR changes the logging level for those normal/expected error messages to Debug.
This is aligned with other Debug-level error messages present in Portainer. For example:

2024/06/13 09:37PM DBG github.com/portainer/portainer/api/http/security/bouncer.go:286 > HTTP error | error=Unauthorized msg="Invalid JWT token" status_code=401
2024/06/13 09:37PM DBG github.com/portainer/portainer/api/http/middlewares/slow_request_logger.go:33 > slow request | elapsed_ms=138.166153 method=POST url=/api/auth
2024/06/13 09:37PM DBG github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
2024/06/13 09:37PM DBG github.com/portainer/portainer/api/http/security/bouncer.go:255 > HTTP error | error="unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined" msg="Unable to initiate communications with environment" status_code=500
2024/06/13 09:37PM DBG github.com/portainer/portainer/api/http/security/bouncer.go:255 > HTTP error | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" msg="Unable to initiate communications with environment" status_code=500
2024/06/13 09:38PM DBG github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

Closes #8806
Closes EE-5372 (taken from the linked issue)

A Docker socket is not always directly available to the Portainer process.
This is common and normal when using remote Portainer agents, and was causing
excessive, useless and confusing logging messages in Portainer.

Instead, log those normal/expected error messages using the debug level.
@hhromic hhromic changed the title fix(system): reduce log verbosity for Docker connection error fix(system): reduce log verbosity for Docker connection error [EE-5372] Jun 13, 2024
@hhromic
Copy link
Contributor Author

hhromic commented Jun 14, 2024

I just saw and tested PR #11728 which also addresses the excessive logging problem fixed here.
If that PR is merged, then this PR here is no longer necessary 👍.

Hope either that or this PR is merged before the next release version, as this issue is preventing us from upgrading.

@chiptus
Copy link
Contributor

chiptus commented Jun 16, 2024

hey @hhromic

thanks for making this PR. we have a general solution that will fix this error ever being printed that hopefully will be merged soon

@chiptus chiptus closed this Jun 16, 2024
@hhromic hhromic deleted the fix-8806 branch June 16, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning Messages in Portainer Logs Caused by docker.sock not Available in Docker Swarm Setting
2 participants