amerkurev / doku

💽 Doku - Docker disk usage dashboard
https://docker-disk.space
MIT License
313 stars 12 forks source link

Some error messages with logs and bind mounts #3

Open cybermcm opened 2 years ago

cybermcm commented 2 years ago

Just found your project via https://noted.lol/doku-docker-disk-usage-dashboard/ great work!

Tried it in my home lab, get some error messages: 1) bind mounts seems to work, everything is shown but still message No access to some mounted files or directories Doku doesn't have access to some mounted files or directories and can't calculate the size of these files. appears 2) logs message: No access to the log files Although log files of the containers are present, the top-level directory (/) on the host machine has not been mounted into the Doku container. Therefore Doku doesn't have access to log files and can't calculate the size of these files. nothing is shown there

my system: Linux xxx 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux Docker version 20.10.17

compose:

doku:
  container_name: doku
  image: amerkurev/doku
  environment:
    - BASIC_HTPASSWD=/opt/docker/doku/htpasswd
  labels:
   - ${WATCHTOWER_TRUE}
   - traefik.enable=true
   - "traefik.http.routers.doku.rule=Host(`doku.${HOSTNAME}`)"
   - traefik.http.routers.doku.entrypoints=web-secure
   - traefik.http.routers.doku.tls.certresolver=le
   - traefik.http.routers.doku.tls=true
   - traefik.http.routers.doku.priority=2
   - traefik.http.routers.doku.tls.options=default
   - traefik.http.routers.doku.middlewares=doku
   - traefik.http.middlewares.doku.headers.customresponseheaders.X-Robots-Tag=noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex
   - traefik.http.services.doku.loadbalancer.server.port=9090
  networks:
   - web
  restart: always
  volumes:
   - ${TIMEZONE}
   - ${LOCALTIME}
   - /var/run/docker.sock:/var/run/docker.sock:ro
   - /:/hostroot:ro
   - ${DOCKER_PATH}/doku/htpasswd:/opt/docker/doku/htpasswd

happy to share more info if necessary

BadCo-NZ commented 2 years ago

For 1. Do you have any network shares mounted directly in containers? I have that same error and assumed this was why.

cybermcm commented 2 years ago

@BadCo-NZ: no network shares mounted in my case

amerkurev commented 2 years ago

Stranger things... Okay, I'll see to it.

davidalben commented 2 years ago

Same no.1 message here. In log:

level=error msg="failed to get mounted file or directory" err="readdirent /hostroot/proc/1/map_files: permission denied"

So I think there's no real problem, except the error message itself. Any way to get rid of it?

svenlowrybjss commented 2 years ago

Getting the same 2 errors and results - on one machine. On another with the exact same docker-compose, it works fine with no warning messages. Both are running in WSL2.

doku:
    image: amerkurev/doku:latest
    container_name: dev-docker-doku
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/hostroot:ro
    ports:
      - "9090:9090"
palansher commented 3 months ago

Hello!

Same issue on Debian 12 Swarm:

doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | doku v0.0.16-5eb6b55-20230220T18:49:35
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:13Z" level=info msg="docker engine API (1.41)"
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:13Z" level=info msg="calculating size of volumes..."
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:13Z" level=info msg="starting http server at 0.0.0.0:9090"
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:14Z" level=error msg="failed to get mounted file or directory" err="readdirent /hostroot/proc/1/map_files: permission denied"
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:15Z" level=error msg="failed to get mounted file or directory" err="stat /hostroot/var/run: no such file or directory"
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:41:34Z" level=error msg="failed to get mounted file or directory" err="lstat /hostroot/var/lib/docker/overlay2/a1b4cd87ad317f97c5a9b03039c946358d71d5ea15d1bad4d16477ca13c28349/merged/proc/1/fd/8: no such file or directory"
doku_docu.1.bt5d5a3qw3rn@vs-docker-dev-cn03    | time="2024-08-12T17:42:29Z" level=error msg="failed to get mounted file or directory" err="readdirent /hostroot/proc/1/map_files: permission denied"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | doku v0.0.16-5eb6b55-20230220T18:49:35
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:34Z" level=info msg="docker engine API (1.41)"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:34Z" level=info msg="calculating size of volumes..."
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:34Z" level=info msg="starting http server at 0.0.0.0:9090"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:35Z" level=error msg="failed to get mounted file or directory" err="readdirent /hostroot/proc/1/map_files: permission denied"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:36Z" level=error msg="failed to get mounted file or directory" err="stat /hostroot/var/run: no such file or directory"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:02:45Z" level=error msg="failed to get mounted file or directory" err="lstat /hostroot/var/lib/docker/overlay2/28646a610660ad8cc66f0e75f944d1630d3602a78b917c639ff2443c0bcb754a/merged/proc/1/fd/8: no such file or directory"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:04:03Z" level=error msg="failed to get mounted file or directory" err="readdirent /hostroot/proc/1/map_files: permission denied"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:41:11Z" level=info msg="gracefully http server shutdown"
doku_docu.1.894klvfnl6d4@vs-docker-dev-cn03    | time="2024-08-12T17:41:11Z" level=info msg=goodbye
version: "3.9"
services:
  docu:
    image: amerkurev/doku:latest
    ports:
      - 9100:9090
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/hostroot:ro
docker info
Client: Docker Engine - Community
 Version:    26.1.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 49
  Running: 15
  Paused: 0
  Stopped: 34
 Images: 25
 Server Version: 26.1.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: active
  NodeID: p288ckeau2auud16di6vs90j7
  Is Manager: true
  ClusterID: o5vbw61rqshravp5tw0s31p2v
  Managers: 3
  Nodes: 3
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.12.18.42
  Manager Addresses:
   10.12.18.42:2377
   10.12.18.45:2377
   10.12.18.46:2377
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.10.0-30-amd64
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.62GiB
 Name: vs-docker-dev-cn03
 ID: 021618bd-1c80-49d0-903a-a8f750e61b4c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
docker version 
Client: Docker Engine - Community
 Version:           26.1.3
 API version:       1.45
 Go version:        go1.21.10
 Git commit:        b72abbb
 Built:             Thu May 16 08:33:47 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.3
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.10
  Git commit:       8e96db1
  Built:            Thu May 16 08:33:47 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.32
  GitCommit:        8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0