bsdci / libioc

A Python library to manage jails with ioc{age,ell}
https://bsd.ci/libioc
Other
38 stars 11 forks source link

Releases cannot be destroyed #313

Open gronke opened 6 years ago

gronke commented 6 years ago
root@freebsd-11-1 /usr/local/src/libiocage (git)-[master] # python3.6 . destroy -r 11.1-RELEASE
These releases will be deleted:
  - 11.1-RELEASE
Are you sure? [y/N]: y
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./__main__.py", line 48, in <module>
    main()
  File "./__main__.py", line 42, in main
    cli(prog_name="iocage")
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "./iocage/cli/destroy.py", line 120, in cli
    item.destroy()
  File "./iocage/lib/Release.py", line 777, in destroy
    self.zfs.delete_dataset_recursive(self.dataset)
  File "./iocage/lib/ZFS.py", line 98, in delete_dataset_recursive
    self.delete_dataset_recursive(child)
  File "./iocage/lib/ZFS.py", line 111, in delete_dataset_recursive
    snapshot.delete()
  File "libzfs.pyx", line 2598, in libzfs.ZFSSnapshot.delete
  File "libzfs.pyx", line 2145, in libzfs.ZFSObject.delete
libzfs.ZFSException: dataset already exists
gronke commented 6 years ago

Implementation Requirements

igalic commented 6 years ago

i'm on 1e344cf9c4c3764d46f9b85bb2caaaa9fe8f61f1 and getting a very different traceback here — for both, the used & unused release:

Traceback (most recent call last):
  File "/usr/local/bin/ioc", line 10, in <module>
    sys.dd:exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/destroy.py", line 110, in cli
    if (force and item.running) is True:
AttributeError: 'ReleaseGenerator' object has no attribute 'running'

this is completely unrelated. See https://github.com/iocage/libiocage/issues/363