View previous topic :: View next topic |
Author |
Message |
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Sun Aug 14, 2022 1:13 pm Post subject: [Solved] wlan0 sometimes not found at startup |
|
|
I have a very weird problem where I have no idea how to debug it. I put the topic in Network & Security since the network part is the most obvious thing that I'd like to fix.
I'm using xfce with lightdm as my display manager. My init system is OpenRC. For probably now a year or so, I've been having problems with my network sometimes not going up correctly at boot, but I was able to just start the services manually when that happened and everything went fine. I then tried to fix it and played around with it and in the end had a manual setup with wpa_supplicant and dhcpcd consistently starting at boot.
I recently thought, that I'd like a setup where my network is managed by netifrc again and hoped my problem would not occur anymore. After I completed the setup everything works fine, however, at boot sometimes the network and then all the depending services won't start again.
OpenRC then shows me:
Code: | * Bringing up interface wlan0
* Caching network module dependencies
* ERROR: interface wlan0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.wlan0 failed to start |
After I log in I can just start the service without any problems, however, so it's very likely that it exists. I read that a rename of the device or something like that could be happening, but I didn't find anything related to that in the dmesg output.
A weird, seemingly unrelated problem I also have is that my keyboard layout is sometimes wrong in the greeter. My whole xrandr setup -- so that it's correct in the greeter as well -- is in the lightdm display-setup-script and there I also set the keyboard layout with setxkbmap. However, this seems to be overwritten sometimes or something like that. It doesn't bother me too much, since I then have the same setxkbmap command in my .xinitrc so I just need to be able to write my password in both layouts.
Why am I even mentioning this problem? Well... I always know when I need to manually start my network after logging in, because that's also when my keyboard layout is wrong in the greeter. So these problems seem connected for whatever reason.
I could also somehow imagine, that the network isn't starting because maybe the system sometimes takes longer to detect the USB wifi interface? I wanted to add a pause to OpenRC to test this theory but I couldn't find anything and I still hope the cause is something that could also explain my keyboard layout problem.
Does anybody have any idea? How can I make any progress towards solving my problem? Which logs do I need to provide?
Thanks in advance!
Last edited by outtay on Sun Sep 04, 2022 10:05 am; edited 1 time in total |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3343 Location: Rasi, Finland
|
Posted: Tue Aug 16, 2022 8:40 pm Post subject: |
|
|
Wild guess, your OpenRC is set to start services in parallel? Because your problems do sound like race condition.
If so, then set rc_parallel="NO" on your /etc/rc.conf.
EDIT: You may specify rc_interactive="YES" there too to make OpenRC pause and ask if you want to start each service. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Wed Aug 17, 2022 8:46 am Post subject: |
|
|
Thanks!
I have experimented before with rc_parallel="YES" and when I first experienced the problem I commented the line again. So I would've though that I'm not starting in parallel anymore and ruled out that possibility.
However, I'm not sure what the default value for the variable is so I set it now explicitly to NO as per your suggestion.
I'll report back if the problem still persists.
Regarding the interactive option: I tried it once, but I couldn't get it to work. I think my keyboard is a bit on the slower side regarding the boot up process. I'll need to plug in a "dumb" keyboard the next time I see the problem to really test this. I fear, however, that then the problem will never show-up. Now that I think about it, maybe parallel was really set to YES, as that could've been the reason the interactive option didn't work.... I'll report back with my findings |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1531
|
Posted: Wed Aug 17, 2022 11:51 am Post subject: |
|
|
I'm not familiar with and I don't know if you can add dependency on the module loading service in OpenRC so that it finishes before anything else, but the following might help:
Compile your network driver in the kernel instead of as a kernel module. This way you won't need any services loading the module. That does not protect you against other race conditions though.
Regards,
Georgi |
|
Back to top |
|
|
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Thu Aug 18, 2022 9:15 pm Post subject: |
|
|
So changing the option to rc_parallel="NO" did unfortunately do nothing. I haven't checked trying to start interactively, I'll do so tomorrow (I hope).
Quote: | Compile your network driver in the kernel instead of as a kernel module. |
Hmmm... through make menuconfig I'm not able to do that. It's only letting me compile Ralink driver support and the drivers (RT2800_USB) as modules. I could set it in the .config file, but I'm a bit afraid that there's a reason make menuconfig doesn't allow me to do that. Quick googling didn't yield results, but I'm not sure what to look for. Does anybody have an idea?[/quote] |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4148 Location: Bavaria
|
Posted: Thu Aug 18, 2022 11:31 pm Post subject: |
|
|
outtay wrote: | Hmmm... through make menuconfig I'm not able to do that. It's only letting me compile Ralink driver support and the drivers (RT2800_USB) as modules. I could set it in the .config file, but I'm a bit afraid that there's a reason make menuconfig doesn't allow me to do that. |
Please DONT EDIT .config ... NEVER. Yes, you are right, there is a reason. It is easy to find:
Go into <Help> of your driver (RT2800USB) and you will see a short description AND dependencies (and also which modules will be also selected when enabling this module); a line similiar to this (from my config; I dont have it enabled):
Code: | Depends on: NETDEVICES [=y] && WLAN [=n] && WLAN_VENDOR_RALINK [=n] && RT2X00 [=n] && USB [=y] |
One (or more) of these dependencies is enabled as <M>odule and THEREFORE you can not enable this RT2800USB static into your kernel.
Change in dependent module from <M> to <*> and you should be able to configure RT2800USB also static |
|
Back to top |
|
|
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Sun Aug 21, 2022 1:34 pm Post subject: |
|
|
Thank you very much for that explanation!
I did not know that the dependencies also relate to the way these options would need to be compiled, or rather I never paid attention to it, but I mean... it makes sense ^^'
My drivers are now compiled into the kernel. I've also updated the kernel recently and cleaned up a few warnings I had gotten when starting my PC (they were minor, like my NTFS partition not mounting because it thought Windows wasn't shut down properly or that some modules weren't loaded).
The last few reboots have worked out, but I always had a few days of it randomly working, so I'm not sure it actually is working now.
What still never seems to work is rc_interactive. I press "I" at boot. I repeatedly press it, I hold it, I press where the "I" would be in my other keyboard layout as well, but openrc just normally starts all the services. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4148 Location: Bavaria
|
Posted: Sun Aug 21, 2022 2:57 pm Post subject: |
|
|
outtay wrote: | Thank you very much for that explanation! |
You are Welcome !
outtay wrote: | What still never seems to work is rc_interactive. I press "I" at boot. I repeatedly press it, I hold it, I press where the "I" would be in my other keyboard layout as well, but openrc just normally starts all the services. |
You know you must have set rc_parallel="NO" also ? |
|
Back to top |
|
|
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Sun Aug 21, 2022 7:54 pm Post subject: |
|
|
Quote: | You know you must have set rc_parallel="NO" also ? |
It seemed it wasn't ever rc_parallel="YES" to begin with. But yeah, I've been trying it while explicitly setting rc_parallel="NO" (and of course with rc_interactive="YES") and couldn't get it to work. I might need to try it on a virtual machine to see how the option behaves in a clean installation so that I can find out why it's not working for me. I'd guess it has something to do with my keyboard layout, but then it should work with one of the keys, and not with none.
Update:
Nevermind, I just got it working (in virtual machine and locally). No idea what I did wrong. At least now I have a tool to check it, if it happens again. I'll normally just have to wait a couple of reboots, but with my luck, now that I'm finally trying to fix it, it's probably weeks before it happens again ^^' |
|
Back to top |
|
|
outtay n00b
Joined: 11 Jun 2015 Posts: 13
|
Posted: Sun Sep 04, 2022 10:04 am Post subject: |
|
|
I haven't encountered the problem anymore.
For now I would regard this as solved, even though I'm not entirely sure, what the reason was and I still don't know how my keyboard layout and my network drivers are/were connected.
Still, thank you very much for your help! Appreciate it |
|
Back to top |
|
|
xavier10 Guru
Joined: 19 Jan 2004 Posts: 485 Location: Paris, France
|
Posted: Mon Sep 05, 2022 2:14 pm Post subject: Network fails to start |
|
|
I am running a Gentoo VM (under Qemu / UTM), that was working perfectly and now refuses to bring up network:
Code: |
$ /etc/init.d/net.eth0 restart
* Bringing up interface eth0
* ERROR: interface eth0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.eth0 failed to start
|
My "hardware" configuration has not changed. I am comparing the faulty instance with another VM on another computer that works perfectly with the very same settings so I am a little bit puzzled.
What would be the best way to troubleshoot the issue ? |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1531
|
Posted: Mon Sep 05, 2022 4:05 pm Post subject: Re: Network fails to start |
|
|
xavier10 wrote: | I am running a Gentoo VM (under Qemu / UTM), that was working perfectly and now refuses to bring up network:
Code: |
$ /etc/init.d/net.eth0 restart
* Bringing up interface eth0
* ERROR: interface eth0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.eth0 failed to start
|
My "hardware" configuration has not changed. I am comparing the faulty instance with another VM on another computer that works perfectly with the very same settings so I am a little bit puzzled.
What would be the best way to troubleshoot the issue ? |
What is the output of ifconfig -a?
Does this VM have iwd emerged?
Regards,
Georgi |
|
Back to top |
|
|
xavier10 Guru
Joined: 19 Jan 2004 Posts: 485 Location: Paris, France
|
Posted: Tue Sep 06, 2022 4:14 pm Post subject: |
|
|
Thanks for your reply, Georgi.
The output of ifconfig -a is:
Code: | enp0s6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fec0::1814:423:808:7830 prefixlen 64 scopeid 0x40<site>
inet6 fe80::aef2:d3c4:a160:a86a prefixlen 64 scopeid 0x20<link>
ether fa:e9:63:92:b5:61 txqueuelen 1000 (Ethernet)
RX packets 84406 bytes 69120521 (65.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 49275 bytes 5368478 (5.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 112 bytes 8352 (8.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 8352 (8.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sit0: flags=128<NOARP> mtu 1480
sit txqueuelen 1000 (IPv6-in-IPv4)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
I do not have iwd emerged in the VM. From what I understand iwd is specifically about wireless access, and the VM actually sees a virtual network interface through Qemu and the host. Qemu emulates a very generic, wired network interface Intel e1000 that is built into the kernel so the generic error message related to the loading of a module is also not relevant. |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1531
|
Posted: Tue Sep 06, 2022 5:00 pm Post subject: |
|
|
xavier10 wrote: | Thanks for your reply, Georgi.
The output of ifconfig -a is:
Code: | enp0s6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fec0::1814:423:808:7830 prefixlen 64 scopeid 0x40<site>
inet6 fe80::aef2:d3c4:a160:a86a prefixlen 64 scopeid 0x20<link>
ether fa:e9:63:92:b5:61 txqueuelen 1000 (Ethernet)
RX packets 84406 bytes 69120521 (65.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 49275 bytes 5368478 (5.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 112 bytes 8352 (8.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 8352 (8.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sit0: flags=128<NOARP> mtu 1480
sit txqueuelen 1000 (IPv6-in-IPv4)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
I do not have iwd emerged in the VM. From what I understand iwd is specifically about wireless access, and the VM actually sees a virtual network interface through Qemu and the host. Qemu emulates a very generic, wired network interface Intel e1000 that is built into the kernel so the generic error message related to the loading of a module is also not relevant. |
Your network adapter is enp0s6, this is a result of udev giving interfaces stable names. https://wiki.debian.org/NetworkInterfaceNames
Regards,
Georgi |
|
Back to top |
|
|
xavier10 Guru
Joined: 19 Jan 2004 Posts: 485 Location: Paris, France
|
Posted: Tue Sep 06, 2022 5:28 pm Post subject: |
|
|
Thanks, I will look into this. |
|
Back to top |
|
|
|