Iocage: first run of `iocage fetch` fails with `RuntimeError: Please set a mountpoint on zroot/iocage` as /iocage mountpoint fails

Created on 17 Feb 2019  路  3Comments  路  Source: iocage/iocage

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

  • [x] Supply iocage --version
  • [x] Supply the commands used, along with any steps to recreate it.
  • [x] Provide the output from the command you issued.
  • [x] Supply what you expected the result or output to be
  • [x] Checked that the problem has not already been fixed on master if using
    a stable release.
# iocage v 1.1 and 1.2-BETA (sha#ca04bf)
# uname FreeBSD 12.0-RELEASE-p3 amd64
# iocage activate zroot
ZFS pool 'zroot' successfully activated.
Creating zroot/iocage
Creating zroot/iocage/download
Creating zroot/iocage/images
Creating zroot/iocage/jails
Creating zroot/iocage/log
Creating zroot/iocage/releases
Creating zroot/iocage/templates
# iocage fetch
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage_cli/fetch.py", line 129, in cli
    ioc.IOCage().fetch(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 115, in __init__
    self.pool = PoolAndDataset().get_pool()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 55, in __init__
    self.pool = ioc_json.IOCJson().json_get_value("pool")
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1435, in __init__
    super().__init__(location, checking_datasets, silent, callback)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 668, in __init__
    self.pool, self.iocroot = self.get_pool_and_iocroot()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 816, in get_pool_and_iocroot
    return pool, get_iocroot()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 814, in get_iocroot
    raise RuntimeError(f"Please set a mountpoint on {loc}")
RuntimeError: Please set a mountpoint on zroot/iocage

This appears to be related to not having a mountpoint set on the activated pool's root dataset zfs get mountpoint zroot returns none. I assume this would also fail if legacy mountpoints via fstab are being used. I had a cursory look through activate but didn't work out where or how this should be set yet, I'm not familiar with python.

I think that this is a common enough zpool setup to warrant manually setting mountpoint if none is defined.

enhancement

Most helpful comment

For anyone else that stumbles on this, I would think that a slightly better solution is to mount the iocage dataset in /iocage instead of /zroot. I stumbled on this when I setup a new FreeBSD jail host. I looked at a old installation, and there the iocage dataset were mounted on /iocage.. So, in other words:

$ sudo mkdir /iocage
$ sudo zfs set mountpoint=/iocage zroot/iocage

All 3 comments

This is expected, it may change in the future and set a mountpoint though. It gets hairy with altroots in particular (FreeNAS)

For folks who stumble onto this and aren't quite sure what's being asked of them, here's one solution from Albert Valbuena on adminbyaccident.com

We first create the directory

$ sudo mkdir /zroot

Now we set the mountpoint for zroot/iocage using the following command:

$ sudo zfs set mountpoint=/zroot zroot/iocage

For anyone else that stumbles on this, I would think that a slightly better solution is to mount the iocage dataset in /iocage instead of /zroot. I stumbled on this when I setup a new FreeBSD jail host. I looked at a old installation, and there the iocage dataset were mounted on /iocage.. So, in other words:

$ sudo mkdir /iocage
$ sudo zfs set mountpoint=/iocage zroot/iocage
Was this page helpful?
0 / 5 - 0 ratings

Related issues

notjoe picture notjoe  路  3Comments

asomers picture asomers  路  5Comments

woodsb02 picture woodsb02  路  6Comments

oliverangelil picture oliverangelil  路  3Comments

clem16 picture clem16  路  6Comments