RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1841104 - cockpit-desktop runs pages in Limited Access mode; webkit browser gets stuck
Summary: cockpit-desktop runs pages in Limited Access mode; webkit browser gets stuck
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: cockpit
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.3
Assignee: Martin Pitt
QA Contact: Jan Ščotka
URL:
Whiteboard:
Depends On:
Blocks: 1842946
TreeView+ depends on / blocked
 
Reported: 2020-05-28 11:29 UTC by Rehana
Modified: 2021-09-03 15:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:53:29 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Retrieving subscription status (943.40 KB, image/png)
2020-05-28 11:29 UTC, Rehana
no flags Details
prompt seen on executing /usr/libexec/cockpit-desktop / (110.67 KB, image/png)
2020-08-25 07:18 UTC, Archana Pandey
no flags Details
subscriptions desktop (135.80 KB, image/png)
2020-08-27 10:21 UTC, Archana Pandey
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4511 0 None None None 2020-11-04 01:53:46 UTC

Description Rehana 2020-05-28 11:29:21 UTC
Created attachment 1693023 [details]
Retrieving subscription status

Description of problem:
Observed the message "Retrieving subscription status"  displayed forever when tried to launch subscription manager from desktop by going to Activities --> Type "subscription-manager" click the cockpit wrapper window and launch the window . 

Version-Release number of selected component (if applicable):
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.11-1
subscription management rules: 5.39
subscription-manager: 1.27.3

How reproducible:


Steps to Reproduce:
1.Launch gui from desktop 
2.Message appear even though the system is registered and subscribed. 
3.Status is correctly reflected on Cockpit UI as well. (PFA)

Actual results:
message "Retrieving subscription status"  is displayed for ever

Expected results:
Should show the current system registration status 

Additional info:

Comment 2 Martin Pitt 2020-06-30 15:16:12 UTC
Argh, I have a hunch that this broke with the authentication rework. Running "/usr/libexec/cockpit-desktop /" now shows that it's running in "Limited access mode", and there is no graphical polkit prompt any more. We somehow need to teach cockpit-desktop to try and do either the sudo or the polkit way when showing a particular frame already.

To confirm that this is indeed the bug you are seeing, please try this:

 - /usr/libexec/cockpit-desktop /
 - Click on the blue "Turn on administrative access mode" or the black "Limited access" in the top bar, and enter your sudo password.
 - Switch to Subscriptions

It should work then.

There is a minor but in subscription-manager that it doesn't correctly handle the case when an unprivileged user opens the page. But the main issue is with cockpit/cockpit-desktop itself, so I reassign this.

Comment 3 Martin Pitt 2020-07-07 11:30:20 UTC
Fix and integration test are being developed in https://github.com/cockpit-project/cockpit/pull/14324 . It's not perfect yet, but we have an approach and a reproducer/test.

Comment 6 Archana Pandey 2020-08-17 11:56:52 UTC
I can still reproduce this issue on latest cockpit

Issue: Observed the message "Retrieving subscription status"  displayed forever when tried to launch subscription manager from desktop by going to Activities --> Type "subscription-manager" click the cockpit wrapper window and launch the window .

[root@localhost ~]# rpm -qa cockpit
cockpit-224.1-1.el8.x86_64
[root@localhost ~]# 
[root@localhost ~]# subscription-manager version 
server type: Red Hat Subscription Management
subscription management server: 3.1.16-1
subscription management rules: 5.40
subscription-manager: 1.27.13-1.el8


adding additional info

[root@localhost ~]# /usr/libexec/cockpit-desktop /

(-c:16845): dbind-WARNING **: 17:21:37.155: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-8sl2ZKcjc4: Connection refused
WaylandCompositor requires eglBindWaylandDisplayWL, eglUnbindWaylandDisplayWL and eglQueryWaylandBuffer.
Nested Wayland compositor could not initialize EGL

(WebKitWebProcess:16853): dbind-WARNING **: 17:21:38.056: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-8sl2ZKcjc4: Connection refused
/bin/bash: line 1: 16841 Terminated              XDG_CONFIG_DIRS="$BROWSER_HOME" COCKPIT_SUPERUSER="pkexec" /usr/libexec/cockpit-ws -p 80 -a 127.0.0.90 --local-session=- 0<&0 1>&1
/usr/libexec/cockpit-desktop: line 1: 16832 Terminated              coproc COPROC ${2:+ssh "$2"} cockpit-bridge
[root@localhost ~]#

Comment 8 Martin Pitt 2020-08-24 15:42:30 UTC
@Archana: What precisely happens when you use this command? Did you get a polkit prompt at all? With "/usr/libexec/cockpit-desktop /", did it show limited access mode or administrative mode? On my system, starting cockpit-desktop brings up a polkit prompt, then Cockpit is in administrative mode.

