Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Upgrading FreeBSD jail to 12.2-RELEASE results in HTTP 404 but fetching 12.2-RELEASE works #1237

Closed
vendion opened this issue Dec 21, 2020 · 13 comments · Fixed by #1242
Closed

Comments

@vendion
Copy link

vendion commented Dec 21, 2020

Make sure to follow and check these boxes before submitting an issue! Thank you.

  • [ x ] Supply iocage --version
    Version 1.2`
  • [ x ] Supply the commands used, along with any steps to recreate it.
    iocage upgrade -r 12.2-RELEASE <jail name>
  • [ x ] Provide the output from the command you issued.
  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
  • [ x ] Supply what you expected the result or output to be
    The named jail to be upgraded
  • [ x ] Checked that the problem has not already been fixed on master if using
    a stable release.
    Could not find any commits or similar issues to this.

Interestingly iocage fetch -r 12.2-RELEASE is able to not only fetch the 12.2-RELEASE sources but is able to run freebsd-update on it without issue.

@mawi78
Copy link

mawi78 commented Dec 21, 2020

I just encountered exactly the same issue. Would be great to have a fix or workaround.

@dettner
Copy link

dettner commented Dec 22, 2020

I am also affected by the same problem (urllib.error.HTTPError: HTTP Error 404: Not Found)

In my traceback this is mentioned:

File "/usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py", line 110, in upgrade_jail

Around there, this is the source code:

104 f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
105 f'/release/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
# ... ... ...
110 with urllib.request.urlopen(f) as fbsd_update:

A correct URL seems to be https://raw.githubusercontent.com/freebsd/freebsd/master/usr.sbin/freebsd-update/freebsd-update.sh.

I'm on TrueNAS-12.0-U1 Core

@zaltysz
Copy link

zaltysz commented Dec 22, 2020

FreeBSD started transitioning from SVN to git on the 19th of December. This breakage could be a side effect of changes in FreeBSD repo.

@vendion
Copy link
Author

vendion commented Dec 22, 2020

While it's true that FreeBSD started moving away from SVN, if that was the case I would expect for freebsd-update.sh to fail with a similar/same error when called from the iocage fetch command like it does when executed by iocage upgrade. That is unless iocage fetch uses another mean to update the fetched release to the latest patch.

@apprell
Copy link

apprell commented Dec 22, 2020

If replace in /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py:

<         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'
---
>         f_rel = f'{self.new_release.split(".")[0]}'
>         f = f'https://raw.githubusercontent.com/freebsd/freebsd' \
>             f'/stable/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'

Then it works.

@vendion
Copy link
Author

vendion commented Dec 22, 2020

If replace in /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py:

# f = 'https://raw.githubusercontent.com/freebsd/freebsd' \
#     f'/release/{f_rel}/usr.sbin/freebsd-update/freebsd-update.sh'
f = 'https://raw.githubusercontent.com/freebsd/freebsd/master/usr.sbin/freebsd-update/freebsd-update.sh'

Then it works.

Can confirm that doing this worked.

@william-gr
Copy link

Seems like a duplicate of #1232

@vendion
Copy link
Author

vendion commented Dec 22, 2020

Seems like a duplicate of #1232

Looking at it now, with the changes to /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py I agree but it wasn't originally obvious to me.

@apprell
Copy link

apprell commented Dec 22, 2020

If the proposal to replace the link with this
https://raw.githubusercontent.com/freebsd/freebsd/releng/12.0/usr.sbin/freebsd-update/freebsd-update.sh
or
https://raw.githubusercontent.com/freebsd/freebsd/releng/12/usr.sbin/freebsd-update/freebsd-update.sh

This doesn't work either, there will be a 404 error.

You can easily check it yourself by opening the link in the browser.

@william-gr william-gr reopened this Dec 22, 2020
@william-gr
Copy link

Indeed, it seems like they changed it again... removed tags/branches.

Thanks for pointing it out.

@william-gr
Copy link

All in all, seems like just an issue replicating from freebsd cgit to github. Once they fix that we should be back in business. We hope.

@Bklyn
Copy link

Bklyn commented Dec 23, 2020

@apprell:

If the proposal to replace the link with this
https://raw.githubusercontent.com/freebsd/freebsd/releng/12.0/usr.sbin/freebsd-update/freebsd-update.sh
or
https://raw.githubusercontent.com/freebsd/freebsd/releng/12/usr.sbin/freebsd-update/freebsd-update.sh

This doesn't work either, there will be a 404 error.

The correct URL (as of this writing) uses stable instead of releng.

@kevans91
Copy link
Contributor

kevans91 commented Feb 5, 2021

This URL should get updated to:

https://raw.githubusercontent.com/freebsd/freebsd-src/releng/12.2/usr.sbin/freebsd-update/freebsd-update.sh

freebsd-src is the correct repo going forward

kevans91 added a commit to kevans91/iocage that referenced this issue Feb 5, 2021
The FreeBSD repository now syncs to freebsd/freebsd-src and the old repo
has been moved to freebsd/freebsd-legacy. freebsd/freebsd redirects to
freebsd/freebsd-src, but let's not rely on that going forward.

Fixes iocage#1237
skarekrow pushed a commit that referenced this issue Feb 5, 2021
The FreeBSD repository now syncs to freebsd/freebsd-src and the old repo
has been moved to freebsd/freebsd-legacy. freebsd/freebsd redirects to
freebsd/freebsd-src, but let's not rely on that going forward.

Fixes #1237
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants