Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"incus storage volume import": name clash gives an unfriendly SQL error #663

Closed
candlerb opened this issue Mar 25, 2024 · 0 comments
Closed
Assignees
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Milestone

Comments

@candlerb
Copy link
Contributor

Required information

Incus 0.6, Ubuntu 22.04

Issue description

Importing a storage volume where the name already exists gives a SQL uniqueness constraint error.

It would be better if it said "a volume with this name already exists", or similar.

Steps to reproduce

  1. Export a storage volume
  2. Immediately re-import it without giving it a different name.
$ incus storage volume import default default_testzfs.tgz
Error: Create custom volume from backup: Error inserting volume "testzfs" for project "default" in pool "default" of type "custom" into database "UNIQUE constraint failed: index 'storage_volumes_unique_storage_pool_id_node_id_project_id_name_type'"

Of course, it's fine if you choose a different name:

$ incus storage volume import default default_testzfs.tgz test1
$ 
@stgraber stgraber self-assigned this Mar 25, 2024
@stgraber stgraber added Bug Confirmed to be a bug Easy Good for new contributors labels Mar 25, 2024
@stgraber stgraber added this to the incus-0.7 milestone Mar 25, 2024
stgraber added a commit to stgraber/incus that referenced this issue Mar 25, 2024
@hallyn hallyn closed this as completed in 21d8d42 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Development

No branches or pull requests

2 participants