opnsense / update

OPNsense update tools
https://opnsense.org/
BSD 2-Clause "Simplified" License
126 stars 76 forks source link

opnsense-bootstrap doesn't work #91

Closed zpertee closed 5 months ago

zpertee commented 5 months ago

I keep getting this error almost no matter what I do and whether on premise or in cloud environments: fetch: https://github.com/opnsense/core/archive/stable/24.1.tar.gz: size of remote file is not known.

fichtner commented 5 months ago

Why should this be an error? The file doesn’t download I guess? Not sure how to help of the fetch from GitHub fails.

zpertee commented 5 months ago

Why should this be an error? The file doesn’t download I guess? Not sure how to help of the fetch from GitHub fails.

I guess I was assuming there was a sense of ownership and pride in this project. If the scripting needs updated to better authenticate with github, host elsewhere, etc. then it seems like it would be worth doing. As it stands, I cannot start with a fresh freebsd install and install opnsense on top of it.

fichtner commented 5 months ago

Do you want my technical answer or not? I can also do snarky if that helps.

It’s not an error. It’s a valid HTTP behaviour to not give the client the length of the file.

So far you’re just claiming it doesn’t work in a situation only you can debug. I’m not sure what anyone is supposed to do at this point.

Just trying to help here. I’ve grown impartial to others telling me I’m not doing enough. Be my guest either way. This is my final asking for you being more helpful and less snarky. Thanks for your consideration.

zpertee commented 5 months ago

I apologize. I see now that in my 13th hour of desperation I provided little context of the issue. Thus, your question and my perhaps inappropriate reading of it in a snarky tone and responding accordingly. :)

This occurs when running the provided bootstrap script. I do know the archive exists because I can manually down it. I also know the bootstrap script works when I run it from an environment I installed using the provided Opnsense dvd iso. However, for the life of me I cannot seem to crack the nut of how to install OpnSense on a vanilla FreeBSD install.

fichtner commented 5 months ago

No worries. So the line in question is https://github.com/opnsense/update/blob/f2a68310adc96dda4b49b928a2fe50ef7a27b974/src/bootstrap/opnsense-bootstrap.sh.in#L197

You can try to see what happens:

# fetch -o core.tar.gz https://github.com/opnsense/core/archive/stable/24.1.tar.gz

If that works fine try starting opnsense-bootstrap with the -V parameter to see the exact line it's failing on.

Cheers, Franco

zpertee commented 5 months ago

Thanks @fichtner. After some more trial and error it seems like I was able to get a bit farther by downloading a new 13.3 vhd from freebsd, extending the vhd pre-boot to allow it to auto-resize, and then I was able to successfully fetch the archive. Also, it seems like perhaps the bootstrap requires me to not enable ssh in order for it to get farther along (not positive on details there, but it seems like something I was doing is repeatable). At first boot and first commands if I fetch the bootstrap script and run it, it doesn't immediately error out & return. But now, I'm getting the attached error.

image

zpertee commented 5 months ago

FYI, I was able to resolve this. I had to pull down a legacy version of FreeBSD 13.1, but once I did that everything went much better.

fichtner commented 5 months ago

Yeah I've seen the issue with the file name to directory issues going from 13.2 to 13.3. Unfortunately I don't have a time machine to fix this so using an older FreeBSD 13.x is the best approach.

Maybe for bootstrap there is an issue with the certificate chain, the -i option can also be used to avoid that.

fichtner commented 5 months ago

PS: close then?

zpertee commented 5 months ago

Thanks. I have one last question. In looking at the Opnsense roadmap just now I'm seeing that version 24.7 is set for release in July and that version has planned support for 13.3. Assuming 13.3 support gets completed in time, when we install the 24.7 update through the web gui will it also upgrade FreeBSD to 13.3 or is there a separate process for that?

fichtner commented 5 months ago

It's all done from the GUI in a single step followed by multiple automatic reboots due to handling the shifting ABI of the compiled code. Does that answer your question? :)

zpertee commented 5 months ago

Awesome! Thank you. That's what I was hoping for... :) Have a good rest of your week.

fichtner commented 5 months ago

To you as well. Glad we could work this out :)

Cheers, Franco