English
Docker Permission Denied: Identify the Cause
Check data directory write permissions when logs contain:
text
Error: Permission denied (os error 13)
运行日志目录创建失败,将仅输出到 stdout: dir=/data/logs/runtime
前端在线版本启动协调失败,尝试回退镜像或包内前端
前端更新文件操作失败: Permission denied (os error 13)
已回退镜像或包内前端目录: /app/frontendThe current image runs as non-root UID/GID 10001:10001. Root-owned data from an older deployment, new host directories, read-only mounts, or NAS ACLs can prevent this user from writing. Image directory ownership does not override host bind mount permissions; see Docker bind mount documentation.
Runtime logs still go to Docker logs when log file creation fails. Frontend reconciliation attempts to fall back to bundled pages. Database or TLS directory permissions may also prevent startup. A “service started successfully” log alone does not establish readiness; check container status and the readiness endpoint.
Check the User and Mounts
Run these commands in the Docker host terminal, such as the server or NAS SSH terminal. Replace leelaa-reader with your container name:
bash
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
docker inspect leelaa-reader --format 'User={{.Config.User}} Status={{.State.Status}} RestartCount={{.RestartCount}}'
docker inspect leelaa-reader --format '{{range .Mounts}}{{println "Type=" .Type "Source=" .Source "Destination=" .Destination "RW=" .RW "Name=" .Name}}{{end}}'Find Destination=/data. Check any separate mounts under /data, such as /data/frontend-updates, too.
| Output | Meaning and Action |
|---|---|
User=10001:10001 | Use the UID/GID below. If overridden, use the actual runtime user. |
Type=bind | Source is the host directory. Repair bind mount permissions. |
Type=volume | A Docker volume. Repair volume permissions. |
RW=false | Change the data mount to read-write in Compose or your management panel. Changing ownership cannot fix a read-only mount. |
/data must be writable; the audiobook mount /books:ro can remain read-only. After changing mount configuration, Compose users run docker compose up -d leelaa-reader from the existing configuration directory, replacing the service name if needed. Panel users apply the updated container configuration. Preserve the original data mount and volume.
For NAS ACLs, Rootless Docker, or Docker Desktop, see Docker Permissions on NAS and Special Environments。
Verify the Repair
After restarting, check recent logs and container status:
bash
docker logs --since 5m --tail 100 leelaa-reader
docker inspect leelaa-reader --format 'Status={{.State.Status}} RestartCount={{.RestartCount}}'
curl -i http://127.0.0.1:8686/api/v1/health/readyReplace 8686 with your published host port and use the correct host address for remote requests. Readiness should return HTTP 200. For 503, inspect new database initialization errors. For connection failures, check container stability, port mapping, and startup errors.
Confirm no new permission errors occur, restart counts stop increasing, and existing libraries, accounts, and playback progress remain available after signing in. Frontend update reconciliation should no longer fall back because of denied access. Historical log entries remain; compare timestamps when checking the repair.
