Authorization required, but no authorization protocol specified

I have just recently installed TW. And I noticed that many of my apps are starting very slow (and I mean like sometimes they take like an entire minute to launch).

Specifically, I noticed this most with Firefox and Thunar. So I started these apps in the terminal to find out if they were spitting out any errors and they both hang on an error:

Authorization required, but no authorization protocol specified

I’ve done my googling and the solution to this is all over the place. There are some that say that there’s a package you need to install, some posts here on the forum talk about xhost, another said to delete the .Xauthority file (Which I did, but it did not work), and several other “solutions.”

I looked in .xession-errors, and I’m getting some xlib errors. What follows is just some of them.

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Jun 23 02:30 : exception: Failed to bind to '127.0.0.1:6600'; Failed to bind socket: Address already in use
Authorization required, but no authorization protocol specified


(process:8793): GLib-CRITICAL **: 02:31:03.441: g_string_insert_len: assertion 'len == 0 || val != NULL' failed
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Authorization required, but no authorization protocol specified

ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Authorization required, but no authorization protocol specified

ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 146
Xlib: ignoring invalid extension event 146
Authorization required, but no authorization protocol specified

Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Authorization required, but no authorization protocol specified

Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
Authorization required, but no authorization protocol specified

Xlib: ignoring invalid extension event 161
Xlib: ignoring invalid extension event 161
[174 02:36:08.261918] [PARSE ERROR] Unknown char after ESC: 0x6b
[174 02:36:08.261948] [PARSE ERROR] Unknown char after ESC: 0x5c
[174 02:36:21.087724] [PARSE ERROR] Unknown char after ESC: 0x6b
[174 02:36:21.087769] [PARSE ERROR] Unknown char after ESC: 0x5c

I also noticed when I tried to launch LibreOffice, I got some dbus errors in addition to the errors above:

org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

Authorization required, but no authorization protocol specified

ror:org.freedesktop.DBus.Error.TimedOut: Failed to activate service 'org.freedesktop.portal.Desktop': timed out (service_start_timeout=120000ms)

Again, these are just some of the errors surrounding the Authorization required lines. If needbe I can post the full logs.

I have no idea how to solve this. Like I said, the “solutions” are all over the place.

Any help would be mightily appreciated.

Matt

What does the following command report?

loginctl show-session $XDG_SESSION_ID

If you create another user, and then login as that user, is the issue still apparent?

Also examine/capture

journalctl --user -b

Post the output here.

This is the output of that command. I will try creating a new user.

User=1000
Name=matt
Timestamp=Fri 2023-06-23 02:55:56 EDT
TimestampMonotonic=13394961
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=lightdm
Desktop=dwm
Scope=session-3.scope
Leader=1592
Audit=3
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no```

So I created a new user and it was indeed not happening in the new user space.

But it also fixed it for my established user.

shrugs

I’m so much more confused now, but at least it’s working properly. Just for reference I ran that command again.

User=1000
Name=matt
Timestamp=Fri 2023-06-23 11:33:23 EDT
TimestampMonotonic=31060193290
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=lightdm
Desktop=dwm
Scope=session-17.scope
Leader=21162
Audit=17
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no

To me it looks like the only two things that changed were the Leader and Audit lines. Not sure what that means.

Thanks for your help.

Okay, the problem is back, and I have no clue what to do next. The only thing that has changed since it was “fixed” and now is that I installed dk window manager and used that for a while. Nothing, I’d think that would cause this error to keep popping up:

Authorization required, but no authorization protocol specified

It makes everything so slow to launch. From a friend I’ve been told to do something with xhost + local:
but putting that in my .bashrc does nothing, except spit out the error above every time I open a terminal.

Any help would be greatly appreciated. This seems to be a problem a lot of people face, but there are many different solutions, and none seem to work for me.

You didn’t share the journal log as requested.

sorry missed that comment.

…goes to run journalctl and gets this error:

Authorization required, but no authorization protocol specified

Okay after some finagling, I did manage to get a few lines, but it will not work with xclip, so some things are cut off.

`

