Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Netwoking issues after emerge -e @world
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Sun Apr 16, 2023 6:04 am    Post subject: Netwoking issues after emerge -e @world Reply with quote

Hi,

I had a fully working, nice system, and just had to do an emerge -e @world...

I somewhat regret that now, but I'll will learn from this, I'm sure.

Problem
I am not sure why, but regularly a duplicate network configuration is created. During this moment, connectivity is lost, then reconnected. I can see an error stating
Code:
Connection failed - Activation of network connection failed


Digging around I found this config
Code:
cat /etc/conf.d/NetworkManager
# If NetworkManager does not establish a connection within $INACTIVE_TIMEOUT
# seconds after starting, the service will be marked as inactive, and it will
# continue to wait for a connection in background mode.
INACTIVE_TIMEOUT=1
which seem to match the above quite well.

Unsure if related (or if it even could be) sound volume is automagically lowering itself, at times quickly, other times very slow or best case, not at all. Very peculiar (and a bit impractical)

Network seems to work, mostly, but clearly indicates something is up. Please help me find it. I have no special configurations, just using Network Manager in Gnome.

Thanks
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Wed Apr 19, 2023 3:48 am    Post subject: Reply with quote

No one at all? Will I have to live with this instability, or is this one of those non-recoverable errors?

There must be some configurations that can be looked through, right?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4125
Location: Bavaria

PostPosted: Wed Apr 19, 2023 10:14 am    Post subject: Reply with quote

G3nt00,

an "emerge -e @world" re-emerges all installed packages (you surely know) and DONT change any settings / configuration files ... BUT ... of course ... every default configuration file you have in most packages will be installed also => as _configfile ! After your emerge is done you will get a message from portage saying you have now xx new config-files. If you dont take over the new (=default) configuration file THEN nothing has changed in your setting.

If now your network doesnt work, then you probably have changed some config files. So, you must do the same with your networking as you did in your first installation: Questions would be:

- wired ethernet or wifi or both ?
- interface configured in kernel ? (=> "lspci -k")
- using netifrc or networkmanager ?
- using dhcp or static ip addresses ?
- using systemd or openrc ? (because of start runscript)



BTW: Sometimes it is senseful to compile your whole system. For example we had a change between gcc 11 and gcc 12 and had new USE-flags for gcc 12.1: "default-stack-clash-protection" and "default-znow". Enabling these use-flags will change only new compiled applications but not the old ones ... so I did:

1. emerge -1 gcc
2. emerge -1 glibc
(reboot)
3. emerge -ev -X gcc -X glibc -X gentoo-sources -X linux-headers -X linux-firmware -X intel-microcode -X baselayout @world

(you see, it is not necessary to re-compile all packages; in baselayout you have MANY configuration files ... ;-) )
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Wed Apr 19, 2023 3:43 pm    Post subject: Reply with quote

All errors are recoverable with sufficient determination. However, NetworkManager is a complex beast that some readers do not use at all. I am one of those, so if we assume that NetworkManager is at fault here, there is nothing I can do for you. Answering pietinger would be a good start. Seeing actual system logs of the event might help too.
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Wed Apr 19, 2023 4:00 pm    Post subject: Reply with quote

pietinger wrote:
G3nt00,

an "emerge -e @world" re-emerges all installed packages (you surely know) and DONT change any settings / configuration files ... BUT ... of course ... every default configuration file you have in most packages will be installed also => as _configfile ! After your emerge is done you will get a message from portage saying you have now xx new config-files. If you dont take over the new (=default) configuration file THEN nothing has changed in your setting.

If now your network doesnt work, then you probably have changed some config files. So, you must do the same with your networking as you did in your first installation: Questions would be:

- wired ethernet or wifi or both ?
- interface configured in kernel ? (=> "lspci -k")
- using netifrc or networkmanager ?
- using dhcp or static ip addresses ?
- using systemd or openrc ? (because of start runscript)



