System-config-printer problem in labwc

The system-config-printer can’t be unlock in labwc but it can be unlock in wayfire and xfce4 labwc wayland.
Below is the terminal messages in xfce with labwc.

~> system-config-printer

(system-config-printer.py:47585): Handy-WARNING **: 19:31:22.088: Using GtkSettings:gtk-application-prefer-dark-theme together 
with HdyStyleManager is unsupported. Please use HdyStyleManager:color-scheme instead.
/usr/share/system-config-printer/system-config-printer.py:325: DeprecationWarning: Gtk.ActionGroup.list_actions is deprecated
  for action in printer_manager_action_group.list_actions ():
/usr/share/system-config-printer/system-config-printer.py:326: DeprecationWarning: Gtk.Action.set_sensitive is deprecated
  action.set_sensitive (False)
/usr/share/system-config-printer/system-config-printer.py:334: DeprecationWarning: Gtk.ActionGroup.get_action is deprecated
  act = printer_manager_action_group.get_action (action)
/usr/share/system-config-printer/system-config-printer.py:364: DeprecationWarning: Gtk.UIManager.ensure_update is deprecated
  self.ui_manager.ensure_update ()
/usr/share/system-config-printer/system-config-printer.py:365: DeprecationWarning: Gtk.UIManager.get_accel_group is deprecated
  self.PrintersWindow.add_accel_group (self.ui_manager.get_accel_group ())
/usr/share/system-config-printer/system-config-printer.py:374: DeprecationWarning: Gtk.UIManager.get_action is deprecated
  action = self.ui_manager.get_action ("/new-printer")
/usr/share/system-config-printer/system-config-printer.py:375: DeprecationWarning: Gtk.Action.create_menu_item is deprecated
  newprinteritem = action.create_menu_item ()
/usr/share/system-config-printer/system-config-printer.py:673: DeprecationWarning: Gtk.Action.get_proxies is deprecated
  for widget in action.get_proxies ():
/usr/share/system-config-printer/system-config-printer.py:2253: DeprecationWarning: Gdk.threads_enter is deprecated
  Gdk.threads_enter ()

(system-config-printer:47585): Gdk-CRITICAL **: 19:31:22.464: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:47585): Gdk-CRITICAL **: 19:31:22.985: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:47585): Gdk-CRITICAL **: 19:31:23.374: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

Below is the terminal messages in labwc

> system-config-printer

(system-config-printer.py:56347): Handy-WARNING **: 19:35:22.107: Using GtkSettings:gtk-application-prefer-dark-theme together 
with HdyStyleManager is unsupported. Please use HdyStyleManager:color-scheme instead.
/usr/share/system-config-printer/system-config-printer.py:325: DeprecationWarning: Gtk.ActionGroup.list_actions is deprecated
  for action in printer_manager_action_group.list_actions ():
/usr/share/system-config-printer/system-config-printer.py:326: DeprecationWarning: Gtk.Action.set_sensitive is deprecated
  action.set_sensitive (False)
/usr/share/system-config-printer/system-config-printer.py:334: DeprecationWarning: Gtk.ActionGroup.get_action is deprecated
  act = printer_manager_action_group.get_action (action)
/usr/share/system-config-printer/system-config-printer.py:364: DeprecationWarning: Gtk.UIManager.ensure_update is deprecated
  self.ui_manager.ensure_update ()
/usr/share/system-config-printer/system-config-printer.py:365: DeprecationWarning: Gtk.UIManager.get_accel_group is deprecated
  self.PrintersWindow.add_accel_group (self.ui_manager.get_accel_group ())
/usr/share/system-config-printer/system-config-printer.py:374: DeprecationWarning: Gtk.UIManager.get_action is deprecated
  action = self.ui_manager.get_action ("/new-printer")
/usr/share/system-config-printer/system-config-printer.py:375: DeprecationWarning: Gtk.Action.create_menu_item is deprecated
  newprinteritem = action.create_menu_item ()
/usr/share/system-config-printer/system-config-printer.py:673: DeprecationWarning: Gtk.Action.get_proxies is deprecated
  for widget in action.get_proxies ():
/usr/share/system-config-printer/system-config-printer.py:2253: DeprecationWarning: Gdk.threads_enter is deprecated
  Gdk.threads_enter ()

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:22.464: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:35.469: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:35.520: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:35.521: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:35.631: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:35.665: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

**(system-config-printer:56347): Gtk-WARNING **: 19:35:35.668: Error acquiring permission: Failed to acquire permission for action-id **
**org.opensuse.cupspkhelper.mechanism.all-edit**

