Boot delay after "Invoking start script newwanip" (boot takes about 13 minutes)

Started by Maarten, October 01, 2021, 01:06:48 PM

Previous topic - Next topic
Hi, it takes about 13 minutes for my router to boot up. This is the case for years now. I'm trying to find out how I can solve this, but I'm not sure where to start.

I've attached a screenshot of the part where it becomes really slow. (Red Arrows) Every line of "Reconfiguring IPv4 on ovpns" takes minutes to complete.

I've tried to boot with all openvpn server connections disabled. As expected the boot was fast. I've re-enabled the connections and the boot is slow again.

Is this a known issue?

[You need to be logged in to see the attached picture...]


[Edit 2021-10-28]
Apparently executing this command is taking a long time:

configctl interface newip ovpns5  (this is executed for every vpn server you've configured)

This command is fired from this script:
/usr/local/etc/rc.syshook.d/start/10-newwanip

I noticed the delay is there when you assign an interface to the vpn instance. If you remove the interface assignment there is no delay anymore. (but then your setup doesn't work of course)
[/Edit]



Quote from: yodaphone on October 02, 2021, 02:04:48 AM
I too have this issue..
Do you have any OpenVPN connections?

Quote from: Maarten on October 01, 2021, 01:06:48 PM
Hi, it takes a long time for my router to boot up. This is the case for years now. I'm trying to find out how I can solve this, but I'm not sure where to start.

I've attached a screenshot of the part where it becomes really slow. (Red Arrows) Every line of "Reconfiguring IPv4 on ovpns" takes minutes to complete.
Do you have any "time outs" in the general log, like in my case?



Yes, I have the same timeout entries in the log.

i have the same problem but its only using PPPOE connection...
i am not using openvpn/...
also i have this annoying ipv6 gw problem on pppoe connection

using cable modem via dhcp , no problem at all...

Quote from: patrickstar on October 04, 2021, 09:39:58 AM
i have the same problem but its only using PPPOE connection...
i am not using openvpn/...
also i have this annoying ipv6 gw problem on pppoe connection

using cable modem via dhcp , no problem at all...
Do you have timeout entries in "general log"?
Can you post relevant log excerpts?

I've added a temporary local dns server that is accessible on boot, and now the bootup seems to speed up quite a bit.

So it looks like for me, if there is no dns server available on boot, it will slow the boot process quite a bit.

For me the boot process finished quick if no WAN network is connected or DHCP server is NOT present in the WAN network.
For WAN connection I have dynamic IPv4.

Quote from: Maarten on October 03, 2021, 01:12:44 PM
Yes, I have the same timeout entries in the log.
How many timeouts do you have in the each boot log?

My guess that it could be related to the number of OpenVPN connections.

I've now tried to boot with all openvpn server connections disabled. As expected the boot was fast. I've re-enabled the connections and the boot is slow again.

But, now, for some reason, I don't see any timeouts anymore. So I don't think the timeouts are related to the boot delay I have.

Apparently executing this command is taking a long time:

configctl interface newip ovpns5  (this is executed for every vpn server you've configured)

This command is fired from this script:
/usr/local/etc/rc.syshook.d/start/10-newwanip

I noticed the delay is there as when you assign an interface to the vpn instance. If you remove the interface assignment there is no delay anymore. (but your setup doesn't work of course)

I have two OpenVPN connection (with OPNsense as a client) and configctl halted for two minutes (the timeout period set in the /usr/local/opnsense/service/configd_ctl.py file).

Looks like the bug is triggered by more than one OpenVPN connection configured.

I did some testing with a vanilla configuration, and measured the time it took opnsense to reconfigure all connections:

1 vpn server configured = 30sec total
2 vpn servers configured = 100sec total
3 vpn servers configured = 25sec total !?!?!?!?

Then I deleted the 3rd and it took 20 seconds, but the boot after that it was 40. Seems like the delay is a bit random.....


Do you have in "timeouts" in general log without OpenVPN interfaces? Like this one:
Quoteconfigctl[11670]   error in configd communication Traceback (most recent call last): File "/usr/local/opnsense/service/configd_ctl.py", line 68, in exec_config_cmd line = sock.recv(65536).decode() socket.timeout: timed out