Comment 9 Archana Pandey 2020-08-25 07:18:40 UTC
Created attachment 1712489 [details]
prompt seen on executing /usr/libexec/cockpit-desktop /

prompt seen on executing /usr/libexec/cockpit-desktop /

Comment 10 Martin Pitt 2020-08-25 07:35:54 UTC
Archana and I looked at this on IRC. This is a completely unrelated problem: In that case cockpit-desktop already runs as root, so there is no polkit/limited access mode involved. Instead, the screenshot shows an empty browser window, so apparently at least in that installation webkit or something related is broken. Can you please file a new bugzilla about that?

I'm currently downloading/installing current RHEL 8.3 desktop to check this.

Leaving this bug at ON_QA then. Rehana, are you able to check this on current RHEL 8.3 to see if it works for you now?

Comment 11 Martin Pitt 2020-08-25 08:00:06 UTC
FTR, Archana confirmed that this works with "BROWSER=firefox", so something in the webkit window is broken (that's the new bugzilla). But at least with firefox it now has administrative mode, and the polkit prompt worked, so it looks like *this* bug got fixed actually. *phew*. Thanks!

Comment 12 Martin Pitt 2020-08-25 08:42:54 UTC
I finally have a current RHEL 8.3 desktop ("Server with GUI") install, with cockpit 224.2. When I launch "Subscriptions" from GNOME Activities, I now do get a polkit prompt (that's the cockpit part of this fix), and cockpit-bridge runs as root.

But the subscription-manager cockpit page still exhibits the forever-rotating "Retrieving subscription status" behaviour. I get exactly the same behaviour with opening a Terminal and running "/usr/libexec/cockpit-desktop subscriptions". I can also reproduce the empty window part of that bug with "/usr/libexec/cockpit-desktop /"

All pages work with BROWSER=firefox: Overview, subscriptions, storage, etc. It seems that the webkit window browser is somehow broken: It just renders the initial page, but never updates.

So the authentication part is fixed, the browser part isn't -- this still needs investigation.

Comment 13 Martin Pitt 2020-08-25 10:57:30 UTC
Some observations:

 * This isn't related to the cockpit-desktop sandboxing/coproc stuff. Running the pywebkit browser against the normal http://localhost:9090 cockpit service has the same problem.

 * It is hard to get WebKit to catch console messages; WebkitWebPage has a "console-message-sent" signal [1], but I don't know how to get a WebPage from the top-level WebView object [2].
   However, I can call

      self.webview.get_settings().set_enable_write_console_messages_to_stdout(True)

   and that works.

 * Both epiphany-browser and my own pywebkit script (i. e. the one embedded in cockpit-desktop) work fine on Fedora 32. Both Fedora 32 and RHEL 8.3 have webkit 2.28.4, just Fedora is at revision -3, and RHEL at revision -1.

 * Unsetting $DISPLAY makes no difference -- so this really uses wayland in both cases. Conversely, forcing Xwayland (env -u WAYLAND_DISPLAY) also makes no difference.


I filed bug 1872270 against webkit for now, maybe the devs have an idea how to debug that.

[1] https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebPage.html#WebKitWebPage-console-message-sent
[2] https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html

Comment 14 Martin Pitt 2020-08-25 10:58:34 UTC
Contingency plan is to temporarily disable the webkit browser in cockpit-desktop. Then it will use firefox. But the user experience is really not great, as this really isn't a general "browser", and the extra default tab and all the chrome really gets in the way.

Comment 15 Michael Catanzaro 2020-08-25 17:06:59 UTC
I guess this is probably pretty important, so I'll look into the WebKit bug soon.

(In reply to Martin Pitt from comment #13)
>  * It is hard to get WebKit to catch console messages; WebkitWebPage has a
> "console-message-sent" signal [1], but I don't know how to get a WebPage
> from the top-level WebView object [2].

WebKitWebPage is a web process object: there's no way to get it in the UI process. You have to write a web extension. You create a shared object that defines a WebKitWebExtensionInitializeFunction, that gets called on startup with a WebKitWebExtension, then you connect to its page-created signal to get each WebKitWebPage as it is created.

But forget about that, that's way too much effort to get some debug messages, especially when you've already discovered set_enable_write_console_messages_to_stdout(). That's better.

Comment 16 Martin Pitt 2020-08-26 05:31:33 UTC
@Michael: Thanks, so I wasn't missing something obvious. But indeed set_enable_write_console_messages_to_stdout() seems to work -- I initially thought it didn't as I was getting so few messages, but it seems that's just a sign that the page loading hangs very early.

Comment 19 Archana Pandey 2020-08-27 10:21:57 UTC
Created attachment 1712802 [details]
subscriptions desktop

Comment 25 errata-xmlrpc 2020-11-04 01:53:29 UTC
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 (cockpit 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.

https://access.redhat.com/errata/RHBA-2020:4511


Note You need to log in before you can comment on or make changes to this bug.