OPNsense Forum

English Forums => General Discussion => Topic started by: patrick3000 on August 01, 2023, 10:40:23 PM

Title: Unable to update/reinstall kernel
Post by: patrick3000 on August 01, 2023, 10:40:23 PM
I'm trying to upgrade to version 23.7 of OPNsense, and the upgrade freezes due to a package mismatch. In particular, I have version 23.1.11 of OPNsense installed, but the kernel is 23.1.8.

When I go under "Firmware," "Packages" and attempt to reinstall the kernel, it hangs with the output:

"***GOT REQUEST TO REINSTALL***
Currently running OPNsense 23.1.11_1 at Tue Aug  1 15:25:16 CDT 2023
Fetching kernel-23.1.11-amd64.txz:

Does anyone now how to work around this problem and reinstall (update) the kernel to 23.1.11?
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 12:51:28 AM
Try this comand

opnsense-update -fkbr 23.1.11

With 23.7 being released however, I would start fresh and import the config file. Could be the cleaner option in your case.
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 01:44:14 AM
Thanks. However, that command, executed from the shell via ssh, gave the same result. It just said "fetching kernel" and hung. I guess if I can't find a solution in the next day or so, I'll reinstall and restore from config. However, that's a last resort because it's a bit riskier. What if something goes wrong with the process? I'd hate to have significant downtime setting everything up again.

If it comes down to that, I think I'll get another SSD and swap it out before doing the reinstallation. That way, if there are any problems, I can put the current SSD back in.
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 02:25:02 AM
Can you try this download on the firewall ? Something quacks like DNS there...and you already changed mirrors I think ?

fetch https://pkg.opnsense.org/FreeBSD:13:amd64/23.7/sets/kernel-23.7-amd64.txz
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 02:52:01 AM
I fetched it from the shell via ssh. However, I'm not sure what to do next.

Here is the output:

fetch https://pkg.opnsense.org/FreeBSD:13:amd64/23.7/sets/kernel-23.7-amd64.txz
kernel-23.7-amd64.txz                                   31 MB   10 MBps    03s

Perhaps I can somehow do the upgrade via the shell with this package that I fetched?
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 03:06:29 AM
Set the mirror to OPNsense Amsterdam and check for updates. Let's see the output there.

You can delete the file for now.
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 03:44:18 AM
That didn't work. It got hung up on kernel-23.1.11-amd64.txz, as usual.

Do you know if there is a way to fetch kernel-23.1.11 and manually install it? I suspect that if I could do that, I'd then be be able to upgrade to 23.7.

In any event, here is the output after I switched to the Amsterdam mirror. First, it said this:

***GOT REQUEST TO CHECK FOR UPDATES***
Currently running OPNsense 23.1.11_1 at Tue Aug  1 20:11:27 CDT 2023
Fetching changelog information, please wait... fetch: transfer timed out
fetch: /usr/local/opnsense/changelog/changelog.txz appears to be truncated: 0/284144 bytes
Updating OPNsense repository catalogue...
Fetching meta.conf: . done
Fetching packagesite.pkg: .......... done
Processing entries: .......... done
OPNsense repository update completed. 835 packages processed.
All repositories are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.
Checking for upgrades (45 candidates): .......... done
Processing candidates (45 candidates): . done
Checking integrity... done (0 conflicting)
Your packages are up to date.

Then it came back with a message that I needed to update the kernel, and when I clicked on the button to update the kernel, it said this:

***GOT REQUEST TO UPDATE***
Currently running OPNsense 23.1.11_1 at Tue Aug  1 20:30:26 CDT 2023
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
Checking for upgrades (45 candidates): .......... done
Processing candidates (45 candidates): . done
Checking integrity... done (0 conflicting)
Your packages are up to date.
Checking integrity... done (0 conflicting)
Nothing to do.
Checking all packages: .......... done
Nothing to do.
Nothing to do.
Starting web GUI...done.
Generating RRD graphs...done.
Fetching kernel-23.1.11-amd64.txz:

Then it hung again.
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 04:01:34 AM
Can you describe "hung" ? This is a fairly large download and your kernel stats above doesn't show it on a very speedy WAN.

Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 04:38:13 AM
After it says "Fetching kernel-23.1.11-amd64.txz:" it just outputs periods to the screen, slowly, every few seconds or so, forever.

