-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/usr/libexec/cockpit-session has wrong owner in deployment #21201
Comments
Adding the strace while refreshing the UI. |
Hey @spmfox ! I'm afraid the strace doesn't help, there's nothing interesting in it. It doesn't fork cockpit-session or cockpit-ssh (or anything really), which are the parts responsible for setting up the login session. You'd need to attach strace earlier, and with I tried to reproduce this. Our CI already has a fairly standard C9S bootc image. So I booted that and built a container like yours: # cat <<EOF | podman build -t localhost/cws -
FROM quay.io/centos-bootc/centos-bootc:stream9
RUN dnf -y install cockpit-ws cockpit-bridge
RUN systemctl enable cockpit.socket
EOF Originally I included "cockpit", but that killed my VM -- supposedly the extra dependencies of cockpit/storage/device-mapper/etc. are too much. So I left out "cockpit" from the above. That worked. Then:
... again kills my VM. No dmesg entry other than SELinux: Context unconfined_u:object_r:invalid_bootcinstall_testlabel_t:s0 is not valid (left unmapped). (which I suppose is not the cause for the freeze), no 100% CPU usage, but ssh and even my VT login session are completely unresponsive. I'm afraid I don't have a separate laptop to spare to try this on hardware. I did another shot on this branch (it's an old experiment of mine) and building it on github, so that it's on ghcr.io now Running this on my c9s VM finally worked:
and this also revealed the problem (this was my first suspicion):
so, installing cockpit-ws in bootc messed up the permission of that suid root helper. It needs to have group "cockpit-wsinstance". This is a bootc bug, and also explains why reinstalling the package helps -- that fixes the permissions. Workarounds for you that come to my mind:
Note that we don't like this suid root thing either. We've had #16811 lingering for a long time already to move everything to |
Forgot to say: I can reproduce this "internal error". This fixes it:
ah, that's bogus of course -- /usr isn't writable. You'd have to do the usroverlay on each boot, which is ugly. So best would be to actually fix that in bootc. |
Thanks. I had the same problem with |
I reported this to containers/bootc#870 . |
I dug deeper into this issue and it doesn’t seem to be a Bootc relies on OCI containers to build and transport an image to be deployed in what we will call the server for the sake of this example. Each time the container image gets re-built, it will create a brand new deployment that will replace everything in Some applications including If I looked at my deployment and I found that it is not common to have files in I resolved the problem creating my user within the container build, so You mentioned before that |
This was closed as unfixable in bootc, so we'll need to find a workaround. |
I quickly chatted about that with @allisonkarlitskaya . As mentioned, the good and desirable solution to this is to finish PR #16808. That's a lot of work, but at least shouldn't have insurmountable problems. A quick bandaid for that may be to ship So I made a couple of experiments how we could do that on Fedora 41, Debian stable, and RHEL 8.10. It all starts with
which without further steps just results in "Internal error in login process". naïve: copy to /run
mkdir /run/cockpit/bin
mount -t tmpfs,exec,suid tmpfs /run/cockpit/bin
CS=/usr/libexec/cockpit-session # or /usr/lib/cockpit/cockpit-session on Debian
cp $CS /run/cockpit/bin/
chcon --reference=$CS /run/cockpit/bin/cockpit-session
chgrp cockpit-wsinstance /run/cockpit/bin/cockpit-session
chmod u+s /run/cockpit/bin/cockpit-session
printf '[Basic]\nCommand=/run/cockpit/bin/cockpit-session\n[Negotiate]\nCommand=/run/cockpit/bin/cockpit-session' > /etc/cockpit/cockpit.conf
systemctl stop cockpit This silently fails with SELinux on F41 and R8 despite https://fedoraproject.org/wiki/SELinux/Debugging#Enable_full_auditing , and works with ID-mapped mountsSee https://lwn.net/Articles/837566/ . It requires kernel 5.12, and Debian stable has 6.1, RHEL 9 has 5.14 👍 RHEL 8 has 4.19, but we don't need to support that any more from main. On Fedora 41:
Too bad. This also fails the same way with creating /tmp/x and trying to mount over that. The standard curl -L -O https://raw.githubusercontent.com/brauner/mount-idmapped/refs/heads/master/mount-idmapped.c
gcc -o mount-idmapped mount-idmapped.c
./mount-idmapped --map-mount g:0:`id -g cockpit-wsinstance`:1 $CS /tmp/x
# Invalid argument - Failed to change mount attributes (again, same for a different target mount)
So, this is all bit hackish 😢 |
Explain what happens
I am having a problem using cockpit-ws and centos-bootc.
Starting from centos-bootc, simply installing cockpit-ws and enabling cockpit.socket results in the UI giving this error:
Internal error in login process
Originally I thought this was a bootc problem, and reported it over there - however they've fixed the selinux portion and this still does not work (with or without selinux enforcing) containers/bootc#571
Fixing the issue is super easy:
dnf reinstall cockpit-ws
and I just cannot figure out what exactly is broken that a reinstall fixes. bootc gives you the option to make /usr writable via overlayfs but its lost after a reboot. So to fix the problem you simply do this:I've been trying to figure out what exactly is being changed during the reinstall. I've tried the journal (nothing interesting), strace on the cockpit-ws process (I didn't see anything but I would be willing to paste if someone thinks it will help), I've tried using auditctl to see what changes on the overlay but that didn't work quite right, I tried removing the self signed certs but that wasn't it either.
I've read through every single "internal error" issue reported on here, and most of them are resolved via reinstall or upgrade. In this case, the OS is immutable, so its broken on every boot.
Is there a way to get cockpit-ws to give verbose logs or can anyone think of other data I can look at that might give a clue?
To reproduce this, you will need a working bootc/silverblue/atomic VM that you can rebase.
Containerfile:
Versions:
Version of Cockpit
327
Where is the problem in Cockpit?
Unknown or not applicable
Server operating system
CentOS
Server operating system version
CentOS Stream release 9 - stream9.20241030.0
What browsers are you using?
Firefox
System log
The text was updated successfully, but these errors were encountered: