Today I tried to upgrade an 11.3-RELEASE-p7 jail to 11.4-BETA1. But iocage crashed with an unhandled exception urllib.error.HTTPError: HTTP Error 404: Not Found. It should've succeeded, or at least told me what URL wasn't found.
$ sudo iocage fetch -r 11.4-BETA1
Password:
Fetching: 11.4-BETA1
Downloading: MANIFEST [####################] 100%
Downloading: base.txz [####################] 100%
Downloading: lib32.txz [####################] 100%
Downloading: src.txz [####################] 100%
Downloading: doc.txz [####################] 100%
Extracting: base.txz...
Extracting: lib32.txz...
Extracting: src.txz...
Extracting: doc.txz...
* Updating 11.4-BETA1 to the latest patch level...
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update2.freebsd.org... done.
Fetching metadata signature for 11.4-BETA1 from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
No updates needed to update system to 11.4-BETA1-p0.
WARNING: FreeBSD 11.4-BETA1 is approaching its End-of-Life date.
It is strongly recommended that you upgrade to a newer
release within the next 2 weeks.
No updates are available to install.
Run '/tmp/tmppkx3_mbi fetch' first.
$ iocage --version
Version 1.2
$ sudo iocage upgrade rustup2 -r 11.4-BETA1
Traceback (most recent call last):
File "/usr/local/bin/iocage", line 10, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/iocage_cli/upgrade.py", line 40, in cli
ioc.IOCage(jail=jail, skip_jails=skip_jails).upgrade(release)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/iocage.py", line 2168, in upgrade
callback=self.callback
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py", line 120, in upgrade_jail
with urllib.request.urlopen(f) as fbsd_update:
File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
iocage --versionmaster if usingThe failed URL seems to be:
f_rel = f'{self.new_release.rsplit("-RELEASE")[0]}.0'
f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
f'/release/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
AFAICT it should be fixed by e377d0c436f4c1fbdfa9370a8a831dc2b2cb4be1.
_Edit:_ no, it doesn't solve it, both branches have disappeared (recently, I guess).
Work-around (around line 105):
f_rel = f'{self.new_release.rsplit("-RELEASE")[0].split(".")[0]}'
f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
f'/stable/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
Thank you, lapo-luchini! I was trying to iocage upgrade an old jail from 10.3 to 11.3 and hit exactly the same error. Your workaround fixed my upgrade as well.
I think the main problem is the rsplit("-RELEASE"). Not all release have RELEASE in the name, for example 11.4-BETA1. Better to rsplit("-").
Most helpful comment
Work-around (around line 105):