The output looks like this "............................." and goes on forever.

I've let it run for hours, and that's all it does. It does it no matter how I try to update the kernel, whether in the web UI or from the command shell.
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 04:46:03 AM
That's exactly what you need, just wait it out. No need to do anything else. It will start rebooting when downloads have completed and then do a couple reboots to install the packages.

Give it time.
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 04:51:08 AM
OK. It's evening here in the States. I'll let it run overnight and see if it does anything by morning. If not, I guess I'll reinstall and restore from config.

However, I just ran a speed test, and my WAN speed is 815 Megabits per second, which is somewhat less than the gigabit speed I'm paying for (and I'll take that up with my ISP some other time), but it should be more than enough speed to download the firmware.

Maybe the OPNsense mirrors are slow today since 23.7 was just released yesterday.

Thanks.
Title: Re: Unable to update/reinstall kernel
Post by: franco on August 02, 2023, 10:11:19 AM
Could be another IPv6 issue at play here.


Cheers,
Franco
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 11:11:09 AM
Nope, the metaphysics has already been laid out here https://forum.opnsense.org/index.php?topic=35145.0 (https://forum.opnsense.org/index.php?topic=35145.0) and now we moved to General or the quantum mechanics of the kernel
Title: Re: Unable to update/reinstall kernel
Post by: franco on August 02, 2023, 11:55:53 AM
It's clearly hanging during fetch which is not a complicated operation is all I am saying ;)


Cheers,
Franco
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 05:34:34 PM
For the record, I let it run overnight, and there was no change. It hangs when fetching the kernel, and it won't upgrade to 23.7 due to the kernel mismatch. At this point, unless anyone has other suggestions, I'm going to give up and do a fresh install of 23.7 after I get a new SSD, which will be today or tomorrow, and then restore the config.

Also, to Franco's question, I don't use IPV6 for anything on my local network, but now that I think of it, I do have IPV6 gateways included in my gateway group, because one of my ISPs assigns my WAN interface a public IPV6 address in addition an IPV4 address.
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 06:01:07 PM
We forgave Scrhodinger because he has/had a nice cat...



System-Settings-General  --- Is "Prefer to use IPv4 even if IPv6 is available" checked ?

Firewall-Settings-Advanced  --- Uncheck "Allow IPv6"


Alternatively, can you could try disabling IPv6 on the WAN interface


For Franco, what would explain fetch kernel URL works but opnsense-update consistently(apparently) hangs ? Does it ignore or is not aware of the Prefer IPv4 directive ?
Title: Re: Unable to update/reinstall kernel
Post by: franco on August 02, 2023, 08:51:05 PM
It might be part of the firmware runtime environment being slightly off, but I have no clue why. A plain fetch working better in general is what I have seen as well.

The FreeBSD package manager will actually move to a slimmed down version of curl in contrast to using libfetch which is what is currently being used. We also use libfetch through fetch utility.


Cheers,
Franco
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 09:17:23 PM
Newsense, your latest suggestions have allowed me to successfully update the kernel to 23.1.11. Hopefully I will now also be able to upgrade to 23.7 through the web UI. I will report back after attempting to do so.

For the record, I made the following changes:

System-Settings-General  --- checked "Prefer to use IPv4 even if IPv6 is available"

Firewall-Settings-Advanced  --- unchecked "Allow IPv6"

Additionally, I disabled IPV6 on WAN, which I never use and was only set up because my ISP gives me both an IPV4 and IPV6 public address. (I wish I'd remembered this yesterday when you asked about IPV6, but since I never use it, I forgot that it was even enabled.)

After these changes, the kernel successfully updated through the package manager in the web UI.
Title: Re: Unable to update/reinstall kernel
Post by: patrick3000 on August 02, 2023, 09:33:00 PM
The upgrade to 23.7 was successful once I got the kernel package updated. Thanks everyone for your help!

I do wonder if I should re-enable IPV6 on WAN. I'm leaning toward doing so because there might be some reason to have a public IPV6 address.
Title: Re: Unable to update/reinstall kernel
Post by: newsense on August 02, 2023, 09:39:43 PM
Amazon recently announced they'll start charging $0.005/hour for an IPv4 address, so IPv6 is unavoidable no matter how messy it is.

Glad everything worked out for you :)

https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/