(system-config-printer:56347): Gdk-CRITICAL **: 19:35:36.347: gdk_x11_window_get_xid: assertion 'GDK_IS_X11_WINDOW (window)' failed

It used to work before it was only yesterday when I notice it when I am trying to add an epson printer.
Oh just for info the system-config-printer is a gui tool in xfce4 for configuring printer it is the one called print settings in xfce4. :grinning:
Thanks in advance

This might be significant…

Error acquiring permission: Failed to acquire permission for action-id
org.opensuse.cups-pk-helper.mechanism.all-edit

…so looks like polkit authentication-agent issue in labwc. Xfce and Wayfire probably start start a polkit agent automatically, while your labwc session may not be.

Check in labwc session…
ps aux | grep -E 'polkit|authentication-agent' | grep -v grep

You can also try pkexec id. If you don’t get an authentication prompt that would be a good indication that labwc isn’t running a polkit authentication agent.

2 Likes

@deano_ferrari Thanks for the advice.
Here are the outputs.

~> ps aux | grep -E 'polkit|authentication-agent' | grep -v grep
polkitd     1121  0.1  0.0 383752 12512 ?        Ssl  09:51   0:00 /usr/libexec/polkit-1/polkitd --no-debug --log-level=notice
~> pkexec id
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/id' as the super user
Authenticating as: root
Password: 

** (process:3927): WARNING **: 09:54:47.620: Unknown line 'polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie' from helper
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.

What is the command to start it at login so I can add in labwc autostart and see if will work.

Could this be part of the zypper dup note I got from the last major dup?
This was the notes from my last zypper dup a few dys ago:

Update notifications were received from the following packages:
util-linux-2.42.2-2.1.x86_64 (/var/adm/update-messages/util-linux-2.42.2-2.1-1)
View the notifications now? [y/n] (n): y
(Use arrows or pgUp/pgDown keys to scroll the text by lines or pages.)

Message from package util-linux:

New /etc/fstab limitations for mount(8)!

This update introduces significant security hardening that may
result in breaking or incompatible changes for unprivileged user
mounts. The following changes are permanent security hardening
measures and cannot be disabled. They apply to unprivileged
(non-root) users:

X-mount.nocanonicalize:

  Paths must always be canonicalized for unprivileged users. The
  X-mount.nocanonicalize option is now ignored for non-root users.

X-mount.subdir:

  The X-mount.subdir feature for detached subdirectories is
  disabled for kernel < 6.15 for unprivileged users due to inherent
  race conditions.

Path canonicalization:

  If LIBMOUNT_FORCE_MOUNT2 is set, mount target paths for user
  mounts will no longer traverse directories writable by
  unprivileged users to prevent TOCTOU races.

Future util-linux or kernel versions can remove these restrictions.
Follow the mount(8) man page.

It is only an excerpt of the long lines of the note, I didn’t scroll all the way down to see all the warnings.
Thanks

Temporary workaround is using su -c.
sudo doesn’t work.

Ok, that confirms the polkit daemon is running, but there doesn’t appear to be an authentication agent running in your labwc session. (Polkit expects the desktop session to provide the authentication agent.)

Check…

zypper se -s polkit

… to show which polkit components/agents are installed.

For Gnome or XFCE…
ps aux | grep -E 'polkit.*agent|authentication-agent' | grep -v grep
…will return the active polkit agent. I’m not familiar with labwc, so I don’t know what the equivalent might be. Hopefully, zypper will show what might be missing.

Maybe, we can determine which one might be appropriate for labwc and add that specific agent to ~/.config/labwc/autostart as a workaround?

Ultimately, this might need a bug report.

1 Like

if you’re using plain labwc you do need to autostart a polkit agent.
add to your ~/.config/labwc/autostart
/usr/libexec/polkit-gnome-authentication-agent-1' >/dev/null 2>&1 &

if you haven’t already also add
systemctl --user --no-block start labwc-session.target >/dev/null 2>&1 &

and to ~/.config/labwc/shutdown
systemctl --user stop graphical-session.target

see this PR for more info on labwc-session.target

1 Like

@zeussuse

For I don’t know the reason it didn’t work, but it work by modifying
/usr/libexec/polkit-gnome-authentication-agent-1' >/dev/null 2>&1 &

To
/usr/libexec/polkit-gnome-authentication-agent-1 >/dev/null &
Any thoughts :thinking:

copy paste error on my part: stray '
omit the '

1 Like

Thanks @deano_ferrari and @zeussuse for the kind help.
@zeussuse thanks for the tip and solution to this thread.
This thread can be closed.

2 Likes

That’s what I was hinting at in my previous reply. Good to see now resolved for you. :wink:

1 Like

I’ll take a note of that :wink:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.