SOLVED iocage cannot unmount dataset not currently mounted

bigjay517

Dabbler
Joined
Jan 14, 2015
Messages
14
I have a jail named autobackup which I have assigned a dataset to in order to zfs recv backups from another server.
When trying to stop my jail using iocage stop autobackup I receive the error 'RuntimeError: cannot unmount 'tank/autobackup/athena/wireguard': not currently mounted'.
Here is the complete error:
Code:
[root@freenas /mnt/tank/users/jason]# iocage stop autobackup
* Stopping autobackup
  + Executing prestop OK
  + Stopping services OK
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_stop.py", line 187, in __stop_jail__
    iocage_lib.ioc_common.checkoutput(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 619, in checkoutput
    out = su.check_output(*args, **kwargs)
  File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['setfib', '0', 'jexec', 'ioc-autobackup', 'zfs', 'umount', 'tank/autobackup/athena/wireguard']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

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 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/iocage_cli/stop.py", line 67, in cli
    ioc.IOCage(jail=jail, rc=rc).stop(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/iocage.py", line 1843, in stop
    ioc_stop.IOCStop(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_stop.py", line 62, in __init__
    raise e
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_stop.py", line 59, in __init__
    self.__stop_jail__()
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_stop.py", line 200, in __stop_jail__
    raise RuntimeError(
RuntimeError: cannot unmount 'tank/autobackup/athena/wireguard': not currently mounted

I don't understand why iocage thinks this dataset is mounted. The iocage fstab is empty.

Code:
[root@freenas /mnt/tank/users/jason]# iocage fstab autobackup -l
+-------+-------------+
| INDEX | FSTAB ENTRY |
+=======+=============+
+-------+-------------+


Here is the dataset structure I am working with.

Code:
Datasets on Server Sending
athena/caddy
      /pihole
      /plex
      /wireguard

Datasets on TrueNAS after zfs recv
tank/autobackup/athena/caddy
                      /pihole
                      /plex
                      /wireguard

Could it be due to a property of the dataset which is maintained during the zfs recv? Which property does iocage use to determine if it should mount/unmount datasets during start/stop?

Thanks in advance for any ideas!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Which property does iocage use to determine if it should mount/unmount datasets during start/stop?
you're probably looking for canmount... set to noauto if you only want mounting when you elect to do that. (that's a ZFS property, not a property of the jail... zfs get canmount pool/dataset/child)
 
Last edited:

bigjay517

Dabbler
Joined
Jan 14, 2015
Messages
14
you're probably looking for canmount... set to noauto if you only want mounting when you elect to do that. (that's a ZFS property, not a property of the jail... zfs get canmount pool/dataset/child)
Thanks for the suggestion. I tried to set that properly for the dataset and its children but, the behavior was the same.

I ended up looking into the source code of iocage and it turned out to be a simple fix. iocage is always trying to mount/unmount the children of the dataset assigned to the jail. If an error occurs it checks if the dataset assigned directly to the jail has a mountpoint (mountpoint != none, mine was /mnt/tank/autobackup/). If a mountpoint is found it passes the error to the user. If mountpoint == none then the error is discarded.

For now I have removed the mountpoint from my dataset. The main intention was for it to be a zfs recv location anyway. I don't plan to mount it locally and pull files off individually. I will live with the work of needing to manually setup the mount points if in the future I need to mount it.

Thanks again for your help!
 
Top