Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

gnome-control-center takes excessively long to open #200

Open
jamesps-ebi opened this issue Apr 25, 2023 · 13 comments
Open

gnome-control-center takes excessively long to open #200

jamesps-ebi opened this issue Apr 25, 2023 · 13 comments
Labels
bug Something isn't working jira Sync to jira medium

Comments

@jamesps-ebi
Copy link

When logged in as an AAD user account, opening the gnome-control-center app takes much longer than expected to open.

For an AAD user, it is taking roughly 25 seconds to open every time.
For a local user on the same machine, it is taking ~1 second.

Following the systemd journal, while attempting to open the app, I can't see any obvious issues, but I'm including the relevant output here:

Apr 25 08:17:35 test3 dbus-daemon[4716]: [session uid=3300935328 pid=4716] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gtk' unit='xdg-desktop-portal-gtk.service' requested by ':1.59' (uid=3300935328 pid=5131 comm="/usr/libexec/xdg-desktop-portal" label="unconfined")
Apr 25 08:17:35 test3 systemd[4693]: Starting xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)...
Apr 25 08:17:35 test3 xdg-desktop-por[5467]: g_dbus_connection_signal_subscribe: assertion 'object_path == NULL || g_variant_is_object_path (object_path)' failed
Apr 25 08:17:35 test3 xdg-desktop-por[5467]: g_dbus_connection_signal_subscribe: assertion 'object_path == NULL || g_variant_is_object_path (object_path)' failed
Apr 25 08:17:35 test3 xdg-desktop-por[5467]: g_dbus_connection_call_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed
Apr 25 08:17:41 test3 gnome-character[5374]: JS LOG: Characters Application started
Apr 25 08:17:41 test3 gnome-character[5374]: JS LOG: Characters Application exiting
Apr 25 08:17:46 test3 systemd[4693]: Started app-gnome-ubuntu\x2dadvantage\x2dnotification-5495.scope - Application launched by gnome-session-binary.
Apr 25 08:17:46 test3 systemd[4693]: Started app-gnome-update\x2dnotifier-5497.scope - Application launched by gnome-session-binary.
Apr 25 08:17:55 test3 dbus-daemon[710]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.261' (uid=3300935328 pid=5460 comm="gnome-control-center" label="unconfined")
Apr 25 08:17:55 test3 systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Apr 25 08:17:55 test3 dbus-daemon[710]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 25 08:17:55 test3 systemd[1]: Started systemd-hostnamed.service - Hostname Service.
Apr 25 08:17:55 test3 NetworkManager[796]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed
Apr 25 08:17:55 test3 NetworkManager[796]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed
Apr 25 08:17:55 test3 NetworkManager[796]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed

A wild guess, but I assume this could be related to policy-kit in some way since trying to add network connections via the gnome-control-center also is not possible. The buttons are all greyed-out.
Again, I don't have this problem with a local user account (also non-privileged).

@denisonbarbosa
Copy link
Member

denisonbarbosa commented Apr 25, 2023

Hey @jamesps-ebi, thanks for reporting this issue. Can you provide me a step-by-step of what you did post installation? I'm trying to reproduce the gnome-control-center problem that you've mentioned, but I'm not able to. In my test environment, the control center is opening normally.

@jamesps-ebi
Copy link
Author

Hey @jamesps-ebi, thanks for reporting this issue. Can you provide me a step-by-step of what you did post installation?

Sure no problem. Here's a step-by-step of how I set up my test VM:

  1. Install Ubuntu using the server ISO (default LVM storage layout + LUKS)
  2. After rebooting, install ubuntu-desktop-minimal
  3. Disable systemd-networkd
  4. enable NetworkManager
  5. Replace default /etc/netplan config with the below
network:
  version: 2
  renderer: NetworkManager

After the above, I went and configuring AAD logged in with a domain account.
I'll try again with a true Ubuntu 23.04 desktop installer as well. Maybe I'm missing some desktop specific config or package.

@jamesps-ebi
Copy link
Author

Same issue again with a new VM using the desktop installer image.

Full installation (not minimal)
LVM + LUKS

After configuring AAD and logging in with a domain user, gnome-control-center is taking upwards of 20 seconds to open every time. Adding the systemd journal entries from this attempt as well.

