jails iocage error: dataset already exists

Hi, guys. This is an iocage question. I've got a TruNAS installation working and I'd like to replicate my jails for safety.

The export command is working fine with two jails (CrushFTP and PlexServer), but with Resilio I get this error:

Code:
root@TN1[/mnt/d10_4_8_21/iocage/jails/Resilio]# iocage export Resilio     

cannot create snapshot 'd10_4_8_21/iocage/jails/Resilio@ioc-export-2022-03-26': dataset already exists

cannot create snapshot 'd10_4_8_21/iocage/jails/Resilio/root@ioc-export-2022-03-26': dataset already exists

no snapshots were created
Resilio was installed with a slightly irregular technique, I wonder if it's got some structure that iocage does not like? By the way, Resilio is a very nice syncing program that I find more stable and actually works while Nextcloud and a few others I've tried do not turn me on.
 
Last edited by a moderator:
To make matters worse, now I get the same error with PlexServer.... Ultimately I'm creating a script that makes an image and saves it to a backup folder. Once I debug that I can move onto rsync replication to my backup server. I've already got successful rsync scripts for everything except the jails!

So, something in my script messed up iocage? Basing my script on the excellent iocage primer at: https://www.digimoot.com/freenas-backup-jails-automatically-using-iocage-import-and-export/
Code:
#!/bin/bash
# rsync stuff terminated by ; means script runs, next script runs next no matter the success
# BACK UP PlexServer 
# TN1: Back up PlexServer Jail inside iocage to an image

echo "---Starting Backup of Trunas PlexServer Jail---" >> /mnt/d10_4_8_21/data/logs/Jail.log
echo $(date) >> /mnt/d10_4_8_21/data/logs/Jail.log

echo "Backing Up PlexServer Jail" >> /mnt/d10_4_8_21/data/logs/Jail.log
echo $(date) >> /mnt/d10_4_8_21/data/logs/Jail.log
iocage stop PlexServer >> /mnt/d10_4_8_21/data/logs/Jail.log
iocage export PlexServer >> /mnt/d10_4_8_21/data/logs/Jail.log
iocage start PlexServer >> /mnt/d10_4_8_21/data/logs/Jail.log
echo "...Deleting old backups" >> /mnt/d10_4_8_21/data/logs/Jail.log
echo $(date) >> /mnt/d10_4_8_21/data/logs/Jail.log
rm /mnt/Backups/PlexServer* >> √
echo "...Moving PlexServer backup to storage folders" >> /mnt/d10_4_8_21/data/logs/Jail.log
echo $(date) >> /mnt/d10_4_8_21/data/logs/Jail.log
mv -v /mnt/d10_4_8_21/iocage/images/PlexServer* /mnt/d10_4_8_21/Backups/PlexServer >> /mnt/d10_4_8_21/data/logs/Jail.log
 
Last edited by a moderator:
Hi folks. Yes these are questions from a TrueNAS install, but they seem more iocage centric.
 
Thanks for your attention! The error is intermittent.... sometimes the export goes through, sometimes the error "dataset already exists" appears.... It's likely a red herring but I haven't been able to get past it consistently. I've tried unmounting all snapshots and I thought that fixed it, but no.
 
Thanks for your attention! The error is intermittent.... sometimes the export goes through, sometimes the error "dataset already exists" appears.... It's likely a red herring but I haven't been able to get past it consistently. I've tried unmounting all snapshots and I thought that fixed it, but no.
One of my three jails currently exports without the error.... but the problem is intermittent. Ouch.....
 
I can report the problem fixed itself, eventually. While working on my replication scripts.... It might have been related to permissions and not to zfs snapshots or datasets at all... I did have to fix a bunch of permissions to get my scripts to run. If any of you have any enlightening suggestions should the snapshot (dataset) problem come up again, I'm all ears. Thanks for being here.
 
Back
Top