Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Importing Plex jail failure ====== I was relocating my jails from one storage pool to another. Shout to digimoot for some good documentation. * https://digimoot.wordpress.com/2020/01/11/freenas-backup-jails-automatically-using-iocage-import-and-export/ When I went to import the Plex jail it failed. <code> root@ale[~]# iocage import plex -p /mnt/u02/images Importing dataset: plex Importing dataset: plex/root cannot receive: failed to read from stream zsh: killed iocage import plex -p /mnt/u02/images </code> The problem is the plex jail is 64Gb before exporting 48Gb exported. The database for it should probably be separate from the Jail. This was the first post that I ran across on this issue * https://www.reddit.com/r/freenas/comments/fjdszy/iocage_import_failing_and_causing_swap_error/ Which led me to discover FreeNAS 11 has a defect. It tries to uncompress the jail root into memory before sending it to ZFS RECV. That's right, we load the 64Gb file into memory (BANG). * https://github.com/iocage/iocage/issues/1086 This bug still exists in FreeNAS-11.3-U5: /usr/local/lib/python3.7/site-packages/iocage_lib/ioc_image.py * https://github.com/iocage/iocage/blob/e44852191374cd0f5a7efbd4c78ce4860c9dfe3d/iocage_lib/ioc_image.py#L286 <code> if compression_algo == 'zip': data = f.open(name).read() else: data = f.extractfile(member).read() recv.stdin.write(data) recv.communicate() </code> This results in running out of swap and the import being terminated. Python3.7 is the IOCAGE command running "iocage import plex" <code> root@ale[/var/log]# fgrep 'out of swap space' messages Aug 17 07:29:21 ale kernel: pid 67038 (python3.7), jid 0, uid 0, was killed: out of swap space Aug 17 07:29:21 ale kernel: pid 67038 (python3.7), jid 0, uid 0, was killed: out of swap space swap_pager_getswapspace(2): failed swap_pager_getswapspace(2): failed swap_pager_getswapspace(32): failed </code> Code was fixed in TrueNAS 12 - https://github.com/iocage/iocage/blob/master/iocage_lib/ioc_image.py#L288 <code> chunk_size = 10 * 1024 * 1024 with (f.open(name) if compression_algo == 'zip' else f.extractfile(member)) as file: data = file.read(chunk_size) while data is not None and len(data) > 0: recv.stdin.write(data) data = file.read(chunk_size) recv.communicate() </code> It has not been backported FreeNAS 11, we will do that ourselves so we can continue to use the "iocage import" process without hacking about with workaround commands. That worked well. <code> root@ale[~]# iocage import plex -p /mnt/u02/images Importing dataset: plex Importing dataset: plex/root Imported: plex </code> {{tag>freenas plex jail}} ~~LINKBACK~~ blog/importing_plex_jail_failure.txt Last modified: 2021/08/17 15:13by brett