-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
[Bug]: Docker container charts are missing for Mac docker desktop #603
Comments
Here are two bash scripts which may help figure out the problem. You can run these on the host, it doesn't need to be in a container. First run the curl command to make sure it returns the stats properly. Change curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" "http://localhost/containers/container_name/stats?stream=0&one-shot=1" sequence.sh Save this to #!/bin/bash
for i in {1..20}
do
curl -s --unix-socket /var/run/docker.sock -H "Content-Type: application/json" "http://localhost/containers/container_name/stats?stream=0&one-shot=1"
done parallel.sh Save this to #!/bin/bash
for i in {1..10}
do
curl -s --unix-socket /var/run/docker.sock -H "Content-Type: application/json" "http://localhost/containers/container_name/stats?stream=0&one-shot=1" &
done
wait No rush, and I don't need the entire output. Just let me know what your times are. |
@henrygd Thank you for your prompt response! Very informative. I've tried all three in CLI and they all returned valid stats json. So, I think the socket is set up well and I have permission to read. Please let me know if there's any other thing I can try. I wonder if there's something odd in the Docker Desktop app. |
Another data point: I just set up a Portainer agent on the same machine. I can manage all containers remotely from another server, so I think |
Thanks, I'm not sure what would be causing this. It's likely an issue that's specific to Docker on MacOS. Maybe try removing the Also can you confirm that the curl --unix-socket /var/run/docker.sock "http://localhost/containers/json" If you want to get into the container to test from there, you can get a shell by following the instructions here: https://beszel.dev/guide/docker-shell |
Very interesting. I build the shell in and run inside the container:
It returns all the containers.
also works. I guess it comes back to how Beszel query the socket. IIUC, you're using |
Very strange, this may be related to #513 and specifically a problem with Docker Desktop 4.38.0. I don't use Docker Desktop so I'll try installing on Linux to see if I have the same problem. |
I do notice the query is quite slow (in few seconds). Even running |
I can reproduce the issue and also have a timeout of the docker daemon response.
There is a workaround by changing the user-agent, but hopefully this will fix itself with the next docker desktop update for mac. |
Thanks for confirming @a-mnich! I'll roll back or wait for v4.39. FWIW, although the timeout is unexpected and the root cause is a bad docker version, I'd still suggest bumping |
Thanks for the link to the Docker issue. I'm glad it's not on this end because I was extremely confused. Sounds like they should have a new version out soon, but I'll add the We do have an undocumented env var It's undocumented because if you ever need to think about using it then something is broken. beszel/beszel/internal/agent/docker.go Lines 243 to 252 in 6b41a98
|
Description
I have been running Beszel on my NAS docker and everything works great! Now I tried to add my Mac mini as a new remote system, but Docker container charts are missing (everything else is fine, so SSH is working).
The Mac is running the docker desktop 4.38 app and I have symlinked the docker.sock. I've double checked that
/var/run/docker.sock
is mounted and accessible by the agent.From the DEBUG log, the reason seems to be "Error getting docker stats err="context deadline exceeded (Client.Timeout or context cancellation while reading body)" I've tried running
docker stats
using my local user and I can see stats.How should I debug further? Thanks
Docker version 27.5.1, build 9f9e405
Expected Behavior
Docker container charts show in the dashboard
Steps to Reproduce
Open the dashboard and open the remote system.
OS / Architecture
OS X 15.3, M2
Beszel version
0.9.1
Installation method
Docker
Configuration
Hub Logs
Agent Logs
The text was updated successfully, but these errors were encountered: