Typhonragewind / meshcentral-docker

163 stars 46 forks source link

Errors on new setup dealing with subuid and subgid during image extraction. #25

Closed bmcgonag closed 1 year ago

bmcgonag commented 1 year ago

I have been successfully using your image for a while now, but I recently tried to setup a new system with it. When I run the docker-compose up -d, i get the following output. Not sure what's happening.

[+] Running 6/10
 ⠇ meshcentral Pulling                                                                      40.8s
   ⠿ 8740c948ffd4 Pull complete                                                             11.8s
   ⠿ 29fd6e358874 Pull complete                                                             12.4s
   ⠿ 4e27380bb509 Pull complete                                                             15.0s
   ⠿ 2953e5b1cdc9 Pull complete                                                             15.2s
   ⠿ ee8a366292cb Pull complete                                                             15.3s
   ⠿ b805d591a3a1 Pull complete                                                             15.3s
   ⠦ 551ba09a473e Extracting       193.4MB/193.4MB                                          19.6s
   ⠦ 80adf2adbfad Download complete                                                         19.6s
   ⠦ 0192ef11e5ac Download complete                                                         19.6s
failed to register layer: ApplyLayer exit status 1 stdout:  stderr: failed to Lchown "/opt/meshcentral/node_modules/multiparty/node_modules/statuses/HISTORY.md" for UID 1516583083, GID 0 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /opt/meshcentral/node_modules/multiparty/node_modules/statuses/HISTORY.md: invalid argument
Typhonragewind commented 1 year ago

Uh, that's a weird one. From what i've been able to gather, this error seems to happen mostly in rootless containers, which this one isn't (yet). More, I haven't had this issue in my own system. Can you provide some more details of your setup, please?

dimensionxIT commented 1 year ago

getting same error stderr: lchown /opt/meshcentral/node_modules/multiparty/node_modules/statuses/HISTORY.md: invalid argument

trying to run it on proxmox (alpine linux)

bmcgonag commented 1 year ago

I setup an LXC container, and installed docker-ce, and docker-compose on it. Then ran the docker-compose file I always run. It's the one you posted, just modified with my url, proxy ip, etc. I use LXC for docker all the time, but that could be part of it. I'll try on a full VM when I'm feeling a bit better, and let you know if the error persists.

bmcgonag commented 1 year ago

Ok, I tested real quick. So it is likely something to do with running it in an LXC container. Not sure why, but I'll see what I can figure out. When i run it on a regular ubuntu VM it works with no issues.

Typhonragewind commented 1 year ago

Ok, I tested real quick. So it is likely something to do with running it in an LXC container. Not sure why, but I'll see what I can figure out. When i run it on a regular ubuntu VM it works with no issues.

I think I may have stumbled across the cause for this, now that you referenced the LXC container. Try increasing the number of potential UIDs - meshcentral might be using a very high UID to try and avoid conflicts out of the box and that UID may fall out of the limited range in LXC containers

Typhonragewind commented 1 year ago

@bmcgonag Found something that might help you https://forum.proxmox.com/threads/docker-failed-to-register-layer-applylayer-exit-status-1-stdout-stderr-unlinkat-var-log-apt-invalid-argument.119954/

kstorbakken commented 1 year ago

I'm having this issue with rootless podman as well. It starts with tag 1.1.3, any version before that is fine so I'm locked on 1.1.2 for now.

I'm using the default number of sub uid's on most linux distro's: 65536. To reach the uid required to pull the image, I'd need to increase the number to larger than 1516583083. That's a very high amount of subuid's for a single user and other users mapped after 65536 will need to be adjusted even higher. If any of those later users have their starting subuid changed, they may run into all kinds of uid mapping issues with existing containers they're running.

It sounds like you're working on moving towards a more rootless friendly image for in the future. I'm able to keep updating meshcentral inside of the container so I guess that works for now. Appreciate that you made this image available as well!!

Typhonragewind commented 1 year ago

It sounds like you're working on moving towards a more rootless friendly image for in the future

Yes, ideally I would like to make this a rootless container, but I haven't had much time to dedicate to it

kstorbakken commented 1 year ago

The 1.1.5 update you pushed a few days ago works great with Podman once again. I can pull the image with no issues and it runs fine with a non-root account.