Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upgrade a jail to a release without "RELEASE" in the name #36

Open
asomers opened this issue Oct 8, 2024 · 0 comments · May be fixed by #38
Open

Can't upgrade a jail to a release without "RELEASE" in the name #36

asomers opened this issue Oct 8, 2024 · 0 comments · May be fixed by #38

Comments

@asomers
Copy link
Member

asomers commented Oct 8, 2024

I build custom release of FreeBSD, and serve them from a custom freebsd-update server. With the right command line options, iocage can fetch these releases and create jails from them. However, it can't upgrade such a release. The reason is because it attempts to fetch freebsd-update.sh from Github, but it doesn't know what version to use unless the name of the release is the same as the name of an official release. The offending code is at

https://github.com/iocage/iocage/blob/e377d0c436f4c1fbdfa9370a8a831dc2b2cb4be1/iocage_lib/ioc_upgrade.py#L103

Here's what happens when you try:

$ iocage --version
Version	1.2
$ sudo iocage fetch -r 12.2-AXCIENT1 --root-dir <my_root_dir> -s http://<my_server>/<my_path>
...
$ sudo iocage upgrade <my_jail> --release 12.2-AXCIENT1
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 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, 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

I can think of a few possible solutions:

  • Add a command line option to specify the path to a freebsd-update executable.
  • Add a command line option to provide an "equivalent release" for purposes of downloading freebsd-update
  • If the release has already been fetched, just use the freebsd-update binary from the /iocage/releases directory.

Original issue link: iocage/iocage#1233

asomers added a commit to asomers/iocage that referenced this issue Oct 9, 2024
This eliminates the dependency on github during upgrade.  It also makes
it possible to upgrade to a release that does not have -RELEASE in the
name.

Fixes freebsd#36
@asomers asomers linked a pull request Oct 9, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant