SOLVED Jail upgrade: snapshot already exists

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
This thread made me want to update my qBittorrent jail from 13.1 to 13.2.
I'm running 13.0-U5.2 and have two other jails running 13.2.

So I did as follows:
Code:
root@truenas[~]# iocage fetch
[0] 12.4-RELEASE
[1] 13.1-RELEASE
[2] 13.2-RELEASE

Type the number of the desired RELEASE
Press [Enter] to fetch the default selection: (13.1-RELEASE)
Type EXIT to quit: 2
Fetching: 13.2-RELEASE

Extracting: base.txz...
Extracting: lib32.txz...
src.txz missing, will try to redownload!
Downloading: src.txz [####################] 100%
Extracting: src.txz...

* Updating 13.2-RELEASE to the latest patch level...
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 5 patches... done.
Applying patches... done.
The following files will be updated as part of updating to
13.2-RELEASE-p1:
/bin/freebsd-version
/boot/loader
/boot/loader.efi
/boot/loader_4th
/boot/loader_4th.efi
/boot/loader_lua
/boot/loader_lua.efi
/boot/loader_simp
/boot/loader_simp.efi
/boot/pxeboot
/boot/zfsloader
/usr/lib/libpam.a
/usr/lib/pam_krb5.so.6
/usr/lib32/libpam.a
/usr/lib32/pam_krb5.so.6
/usr/share/man/man8/pam_krb5.8.gz
/usr/src/lib/libpam/modules/pam_krb5/pam_krb5.8
/usr/src/lib/libpam/modules/pam_krb5/pam_krb5.c
/usr/src/stand/i386/libi386/comconsole.c
/usr/src/sys/conf/newvers.sh
/usr/src/sys/dev/mpr/mpr.c
Installing updates...Scanning /mnt/omega/iocage/releases/13.2-RELEASE/root/usr/share/certs/blacklisted for certificates...
Scanning /mnt/omega/iocage/releases/13.2-RELEASE/root/usr/share/certs/trusted for certificates...
 done.
release: 13.2-RELEASE-p1 -> 13.2-RELEASE-p1


Then I stopped the jail
Code:
root@truenas[~]# iocage stop qBit
* Stopping qBit
  + Executing prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing devfs_ruleset: 1002 OK
  + Removing jail process OK
  + Executing poststop OK


And tried to upgrade it
Code:
root@truenas[~]# iocage upgrade -r 13.2-RELEASE qBit
Snapshot already exists
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/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.9/site-packages/iocage_lib/iocage.py", line 2086, in upgrade
    new_release = ioc_upgrade.IOCUpgrade(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_upgrade.py", line 236, in upgrade_basejail
    self.__snapshot_jail__()
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_upgrade.py", line 403, in __snapshot_jail__
    ioc.IOCage(jail=self.uuid, skip_jails=True, silent=True).snapshot(name)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/iocage.py", line 1719, in snapshot
    ioc_common.logit(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 107, in logit
    callback(content, exception)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 92, in callback
    raise callback_exception(message)
iocage_lib.ioc_exceptions.Exists: Snapshot already exists


Anyone understanding what I am doing wrong?

As a side note, before doing so I followed the [FreeBSD] documentation and tried to upgrade the jail from the inside:
Code:
root@qBittorrent:~ # freebsd-update -r 13.2-RELEASE upgrade
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 13.1-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.

WARNING: This system is running a "truenas" kernel, which is not a
kernel configuration distributed as part of FreeBSD 13.1-RELEASE.
This kernel will not be updated: you MUST update the kernel manually
before running "/usr/sbin/freebsd-update install".

The following components of FreeBSD seem to be installed:
world/base world/lib32

The following components of FreeBSD do not seem to be installed:
kernel/generic kernel/generic-dbg world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)? n

I did not proceed because I wasn't sure abput the truenas kernel thing, so I tried the method shown at the beginning.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
zfs list -t snapshot -r <pool>/iocage/jails/qBit

Then remove the snapshot and try again.

Which documentation tells to run freebsd-update in a jail?
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
iocage creates a snapshot before each upgrade - unfortunately with fixed name and not a timestamp or UUID or similar. So if that operation is interrupted for any reason you need to manually clean up before trying again. Not critical.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
zfs list -t snapshot -r <pool>/iocage/jails/qBit

Then remove the snapshot and try again.
Which one, or all of them?
Code:
zfs list -t snapshot -r omega/iocage/jails/qBit
NAME                                                                          USED  AVAIL     REFER  MOUNTPOINT
omega/iocage/jails/qBit@ioc_update_13.1-RELEASE-p5_2023-07-27_13-19-02         76K      -      112K  -
omega/iocage/jails/qBit@ioc_update_13.1-RELEASE-p8_2023-07-27_13-19-32          0B      -      112K  -
omega/iocage/jails/qBit@ioc_upgrade_2023-07-27                                  0B      -      112K  -
omega/iocage/jails/qBit/root@ioc_update_13.1-RELEASE-p5_2023-07-27_13-19-02     0B      -      106G  -
omega/iocage/jails/qBit/root@ioc_update_13.1-RELEASE-p8_2023-07-27_13-19-32     0B      -      106G  -
omega/iocage/jails/qBit/root@ioc_upgrade_2023-07-27                           424K      -      106G  -
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If your jail is fine now and you don't need any of the states for rollback, yes. iocage will create a fresh one before attempting the upgrade.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222

Verytutos

Cadet
Joined
Apr 23, 2022
Messages
6
I tried to perform the upgrade from 13.1 to 13.2 with iocage upgrade -r 13.2-RELEASE nextcloud but the jail still is 13.1.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I tried to perform the upgrade from 13.1 to 13.2 with iocage upgrade -r 13.2-RELEASE nextcloud but the jail still is 13.1.
What exactly happened when you used that command? Without the output how is anyone to have a guess at the possible cause?
 
Top