BaldissaraMatheus / Tasks.md

A self-hosted, Markdown file based task management board
https://hub.docker.com/r/baldissaramatheus/tasks.md
MIT License
737 stars 30 forks source link

failed to Lchown "/api/node_modules/statuses/HISTORY.md" #5

Open timdonovanuk opened 1 year ago

timdonovanuk commented 1 year ago

Hi,

Getting a strange error. I run other docker images on the same server with no issue, and have tried tweaking the environmental variables but no dice.

docker: failed to register layer: Error processing tar file(exit status 1): failed to Lchown "/api/node_modules/statuses/HISTORY.md" for UID 1516583083, GID 0 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /api/node_modules/statuses/HISTORY.md: invalid argument.
See 'docker run --help'.

Using:

docker run -d \
  --name tasks.md \
  -p 7070:8080 \
  -v /opt/tasks/cards/:/api/files/ \
  --restart unless-stopped \
  baldissaramatheus/tasks.md

Thanks!

timdonovanuk commented 1 year ago

Hmm I'm using docker in an LXC container which apparently is relevant: https://old.reddit.com/r/MeshCentral/comments/10vk3bq/issue_installing_fresh_with_docker_using/

But not had it with other images. The fact that there are only 3 hits on google for this error tells me its rather unique 😄

BaldissaraMatheus commented 1 year ago

Thank you for reporting the issue, to be honest I never messed with LXC containers before so I cannot be sure right away about the cause. Though I suspect the problem has to do with UIDs and GIDs available in that environment, since in the docker image there is a step for setting the files permissions as the user's UID and GID so they are not owned by root.

I'll take a look into that as soon as possible

timdonovanuk commented 1 year ago

Yep for sure, it's the line fs.promises.chown(files/${lane}/${name}.md, PUID, PGID); causing issues, but not sure why! Had a play around with the various docker ways to force uid/guid (user: 0:0, PUID env vars etc.) but no luck.

I'm probably quite an edge case to be honest, so thank you :)

BaldissaraMatheus commented 1 month ago

I couldn't look into it yet, but someone mentioned in a reddit thread:

If it's an unprivileged LXC, the uid and gid of root get remapped. I would assume gid 0 is part of the problem? Pretty sure they add 100000 to the uid/gid mapped to the host.

This thread/comment might be helpful? https://www.reddit.com/r/Proxmox/comments/11gvp19/comment/jaqir3y/