Open derytim opened 1 month ago
@derytim I'd be interested what the output of the id
command is on your host computer and seeing if your user's UID/GID match up to what Lando is trying to set.
The ~/.lando/scripts
folder is where the scripts get copied to for the containers to reference them, so any edits you make there will be overwritten. You'd have to run Lando from source to mess around with the scripts themselves.
LMK if you made any independent progress on this @derytim, know it's a bit long in the tooth (sorry for the late response).
Thanks @reynoldsalec, I had set this down. If I run id
on the host system, the UID:GID is 1001:1001
.
Gotcha, so sounds like Lando is finding those values ok, but something is going wrong when it runs the perm-sweep; my guess is that this logic $(getent group "$LANDO_HOST_GID" | cut -d: -f1)
is returning a blank GID in your case for some reason: https://github.com/lando/core/blob/811250fda95243a1d5fc12def22debdd776a3ac3/scripts/user-perms.sh#L104.
If you lando ssh
and then run getent group "1001" | cut -d: -f1
, what does it return?
getent group "1001"
returns nothing. There's no group with that GID in my container:
$ grep "1001" /etc/group
$ grep "1000" /etc/group
user:x:1000:user
I suspect that the issue is in this block https://github.com/lando/core/blob/811250fda95243a1d5fc12def22debdd776a3ac3/scripts/user-perm-helpers.sh#L17-L23 That's the piece that I don't have visibility into without building Lando from source.
This container is alpine.
Yeah, given that the group doesn't exist you may be right. Could be worth trying out the addgroup -g "$GID" "$GROUP"
command in the container manually to see if they fail.
At this point, the addgroup
fails if I try to run it manually (since the group user
already exists in the system).
If I run addgroup -g "1001" "usertest"
, that adds the group as expected.
$ getent group "1001"
usertest:x:1001
Which doesn't really explain why user-perms.sh
isn't doing what it says it is doing.
I noticed some error messages in output from
lando rebuild
- this is a drupal localdev. The errors I see are:I've traced this back to be coming from
user-perms.sh
. Looking at thelando logs
are interesting:The part that really has me scratching my head is:
It looks like the group ID isn't being created or set properly, although I don't know why that would be the case. I can't instrument
~/.lando/scripts
to give me more output, as any changes to scripts there get overwritten. Thoughts?