BTW: Sometimes it is senseful to compile your whole system. For example we had a change between gcc 11 and gcc 12 and had new USE-flags for gcc 12.1: "default-stack-clash-protection" and "default-znow". Enabling these use-flags will change only new compiled applications but not the old ones ... so I did:

1. emerge -1 gcc
2. emerge -1 glibc
(reboot)
3. emerge -ev -X gcc -X glibc -X gentoo-sources -X linux-headers -X linux-firmware -X intel-microcode -X baselayout @world

(you see, it is not necessary to re-compile all packages; in baselayout you have MANY configuration files ... ;-) )

Thanks!

pietinger wrote:

- wired ethernet or wifi or both ?
- interface configured in kernel ? (=> "lspci -k")
- using netifrc or networkmanager ?
- using dhcp or static ip addresses ?
- using systemd or openrc ? (because of start runscript)

Well, good thing (I think) is that networking works, mostly, but keeps adding a 2nd interface for unknown reason using the same config as the one in use...

I use
- Wired, compiled-in NIC support, NetworkManager, DHCP and Systemd.

I did notice it wanting to install new config files, basically eradicate my config, but I kept all of the once I were asked about at least, and yes, learned a lesson here. I just took for granted a recompile would only do good, which I'm sure is the most usual outcome too, not for me though, even though it's not half as bad as it could have been... :)
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Wed Apr 19, 2023 4:04 pm    Post subject: Reply with quote

Hu wrote:
All errors are recoverable with sufficient determination. However, NetworkManager is a complex beast that some readers do not use at all. I am one of those, so if we assume that NetworkManager is at fault here, there is nothing I can do for you. Answering pietinger would be a good start. Seeing actual system logs of the event might help too.

Sounds wise. At times I opted out of Network Manager too, not on Gentoo though. In early days running Debian it wasn't even invented.. :) Then it was fine using command line and edit files manually. Almost felt somewhat in control short moments then... :lol:
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 297

PostPosted: Wed Apr 19, 2023 5:50 pm    Post subject: Reply with quote

You could check /etc/NetworkManager/system-connections/ to see how many files are there. The files will have '.nmconnection' as a file extension. I have two, one for wired and one for wireless. You can also open these files with a text editor of your choice to check for sanity. If you have duplicate files for the wired connection for example, try moving them one at a time to see if that fixes the issue. You can always move them back if needed. As a last resort, you could move all of them to another location temporarily. This will allow you to then configure new connections in the Network Manager application or applet (only do this after rebooting the system).
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Wed Apr 19, 2023 7:09 pm    Post subject: Reply with quote

rab0171610 wrote:
You could check /etc/NetworkManager/system-connections/ to see how many files are there. The files will have '.nmconnection' as a file extension. I have two, one for wired and one for wireless. You can also open these files with a text editor of your choice to check for sanity. If you have duplicate files for the wired connection for example, try moving them one at a time to see if that fixes the issue. You can always move them back if needed. As a last resort, you could move all of them to another location temporarily. This will allow you to then configure new connections in the Network Manager application or applet (only do this after rebooting the system).

Great suggestion! I believe this was a finding of sorts! Without knowing what it is I'd guess some sort of leftover from when I aborted emerge...
Code:
ls -la /etc/NetworkManager/system-connections/
total 12
drwxr-xr-x 2 root root 4096 16 apr 06.39 .
drwxr-xr-x 4 root root 4096  9 apr 18.39 ..
-rw------- 1 root root  265 16 apr 06.39 enp3s0.nmconnection
-rw------- 1 root root    0 16 apr 00.10 .keep_net-misc_networkmanager-0

as it was empty I just removed it. Lets see what happens
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Fri Apr 21, 2023 10:33 am    Post subject: Reply with quote

rab0171610 wrote:
As a last resort, you could move all of them to another location temporarily. This will allow you to then configure new connections in the Network Manager application or applet (only do this after rebooting the system).