Apr 28 14:04:40 test3 check-new-release-gtk[13990]: WARNING:root:timeout reached, exiting
Apr 28 14:04:40 test3 systemd[13156]: Finished update-notifier-release.service - Notification regarding a new release of Ubuntu.
Apr 28 14:04:45 test3 gnome-character[14241]: JS LOG: Characters Application started
Apr 28 14:04:46 test3 gnome-character[14241]: JS LOG: Characters Application exiting
Apr 28 14:04:50 test3 systemd[1]: systemd-timedated.service: Deactivated successfully.
Apr 28 14:04:54 test3 xdg-desktop-por[13682]: Failed to create settings proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.gnome: Timeout was reached
Apr 28 14:04:54 test3 dbus-daemon[13200]: [session uid=3300935328 pid=13200] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gtk' unit='xdg-desktop-portal-gtk.service' requested by ':1.67' (uid=3300935328 pid=13682 comm="/usr/libexec/xdg-desktop-portal" label="unconfined")
Apr 28 14:04:54 test3 systemd[13156]: Starting xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)...
Apr 28 14:04:54 test3 xdg-desktop-por[14428]: g_dbus_connection_signal_subscribe: assertion 'object_path == NULL || g_variant_is_object_path (object_path)' failed
Apr 28 14:04:54 test3 xdg-desktop-por[14428]: g_dbus_connection_signal_subscribe: assertion 'object_path == NULL || g_variant_is_object_path (object_path)' failed
Apr 28 14:04:54 test3 xdg-desktop-por[14428]: g_dbus_connection_call_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed
Apr 28 14:04:55 test3 snapd-desktop-i[13796]: New theme: gtk=Yaru icon=Yaru cursor=Yaru, sound=Yaru
Apr 28 14:04:55 test3 snapd-desktop-i[13796]: All available theme snaps installed
Apr 28 14:04:55 test3 dbus-daemon[13200]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/gtk/Settings" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.68" pid=13796 label="snap.snapd-desktop-integration.snapd-desktop-integration" peer_pid=13678 peer_label="unconfined"
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: (gjs:13710): Gjs-WARNING **: 14:04:56.622: JS ERROR: Error creating proxy, File-roller (org.gnome.ArchiveManager1); relaunching.
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: : Gio.IOErrorEnum: Error calling StartServiceByName for org.gnome.ArchiveManager1: Timeout was reached
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: _promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:453:45
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: @/usr/share/gnome-shell/extensions/[email protected]/ding.js:206:13
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: ### Promise created here: ###
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: _injectToMethod/klass[method]@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:292:25
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: wrapper@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:250:17
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: makeNewProxy@/usr/share/gnome-shell/extensions/[email protected]/dbusUtils.js:142:71
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: async*makeNewProxy/<@/usr/share/gnome-shell/extensions/[email protected]/dbusUtils.js:161:34
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: wrapper/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:251:73
Apr 28 14:04:56 test3 gnome-shell[13363]: DING: @/usr/share/gnome-shell/extensions/[email protected]/ding.js:206:13
Apr 28 14:04:56 test3 dbus-daemon[13200]: [session uid=3300935328 pid=13200] Successfully activated service 'org.gnome.ArchiveManager1'
Apr 28 14:04:57 test3 dbus-daemon[13200]: [session uid=3300935328 pid=13200] Activating service name='org.gnome.ArchiveManager1' requested by ':1.76' (uid=3300935328 pid=13710 comm="gjs /usr/share/gnome-shell/extensions/ding@rasters" label="unconfined")
Apr 28 14:05:02 test3 dbus-daemon[619]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.339' (uid=3300935328 pid=14389 comm="gnome-control-center" label="unconfined")
Apr 28 14:05:02 test3 systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
Apr 28 14:05:02 test3 dbus-daemon[619]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 28 14:05:02 test3 systemd[1]: Started systemd-hostnamed.service - Hostname Service.
Apr 28 14:05:02 test3 NetworkManager[705]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed
Apr 28 14:05:02 test3 NetworkManager[705]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed
Apr 28 14:05:02 test3 NetworkManager[705]: ((src/core/nm-dbus-manager.c:1630)): assertion '<dropped>' failed

@denisonbarbosa denisonbarbosa added bug Something isn't working jira Sync to jira medium and removed wait-for-feedback labels May 1, 2023
@bash-bandicoot
Copy link

Same here on Ubuntu server -> ubuntu-desktop

@jibel jibel added jira Sync to jira and removed jira Sync to jira labels May 26, 2023
@turowicz
Copy link

Same here on ubuntu desktop. Also changing anything in the manage (like dark appearance) does not do anything.

@turowicz
Copy link

turowicz commented Jun 22, 2023

@denisonbarbosa on your most recent version 0.4.1~ppa2 launching Settings for Nautilius takes ages. After Settings load up, its impossible to change appearance (dark mode) or enable fractional scaling.

Also, I am unable to collect the diagnostic information:

