[TrueNAS 12.0-U1] jail upgrade consistency

bal0an

Explorer
Joined
Mar 2, 2012
Messages
72
After successfully upgrading from FreeNAS 11.3-U5 to TrueNAS 12.0-U1 I wanted to upgrade my jails to the latest version as well:
iocage stop bareos
iocage upgrade bareos -r 12.0-RELEASE
iocage start bareos
I am not quite sure whether 12.0-RELEASE is right, I just guessed the iocage version.
The jail still works fine after the upgrade, it merged some ~8300 files. The UI shows release 12.0-RELEASE-p13 now.
But it looks like the jail is not aware of the upgrade:
root@bareos:~ # freebsd-version
11.3-RELEASE-p11
root@bareos:~ # uname -a
FreeBSD bareos 12.2-RELEASE-p2 FreeBSD 12.2-RELEASE-p2 663e6b09467(HEAD) TRUENAS amd64
This is especially annoying when using the package manager which thinks it is still on 11.3, so the latest bareos-server packages 19.2.9 are not available (just 19.2.7). Also package dependency management shows dependencies that don't work (bareos-webui wants to pull PHP7.4 which doesn't work).
root@bareos:~ # pkg -vv
Version : 1.15.10
...
ABI = "FreeBSD:11:amd64";
...
FreeBSD: {
url : "pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
Bareos: {
url : "pkg+https://download.bareos.org/bareos/release/19.2/FreeBSD_11.3",
enabled : yes,
priority : 0,
mirror_type : "SRV"
}

What is the best way to make the jail state consistent? Reinstall (just kidding)?
 
Joined
Jan 7, 2015
Messages
1,155
follow the same steps you already have done, but use 12.2-RELEASE
 

bal0an

Explorer
Joined
Mar 2, 2012
Messages
72
follow the same steps you already have done, but use 12.2-RELEASE
12.2-RELEASE does not work for me.
Code:
root@freenas:~ # iocage list
+------+--------+-------+--------------+------+
| JID  |  NAME  | STATE |   RELEASE    | IP4  |
+======+========+=======+==============+======+
| 7    | bareos | up    | 12.0-RELEASE | DHCP |
+------+--------+-------+--------------+------+
| None | mta    | down  | 12.0-RELEASE | DHCP |
+------+--------+-------+--------------+------+
root@freenas:~ # iocage upgrade mta -r 12.2-RELEASE
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/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.8/site-packages/iocage_lib/iocage.py", line 2070, in upgrade
    new_release = ioc_upgrade.IOCUpgrade(
  File "/usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py", line 110, in upgrade_jail
    with urllib.request.urlopen(f) as fbsd_update:
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/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
 
Joined
Jan 7, 2015
Messages
1,155
iocage fetch 12.2-RELEASE
Iocage upgrade mta -r 12.2-RELEASE
 

arrowd

Dabbler
Joined
Jul 12, 2019
Messages
16
I'm having the same trouble as bal0an did on Tuesday - same traceback and error. I also tried using 12.1-RELEASE and got the same result. My one jail is at 11.3-RELEASE-p5.
 
Joined
Jan 7, 2015
Messages
1,155
Apparently this isn't working right now due to upstream issues at FreeBSD.org this according to @Jailer.
 

the_jest

Explorer
Joined
Apr 16, 2017
Messages
71
Is there any sense of when this might get resolved? I upgraded my NAS itself over the weekend, and it went smoothly apart from the jail issue; I was able to upgrade several of my jails, but my two most important ones are failing with this identical error, and I'd really love to get them running again.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Yeah the download is just not working...
But if you want to know when the FreeBSD servers are back up, I think you should ask them...

Afaik the FreeBSD folks involved with the server aren't that active on this forum...
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
I had the same issue today getting my 11.3u5 jails to 11.4-RELEASE.

If you're getting the 404 error listed in @bal0an's 2nd post, then its an iocage issue.

For those that just want the answer (12.x might have a different python version):
For your base OS (not the jail) /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py, do the following replace:

Old Code:
Code:
         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'

New Code:
Code:
         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'


I suggest not modifying by hand, I missed a few minor differences. Also, save your original file to something like .bak to restore when you're done.
 
Last edited:

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
Base FreeNAS/TrueNAS, I just edited my previous post to specify.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I had the same issue today getting my 11.3u5 jails to 11.4-RELEASE.

If you're getting the 404 error listed in @bal0an's 2nd post, then its an iocage issue.

For those that just want the answer (12.x might have a different python version):
For your base OS (not the jail) /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_upgrade.py, do the following replace:

< 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'

I suggest not modifying by hand, I missed a few minor differences.
I can confirm this is working but I wouldn't copy and paste the information posted here. Also the location was different in my case /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py Check the error listed in the console to see where yours is located. Original post can be seen here for reference.

@hertzsae when you are posting code you should use the code tags so that formatting is kept intact. I suggest making the change manually and saving a copy of the original file before you make any changes.
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
I can confirm this is working but I wouldn't copy and paste the information posted here. Also the location was different in my case /usr/local/lib/python3.8/site-packages/iocage_lib/ioc_upgrade.py Check the error listed in the console to see where yours is located. Original post can be seen here for reference.

@hertzsae when you are posting code you should use the code tags so that formatting is kept intact. I suggest making the change manually and saving a copy of the original file before you make any changes.
Agreed, I saved the old file to a .bak before I started and copied it back when I was done. I've put the code in proper blocks.
 
Top