This was odd. When doing a 'ip a' I had two IP addresses assigned to "enp3s0". So I thought I'd clear all config as suggested, and having done that, a new config was automatically entered...? So the strange issue with the extra IF is not yet resolved it seems. I have no clue what to do next. Anywhere else I can look for some related config? Is there any mechanism that would automatically add a network interface, fully configured and working at that...

And even with all interfaces "disabled" I have connectivity, so there is clearly an issue here.

Please help me get rid of Network Manager and configure the IP manually instead... I'm reading https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking#Manual_network_configuration, but have yet to find where the config files are?

Edit: Found this https://wiki.gentoo.org/wiki/Systemd#Networkand have created the files I believe I need for a static IP. But how #¤%& do I get rid of Network Manager? I tried removing it, but as it has loads of dependencies, it has eluded me so far...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Fri Apr 21, 2023 3:29 pm    Post subject: Reply with quote

emerge --ask --verbose --depclean net-misc/networkmanager. When that fails due to things depending on it, adjust the USE flags on those things not to depend on it, or add them to the --depclean line to remove them, too. Eventually, you will have removed both NetworkManager and the things that cause it to be immediately reinstalled.
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Fri Apr 21, 2023 5:03 pm    Post subject: Reply with quote

Hu wrote:
emerge --ask --verbose --depclean net-misc/networkmanager. When that fails due to things depending on it, adjust the USE flags on those things not to depend on it, or add them to the --depclean line to remove them, too. Eventually, you will have removed both NetworkManager and the things that cause it to be immediately reinstalled.

Thank you! I know there's always a risk, but will this likely break something (other than possibly dependencies)? Also, before I dare try, when I shut down and also disabled NM, Gnome did not let me logon, but showed a grey screen about network being broken. How can I avoid that? At the same time the network tab in settings was gone too...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Fri Apr 21, 2023 5:20 pm    Post subject: Reply with quote

According to the manual, emerge --depclean can only remove things for which nothing depends on it in a package management sense. Therefore, while you might find some program has gone missing, you cannot enter a state where a program fails to load due to missing libraries.

I don't know why GNOME broke when your network was down. I do not use GNOME, because its developers too often break things I want to have working. My preferred environment works fine with the network down. Accordingly, I have no Settings application in which to lose a Network tab. I manage my network through the command line.
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Sun Apr 23, 2023 10:43 am    Post subject: Reply with quote

Hu wrote:
emerge --ask --verbose --depclean net-misc/networkmanager. When that fails due to things depending on it, adjust the USE flags on those things not to depend on it, or add them to the --depclean line to remove them, too. Eventually, you will have removed both NetworkManager and the things that cause it to be immediately reinstalled.

I tried this now, and got the following response;
Code:
emerge --ask --verbose --depclean net-misc/networkmanager

Calculating dependencies... done!
  net-misc/networkmanager-1.42.2 pulled in by:
    app-misc/tracker-miners-3.4.3 requires net-misc/networkmanager
    dev-qt/qtnetwork-5.15.8-r1 requires net-misc/networkmanager
    gnome-base/gnome-control-center-43.4.1 requires >=net-misc/networkmanager-1.24.0[modemmanager]
    gnome-base/gnome-settings-daemon-43.0 requires >=net-misc/networkmanager-1.0
    gnome-base/gnome-shell-43.3 requires >=net-misc/networkmanager-1.10.4[introspection]
    gnome-extra/nm-applet-1.30.0-r2 requires >=net-misc/networkmanager-1.16:=, >=net-misc/networkmanager-1.16:0/0=
    net-libs/libnma-1.10.6-r1 requires >=net-misc/networkmanager-1.7[introspection]
    net-libs/libproxy-0.4.18 requires net-misc/networkmanager

Did you mean I need to go through all apps listed and basically set "USE=-networkmanager" for all of them? (and hope it will do it)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Sun Apr 23, 2023 3:45 pm    Post subject: Reply with quote

That would be one solution, yes. However, you could change all the entries at once, or just remove everything on the list.