image

@denisonbarbosa
Copy link
Member

denisonbarbosa commented Jun 22, 2023

@ jamesps-ebi, could you confirm something for me?

Did you enable the pam module for creating the home directory? This can be done by running:

# enable the mkhomedir module
sudo pam-auth-update --enable mkhomedir

# remove the aad cache (just removing the files in `/var/lib/aad/cache` is enough)
sudo rm /var/lib/aad/cache/* 

# try logging in with the aad user again 

If you didn't, would you mind trying it and providing some feedback on whether the problem still happens?

@turowicz, would you mind trying the same thing as well and try switching to dark mode again?

@jamesps-ebi
Copy link
Author

@ jamesps-ebi, could you confirm something for me?

Did you enable the pam module for creating the home directory? This can be done by running:

# enable the mkhomedir module
sudo pam-auth-update --enable mkhomedir

# remove the aad cache (just removing the files in `/var/lib/aad/cache` is enough)
sudo rm /var/lib/aad/cache/* 

# try logging in with the aad user again 

If you didn't, would you mind trying it and providing some feedback on whether the problem still happens?

I don't think I had this enabled. Pretty sure it's disabled by default.

In any case, I will test and report back.

@turowicz
Copy link

I have enabled it in the very beginning as it is in the documentation Readme.MD

@turowicz
Copy link

cc @denisonbarbosa

@jamesps-ebi
Copy link
Author

I have enabled it in the very beginning as it is in the documentation Readme.MD

Yes you're right. It's been a little while since I first tested this.

I did have mkhomedir enabled last time.

@denisonbarbosa I just tested again to be sure and I'm having the same issue. mkhomedir is enabled
Clearing the caches didn't help either.

@lithdk
Copy link

lithdk commented Dec 5, 2023

Had the same issue, although all apps were slow. I got it fixed but dont know what the issue is:

I started with a fresh download of 23.10 desktop in a VM.

Do the setup steps:
Update, dist-upgrade, reboot, installed libpam-aad, libnss-aad and aad-cli. Enable the pam mkhomedir option.
Set /etc/aad.conf tenant_id, app_id and homedir to /home/%u.

Logout and login as my AAD user. Notice everything is very slow. Reboot.
Everything is still slow, like painfully slow. Most of the time I cant even open stuff, like the terminal wont open at all.

Logged into local account again, and everything was working fine, so it's not a resource issue. I tried disabling security defaults in AAD to get rid of MFA since I was seeing some "interrupted" attempts in the sign-in logs in Azure, but this did not help. Created a fresh non-admin user just to confirm, still slow.

Renabled security defaults, created a new testuser, changed /etc/aad.conf. Commented out my homedir = /home/%u (so now its %f as it's the default). Now everything is working just fine on my test user. Login as my main user, still a problem. Delete passwd.db file, login again, still slow but I got the "correct" homedir with my userprincipalname now.

Reinstall Ubuntu, do all the setup steps again without setting the homedir in /etc/aad.conf. Login with my main user, still slow. Create new test user, login with that, works fine.

So I dont know what is causing it, but I assume it might be because my main user is an administrator in AAD. I'm not about to remove that, it's too late and I don't want to make a mistake and lock myself out.

@ruben-herold
Copy link

@jamesps-ebi @denisonbarbosa @lithdk @turowicz could be the same problem like in #441

JOT85 added a commit to JOT85/aad-auth that referenced this issue Apr 23, 2024
aad-auth assigns users to UIDs which are too large for some common software.

There are many reports of this problem, notably relating to
xdg-desktop-portal-gnome not working:

- In ubuntu#278, screensharing does not work
  because the portal is not loaded.
  - We have also had this problem.
- In ubuntu#200, applications take
  excessively long to open.
  - We have experienced this issue with a variety of apps, including the
    nmapplet, gnome-terminal, and chromium.
- In ubuntu#441 brings up exactly this issue,
  but hasn't had a response.

Adding a `min_uid` and `max_uid` configuration option allows the user to specify
the range in which UIDs should be generated, thereby enabling admins to cap the
UIDs at a range which works with most software.

To prevent existing installations from changing their behaviour, the default
values, when the parameters aren't specified in the configuration file, remain
at `100000` and `math.MaxUint32`, however the config template now explicitly
sets the values to values which play nicely with xdg-desktop-portal-gnome, in an
attempt to give new users a better experience.

Also, when a collision is found, instead of only incrementing the UID, which may
overflow and end up as UID 0 (root!!!), we instead wrap around only within the
specified range.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working jira Sync to jira medium
Projects
None yet
Development

No branches or pull requests

8 participants