Created attachment 1712515 [details]
simple webkit/python browser
Description of problem: In bug 1841104 we got a report that cockpit-desktop does not work properly on RHEL 8.3: The login page still works, but as soon as it connects to the websocket, page hangs or even stays blank.
Version-Release number of selected component (if applicable):
How reproducible: Always
Steps to Reproduce:
1. /usr/libexec/cockpit-desktop /
Or alternatively, use the attached script:
1. sudo systemctl start cockpit.socket
2. ./pywebkit http://localhost:9090
3. Log in as your user
- In the pywebkit reproducer, the login page works. The login page does not appear with cockpit-desktop (deliberately).
- Webkit window opens and stays empty.
Expected results: webkit window renders cockpit.
* As the login page works, I suspect this is somehow related to cockpit's websocket -- the "main" pages all require that, but the login page doesn't.
* ./pywebkit works fine for other pages like https://google.com or https://redhat.com
* This works fine on Fedora 32, both with epiphany and cockpit-desktop and ./pywebkit. Fedora 32 has the same webkit2gtk3 upstream version.
* I can't test epiphany on RHEL 8.3, as it's not in RHEL nor EPEL, and installing the Fedora 32 package fails due to dependencies.
* Firefox works fine with cockpit. But cockpit-desktop prefers webkit to avoid all the browser chrome (it sets up a little network namespace sandbox, so that cockpit is the *only* thing that the page can access -- it's supposed to feel like a desktop app).
* There are on console messages related to this.
Do you have any hint how to debug that further? Without error messages or console logs I don't know how to proceed here.
(In reply to Martin Pitt from comment #0)
> The login page still works, but as soon
> as it connects to the websocket, page hangs or even stays blank.
It's a good thing you mentioned websocket, otherwise this would have been hard. Here's what I did:
* Tested your pywebkit script on RHEL 8.2 and verifies it works fine.
* Installed webkit2gtk3 from RHEL 8.3 on my RHEL 8.2 system and verified it breaks cockpit
* Installed a hacked up scratch build of libsoup 2.70.0 and verified it fixes cockpit
* Breathed sigh of relief. Thank goodness!
The problem is likely caused by https://trac.webkit.org/changeset/248099/webkit. We switched from WebKit's cross-platform WebSockets implementation to libsoup's implementation. And our libsoup in RHEL is old and missing a couple dozen WebSocket fixes. So we could either revert that change in WebKit, or figure out what commit in libsoup we need to fix this. Fixing libsoup is almost surely going to be a smaller, easier, and safer change, so next I'll try to figure out which commit in libsoup is needed. So far, I know that the issue was fixed somewhere between 2.62.3 (RHEL 8) and 2.70.0 (latest stable).
Shame we missed blocker/exception deadline, but late-breaking problems like this are what the exception process is for....
OK, I bisected this down to https://gitlab.gnome.org/GNOME/libsoup/-/commit/35f1bac5ff9ec694e64b65e51f0e7a3226aa3aaf. I still need to test a scratch build to ensure that no other older commits are needed too, but that one solves this bug.
Wow, thanks Michael! I woke up with wanting to do that bisect, and you figured it all out already! So I can at least help with the backporting and validation. That commit alone does not apply; fixing it wouldn't be too difficult, but usually it's preferable to backport a few more patches that then apply, so that the end result isn't entirely new code. I found that these three work, in that order:
(only need to drop the SOUP_AVAILABLE_IN_2_68 bit now).
I unfuzzed the patches, and sent https://src.osci.redhat.com/rpms/libsoup/pull-request/1 for your review. This also provides a scratch build and running tests and such. Of course feel free to ignore this and use your own workflow/commit.
I grabbed the x86_64 build from https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=30982707 , installed the rpm into my RHEL 8.3 desktop, and confirm that both "Red Hat Subscriptions" from the Activities menu as well as a direct "/usr/libexec/cockpit-desktop /" work fine now.
Created attachment 1712800 [details]
Unable to reproduce with libsoup-2.62.3-2.el8.x86_64
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: GNOME security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.