Since you are determined to remove NetworkManager, it seems more expedient to disable USE=networkmanager globally, rather than write specific entries for each package. Therefore, you could add to /etc/portage/package.use the text:
/etc/portage/package.use:
*/* -networkmanager
Then run emerge --ask --verbose --changed-use '>=app-misc/tracker-miners-3.4.3' '>=dev-qt/qtnetwork-5.15.8-r1' '>=gnome-base/gnome-control-center-43.4.1' '>=gnome-base/gnome-settings-daemon-43.0' '>=gnome-base/gnome-shell-43.3' '>=gnome-extra/nm-applet-1.30.0-r2' '>=net-libs/libnma-1.10.6-r1' '>=net-libs/libproxy-0.4.18' to rebuild those packages for which the USE change is effective. Next, run emerge --ask --verbose --depclean net-misc/networkmanager again. If the USE change successfully made all those packages not depend on NetworkManager, the --depclean will succeed. It is possible to check through static inspection whether the rebuild will affect all those packages, but in the interest of a generic post, I leave static inspection to the reader. If any of them still depend on NetworkManager, then add their names to the --depclean line. If other things depend on those, add their names too. Continue iterating until either it succeeds or you are asked to remove something you want to keep.
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Tue Apr 25, 2023 6:29 am    Post subject: Reply with quote

Hu wrote:
That would be one solution, yes. However, you could change all the entries at once, or just remove everything on the list.

Since you are determined to remove NetworkManager, it seems more expedient to disable USE=networkmanager globally, rather than write specific entries for each package. Therefore, you could add to /etc/portage/package.use the text:
/etc/portage/package.use:
*/* -networkmanager
Then run emerge --ask --verbose --changed-use '>=app-misc/tracker-miners-3.4.3' '>=dev-qt/qtnetwork-5.15.8-r1' '>=gnome-base/gnome-control-center-43.4.1' '>=gnome-base/gnome-settings-daemon-43.0' '>=gnome-base/gnome-shell-43.3' '>=gnome-extra/nm-applet-1.30.0-r2' '>=net-libs/libnma-1.10.6-r1' '>=net-libs/libproxy-0.4.18' to rebuild those packages for which the USE change is effective. Next, run emerge --ask --verbose --depclean net-misc/networkmanager again. If the USE change successfully made all those packages not depend on NetworkManager, the --depclean will succeed. It is possible to check through static inspection whether the rebuild will affect all those packages, but in the interest of a generic post, I leave static inspection to the reader. If any of them still depend on NetworkManager, then add their names to the --depclean line. If other things depend on those, add their names too. Continue iterating until either it succeeds or you are asked to remove something you want to keep.

This worked nicely. Just to not mess this up - What would the minimal I need have be to be able to reconnect? Thanks
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Tue Apr 25, 2023 2:46 pm    Post subject: Reply with quote

The combination of net-misc/netifrc sys-apps/iproute2 sys-apps/openrc sys-apps/baselayout net-misc/dhcpcd works for me. No NetworkManager involved. On systems that use wireless, I also need net-wireless/wpa_supplicant. If you want truly minimal, you could remove dhcpcd and replace it with static configuration. However, this is notably less flexible, and moving to new networks will be more trouble.
Back to top
View user's profile Send private message
G3nt00
Guru
Guru


Joined: 09 Apr 2023
Posts: 337

PostPosted: Tue Apr 25, 2023 4:34 pm    Post subject: Reply with quote

Hu wrote:
The combination of net-misc/netifrc sys-apps/iproute2 sys-apps/openrc sys-apps/baselayout net-misc/dhcpcd works for me. No NetworkManager involved. On systems that use wireless, I also need net-wireless/wpa_supplicant. If you want truly minimal, you could remove dhcpcd and replace it with static configuration. However, this is notably less flexible, and moving to new networks will be more trouble.

Thanks, this was a trip of sorts...I was also messing with a switch so lost my IP along the way so incredibly glad portage keeps it's tree local... :) I ended up with NM for now again, but will retry this soon. Thanks a lot for good advice and help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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