Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't Open Applications After Connecting to Network [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
paintchip
n00b
n00b


Joined: 02 Jan 2010
Posts: 57

PostPosted: Mon Jul 18, 2022 10:29 am    Post subject: Can't Open Applications After Connecting to Network [SOLVED] Reply with quote

As the title says, I think I caused an issue where after connecting to a WiFi network, applications, settings, etc. don't launch. Any help is appreciated because I can't find the connection here. Also, I'm using KDE, if it matters.

It started after I tried to get NetworkManager to use dnscrypt-proxy instead of the router provided DNS settings. This setup worked before on previous routers, so I don't think it's dnscrpyt (or from the router, which worked fine as well without trying to use dnsproxy).

While reading the Arch wiki I attempted to stop NM from updating resolve.conf by running
Code:
sudo chattr +i /etc/resolv.conf

I noticed things not launching after that. I tried reversing the changes by running
Code:
sudo chattr -i /etc/resolv.conf
and even by removing the file and remaking it. None of it has worked.

Everything seems to work normally until after I connect to a network (I've tried more than one). I can also switch terminals with Ctrl + Alt + F2, run startx, and the second session works normally, all of the applications launch.

While launching applications from the terminal, I get the following errors. I've looked them up, but I can't find any connection to NetworkManager.

Firefox:
Code:
Authorization required, but no authorization protocol specified

Error: cannot open display: :0


Dolphin:
Code:
Authorization required, but no authorization protocol specified

qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, offscreen, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted


Last edited by paintchip on Tue Jul 19, 2022 10:05 am; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon Jul 18, 2022 11:00 am    Post subject: Reply with quote

Are you accessing your system remotely somehow?
_________________
:)
Back to top
View user's profile Send private message
paintchip
n00b
n00b


Joined: 02 Jan 2010
Posts: 57

PostPosted: Mon Jul 18, 2022 12:31 pm    Post subject: Reply with quote

Thanks for the reply. No. This is all local. Possibly related, I don't use a DM and start KDE with startx and this command in my.xinitrc
Code:
exec dbus-launch --sh-syntax --exit-with-session startplasma-x11

That's been working for a while, though.

Edit: I also tired logging out of the initial KDE session and having startx start a new one. Applications launched after that, even if I disconnected and reconnected to different networks. I did have to logout using the CLI, though. The buttons didn't work, just like the applications.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon Jul 18, 2022 12:48 pm    Post subject: Reply with quote

Do you have a file
Code:

~/.Xauthority

Try reemerging
Code:

emerge -1av xauth

But the reason why this happens after connecting to a wifi is a mystery.
Do you have elogind and dbus running?
Is your user member of audio and video groups?
_________________
:)
Back to top
View user's profile Send private message
paintchip
n00b
n00b


Joined: 02 Jan 2010
Posts: 57

PostPosted: Mon Jul 18, 2022 1:14 pm    Post subject: Reply with quote

Thanks for the suggestions

I reemerged xauth, but it didn't fix it. I do have a .Xauthority file and it is populated with info.

dbus is running, but strangely, elogind shows as stopped. If I try to start it, it complains that elogind is already running. None of those services change states from when applications are launching and not launching, though.

My user is also in the audio and video groups
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21715

PostPosted: Mon Jul 18, 2022 2:13 pm    Post subject: Reply with quote

What is the output of hostname before and after you connect to a bad network? My guess is that your hostname is being updated as part of joining the new network. Your Xorg MIT auth cookie is hostname-locked, so changing the hostname prevents use of the old cookie. Starting a new X session under your new hostname generates a new cookie, locked to your new hostname, which works until you change networks (and therefore hostname) again.

This pops up a few times a year, though more commonly on new installs rather than someone who had a working setup, changed something, and suffered a mysterious break.
Back to top
View user's profile Send private message
paintchip
n00b
n00b


Joined: 02 Jan 2010
Posts: 57

PostPosted: Mon Jul 18, 2022 5:06 pm    Post subject: Reply with quote

That's exactly what's happening. Before I connect to a network the hostname matches what I have in /etc/hostname. After I connect to any network it changes to localhost.localdomain. What I don't get is how or why it started changing or how to get NM to stop. From the few posts I just read the problem was in /etc/hostname or /etc/conf.d/hostname. Both of these are set correctly for me. I also don't see that option anywhere in the NM settings.

I'll keep searching.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon Jul 18, 2022 9:03 pm    Post subject: Reply with quote

OK I think i found it it for you.
Plz edit
Code:

/etc/NetworkManager/NetworkManager.conf -->>

[main]
hostname-mode=none

and restart NM.
According to
Code:

man 5 NetworkManager.conf

Quote:

hostname-mode
Set the management mode of the hostname. This parameter will affect only the transient hostname. If a
valid static hostname is set, NetworkManager will skip the update of the hostname despite the value of
this option. An hostname empty or equal to 'localhost', 'localhost6', 'localhost.localdomain' or
'localhost6.localdomain' is considered invalid.

default: NetworkManager will update the hostname with the one provided via DHCP or reverse DNS lookup of
the IP address on the connection with the default route or on any connection with the property
hostname.only-from-default set to 'false'. Connections are considered in order of increasing value of
the hostname.priority property. In case multiple connections have the same priority, connections
activated earlier are considered first. If no hostname can be determined in such way, the hostname will
be updated to the last one set outside NetworkManager or to 'localhost.localdomain'.

dhcp: this is similar to 'default', with the difference that after trying to get the DHCP hostname,
reverse DNS lookup is not done. Note that selecting this option is equivalent to setting the property
'hostname.from-dns-lookup' to 'false' globally for all connections in NetworkManager.conf.

none: NetworkManager will not manage the transient hostname and will never set it.


So apparently you have not set a proper hostname probably just "localhost"
It would be good to set a full FQDN even if it is a bogus one.
Maybe something like
Code:

my-machine.my-bogus-internal.domain

Then all machines in your lan can share this internal domain.

Thanks Hu for pointing out this hostname thing.
:)
_________________
:)
Back to top
View user's profile Send private message
paintchip
n00b
n00b


Joined: 02 Jan 2010
Posts: 57

PostPosted: Tue Jul 19, 2022 10:03 am    Post subject: Reply with quote

Thanks for the reply. I had found that, but still ran into issues. My hostname was unique, but did contain an underscore, which I read can cause promblems. Also, the /etc/NetworkManager/NetworkManager.conf file didn't exist and creating it with the lines you provided didn't originally work.

I'm not sure which of the following fixed it, but I removed the underscore from the hostname in both /etc/hostname and /etc/conf.d/hostname, created the NetworkManager.conf file and added hostname-mode=none line under [main], and then actually restarted the machine (restarting NM didn't seem to work with a bunch of attempts).

The combination of the above solved the issue! Thanks a ton for all of the help, guys. I really appreciate it.

https://wiki.gentoo.org/wiki/NetworkManager
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum