bug: invalid max and used storage when using docker bind mountpoints #16

Closed
opened 2025-10-31 14:59:47 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Lukas-Heiligenbrunner on GitHub (Aug 13, 2024).

When using docker bind mountpoints every mountpoint shows as device and is added multiple times to the total capacity.
Compose file:

version: '3'
services:
  aurcache_dev:
    image: ghcr.io/lukas-heiligenbrunner/aurcache:latest
    ports:
      - "9095:8080"
      - "9096:8081"
    volumes:
      - aurcache_db_dev:/app/db
      - aurcache_repo_dev:/app/repo
      - /var/run/docker.sock:/var/run/docker.sock
      - artifact_cache:/app/builds
    environment:
      - BUILD_ARTIFACT_DIR=artifact_cache # also absolute path is possible
      - LOG_LEVEL=trace
      - MAX_CONCURRENT_BUILDS=2
      - CPU_LIMIT=100
      - MEMORY_LIMIT=-1
    restart: unless-stopped
volumes:
  artifact_cache:
    driver: local
  aurcache_db_dev:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: "/media/3TBRaid/3TBRaid/Docker/aurcache-dev/db"
  aurcache_repo_dev:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: "/media/3TBRaid/3TBRaid/Docker/aurcache-dev/repo"

image

Originally created by @Lukas-Heiligenbrunner on GitHub (Aug 13, 2024). When using docker bind mountpoints every mountpoint shows as device and is added multiple times to the total capacity. Compose file: ``` version: '3' services: aurcache_dev: image: ghcr.io/lukas-heiligenbrunner/aurcache:latest ports: - "9095:8080" - "9096:8081" volumes: - aurcache_db_dev:/app/db - aurcache_repo_dev:/app/repo - /var/run/docker.sock:/var/run/docker.sock - artifact_cache:/app/builds environment: - BUILD_ARTIFACT_DIR=artifact_cache # also absolute path is possible - LOG_LEVEL=trace - MAX_CONCURRENT_BUILDS=2 - CPU_LIMIT=100 - MEMORY_LIMIT=-1 restart: unless-stopped volumes: artifact_cache: driver: local aurcache_db_dev: driver: local driver_opts: type: none o: bind device: "/media/3TBRaid/3TBRaid/Docker/aurcache-dev/db" aurcache_repo_dev: driver: local driver_opts: type: none o: bind device: "/media/3TBRaid/3TBRaid/Docker/aurcache-dev/repo" ``` ![image](https://github.com/user-attachments/assets/b5a6f8f9-980c-43c6-a7cb-48b6c073b0b1)
GiteaMirror added the donebug labels 2025-10-31 14:59:47 -05:00
Author
Owner

@mbecker20 commented on GitHub (Aug 13, 2024):

Hi, thanks for the report.

I am aware of this happening in other cases with docker mounts, in those cases I saw though the file system was able to report as "overlay". And I filter these disks out: https://github.com/mbecker20/monitor/blob/2d0c1724db77f8b1211dd60436f015ee1000be89/bin/periphery/src/stats.rs#L108 Clearly this isn't working here though.

I see two actions to resolve this:

  1. I think it is reasonable to additionally filter out any disks which appear to be docker volumes: eg. starts with /var/lib/docker/volume/*. I don't see a situation where you would want a volume mounted to a path there to show up in the disk usage report.

  2. There may not be a way for Monitor to reliably infer that a disk report is actually a mount and should be ignored, it just depends on User setup. I can add another configuration field to Server, ignore_mounts, which will allow the user to hard filter out any of mounts that are able to get through the guards I put to keep them out.

@mbecker20 commented on GitHub (Aug 13, 2024): Hi, thanks for the report. I am aware of this happening in other cases with docker mounts, in those cases I saw though the file system was able to report as "overlay". And I filter these disks out: [https://github.com/mbecker20/monitor/blob/2d0c1724db77f8b1211dd60436f015ee1000be89/bin/periphery/src/stats.rs#L108](https://github.com/mbecker20/monitor/blob/2d0c1724db77f8b1211dd60436f015ee1000be89/bin/periphery/src/stats.rs#L108) Clearly this isn't working here though. I see two actions to resolve this: 1. I think it is reasonable to additionally filter out any disks which appear to be docker volumes: eg. starts with /var/lib/docker/volume/*. I don't see a situation where you would want a volume mounted to a path there to show up in the disk usage report. 2. There may not be a way for Monitor to reliably infer that a disk report is actually a mount and should be ignored, it just depends on User setup. I can add another configuration field to Server, `ignore_mounts`, which will allow the user to hard filter out any of mounts that are able to get through the guards I put to keep them out.
Author
Owner

@mbecker20 commented on GitHub (Aug 15, 2024):

Hey, should be fixed in this commit: https://github.com/mbecker20/monitor/commit/a2b0981f7632d8ff2ac5419ec2827228500cd6b6.

Additionally, can now avoid any future edge cases here using the new Server config field ignore_mounts:

Screenshot 2024-08-15 at 3 00 21 AM
@mbecker20 commented on GitHub (Aug 15, 2024): Hey, should be fixed in this commit: [https://github.com/mbecker20/monitor/commit/a2b0981f7632d8ff2ac5419ec2827228500cd6b6](https://github.com/mbecker20/monitor/commit/a2b0981f7632d8ff2ac5419ec2827228500cd6b6). Additionally, can now avoid any future edge cases here using the new Server config field `ignore_mounts`: <img width="988" alt="Screenshot 2024-08-15 at 3 00 21 AM" src="https://github.com/user-attachments/assets/7d58dd5c-f680-4f6b-a839-06e4aafec521">
Author
Owner

@mbecker20 commented on GitHub (Aug 15, 2024):

When you get a chance, could you try out ghcr.io/mbecker20/monitor:latest and confirm the issue is fixed?

@mbecker20 commented on GitHub (Aug 15, 2024): When you get a chance, could you try out `ghcr.io/mbecker20/monitor:latest` and confirm the issue is fixed?
Author
Owner

@Lukas-Heiligenbrunner commented on GitHub (Aug 15, 2024):

Looks good now.
Thanks a lot!

@Lukas-Heiligenbrunner commented on GitHub (Aug 15, 2024): Looks good now. Thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#16