Jun 23 21:50:14 ares.lan sudo[2193]:     matt : TTY=pts/0 ; PWD=/home/matt ; USER=root ; COMMAND=/usr/bin/zypper in htop
Jun 23 21:50:14 ares.lan sudo[2193]: pam_unix(sudo:session): session opened for user root(uid=0) by matt(uid=1000)
Jun 23 21:50:17 ares.lan xdg-desktop-por[1964]: Failed to create settings proxy: Error calling StartServiceByName for org.freedesktop.impl.port>
Jun 23 21:50:17 ares.lan xdg-desktop-por[1964]: No skeleton to export
Jun 23 21:50:18 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Activating via systemd: service name='org.a11y.Bus' unit='at-spi-dbus-b>
Jun 23 21:50:18 ares.lan systemd[1701]: Starting Accessibility services bus...
Jun 23 21:50:18 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Successfully activated service 'org.a11y.Bus'
Jun 23 21:50:18 ares.lan systemd[1701]: Started Accessibility services bus.
Jun 23 21:50:18 ares.lan systemd[1701]: Started PipeWire Multimedia Service.
Jun 23 21:50:18 ares.lan systemd[1701]: Started Multimedia Service Session Manager.
Jun 23 21:50:18 ares.lan systemd[1701]: Started PipeWire PulseAudio.
Jun 23 21:50:18 ares.lan wireplumber[2338]: Failed to get percentage from UPower: org.freedesktop.DBus.Error.NameHasNoOwner
Jun 23 21:50:23 ares.lan wireplumber[2338]: <WpSiAudioAdapter:0x558001358860> Object activation aborted: proxy destroyed
Jun 23 21:50:23 ares.lan wireplumber[2338]: <WpSiAudioAdapter:0x558001358860> failed to activate item: Object activation aborted: proxy destroy>
Jun 23 21:50:23 ares.lan wireplumber[2338]: <WpPortalPermissionStorePlugin:0x5580011991b0> Failed to call Lookup: GDBus.Error:org.freedesktop.p>
Jun 23 21:50:23 ares.lan wireplumber[2338]: <WpPortalPermissionStorePlugin:0x5580011991b0> Failed to call Lookup: GDBus.Error:org.freedesktop.p>
Jun 23 21:50:23 ares.lan sudo[2193]: pam_unix(sudo:session): session closed for user root
Jun 23 21:50:30 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs->
Jun 23 21:50:30 ares.lan systemd[1701]: Starting Virtual filesystem metadata service...
Jun 23 21:50:30 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Successfully activated service 'org.gtk.vfs.Metadata'
Jun 23 21:50:30 ares.lan systemd[1701]: Started Virtual filesystem metadata service.
Jun 23 21:50:42 ares.lan xdg-desktop-por[1964]: Failed to create file chooser proxy: Error calling StartServiceByName for org.freedesktop.impl.>
Jun 23 21:50:42 ares.lan xdg-desktop-por[1964]: No skeleton to export
Jun 23 21:51:07 ares.lan xdg-desktop-por[1964]: Failed to create app chooser proxy: Error calling StartServiceByName for org.freedesktop.impl.p>
Jun 23 21:51:07 ares.lan xdg-desktop-por[1964]: No skeleton to export
Jun 23 21:51:22 ares.lan sudo[4581]:     matt : TTY=pts/0 ; PWD=/home/matt ; USER=root ; COMMAND=/usr/bin/zypper in xclip
Jun 23 21:51:22 ares.lan sudo[4581]: pam_unix(sudo:session): session opened for user root(uid=0) by matt(uid=1000)
Jun 23 21:51:22 ares.lan systemd[1701]: xdg-desktop-portal.service: start operation timed out. Terminating.
Jun 23 21:51:22 ares.lan systemd[1701]: xdg-desktop-portal.service: Failed with result 'timeout'.
Jun 23 21:51:22 ares.lan systemd[1701]: Failed to start Portal service.
Jun 23 21:51:23 ares.lan sudo[4581]: pam_unix(sudo:session): session closed for user root
Jun 23 21:51:52 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Failed to activate service 'org.freedesktop.portal.Desktop': timed out >
Jun 23 21:51:52 ares.lan dbus-daemon[1734]: [session uid=1000 pid=1734] Failed to activate service 'org.freedesktop.impl.portal.desktop.gtk':

SO either a portal problem or dbus.

Are both user accounts affected?

No, just my main one.

Also that one line there in journalctl, about xdg-desktop-portal.service I tried
systemctl status xdg-desktop-portal.service and it says not found, which is also odd.

I switch hed to another xdg portal (kde) and that did nothing to solve the issue.

Okay, so moving the existing .Xauthority file to a placeholder file then rebooting then moving that same .Xauthority file back to where it should be from the place holder (essentially moving the file from one place to another with a reboot in between) fixed the problem again.

This is the most … I don’t even know how to explain it. What is even going on, because there is only one line in that file. It is the same file now, when the system is working as it was a few minutes ago when it was giving me that error and all the apps were slow to launch.

This makes no sense. Maybe (probably), I’m missing something.

Maybe compare output for first and second user accounts

systemctl --user --type=service

Show

env | grep XAUTH
xauth list

For the first one:


XAUTHORITY=/home/matt/.Xauthority
XAUTHLOCALHOSTNAME=ares.lan

For the second:

ares.lan/unix:0 MIT-MAGIC-COOKIE-1 514cb29d724f0f658d8ca019757f621d

@thelinuxcast
Did you figure out a solution for this? I was playing arround with a few of fresh installs using different DEs and also had this issue with xfce/lightdm. Gnome for example was working fine. I still decided to go with xfce and got arround the issue by installing another display manager. So I think it might be caused by lightdm somehow.

I don’t think for me it was caused by the display manager, because I was getting it while installing programs.

To fix, I put this in my autostart file.

xhost +si:localuser:$USER &

You could probably do a systemd service for it, but IDK.

I had same problem. It seems to be solved here:

(Authority file was deleted by systemd-tmpfiles-clean.service)

I solved mine with

xhost +si:localuser:$USER &

at startup.

Not sure if it was proper or not, but it worked.

(guess I had already put this here. oops)