Disk Usage is not available on Portainer Agents: Endpoint Proxy does not forward necessary auth information
Before you start please confirm the following.
- Yes, I've searched similar issues on GitHub.
- Yes, I've checked whether this issue is covered in the Portainer documentation.
Problem Description
Portainer introduced the disk usage feature for portainer agents a few months ago, but I never was able to make it work. The tooltip always just indicates missing JWT information. This happened to me on Linux, Mac and Windows environments.
Expected Behavior
The disk usage should be displayed correctly, since both the portainer app and the agent are the latest 2.45.0 and should support this feature.
Actual Behavior
I am just getting a tooltip with the error information, that JWT data is not found in the request.
Steps to Reproduce
- Prepare a portainer stack including an agent
- setup portainer, and configure the agent as 'Docker Standalone' and then 'Agent' (not 'Edge Agent Standard')
- select the agent environment and go to 'Host' -> 'Details'
- 'Disk Usage' row shows that this information is not available with said tooltip containing the error message
Portainer logs or screenshots
No response
Portainer version
2.45.0
Portainer Edition
Community Edition (CE)
Platform and Version
docker
OS and Architecture
Raspbian OS, but also MacOS 26 and Windows with Docker Desktop in WLS2
Browser
Google Chrome
What command did you use to deploy Portainer?
services:
portainer:
image: portainer/portainer-ce:2.45.0
container_name: portainer
restart: unless-stopped
ports:
- "9000:9000"
- "9443:9443"
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./portainer_data:/data
networks:
- default
agent:
image: portainer/agent:2.45.0
container_name: portainer-agent
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/lib/docker/volumes:/var/lib/docker/volumes
- /:/host:ro
networks:
- defaultAdditional Information
I already investigated the problem and traced down the issue to /api/http/handler/endpointproxy/handler.go. All agent proxy handlers wrap the request in an authenticated request, apart from those to the agents host API, which is used to communicate with the portainer agent. So I did the obvious and wrapped that call in an authenticated request as well, built a docker image with that fix, and it worked correctly for me.
It is basically a single-line fix, that I applied on a fork. If you agree that this is the correct fix, I am happy to prepare the pull request for this. But since this line was added just 4 months ago without the authentication around it, while all other proxies in the same file just above have it, there is maybe a deliberate design choice I don't get there, so I didn't want to make the pull request out of nowhere without this issue discussion.
Source: portainer/portainer