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

Serialization: Snippet folders and Collections collide on dump because of missing namespace separation #14910

Closed
flamber opened this issue Feb 20, 2021 · 2 comments · Fixed by #15858
Assignees
Labels
Operation/Serialization Enterprise contents migration Priority:P2 Average run of the mill bug Type:Bug Product defects
Milestone

Comments

@flamber
Copy link
Contributor

flamber commented Feb 20, 2021

Describe the bug
If there's a Collection and a Snippet Folder with the same name, then only one of them is created, and the order (ID) in the database will determine which will be overridden, and that causes questions (or potentially snippets) not to be transferred.

To Reproduce (very important with the order of when items are created)

  1. Create a collection called "Marketing"
  2. Create a question and save it inside of "Marketing"-collection
  3. Create a snippet folder called "Marketing"
  4. Create a snippet and save it inside of "Marketing"-folder
  5. Serialization dump - notice that the collection-yaml for "Marketing" is namespace: snippets and it has the question-yaml inside of it. There's no snippet-yaml, but that's Serialization: Snippets are not transferred correctly, leading to incorrect references and broken queries #14909.
  6. Serialization load will give the following error, which is correct, but there was no errors/warnings during dump that different items was overwriting each other:
    `ERROR serialization.upsert :: Error inserting metabase.models.card.CardInstance@6b213571 "My Question in Marketing-collection": A Card can only go in Collections in the "default" namespace.

Expected behavior
Not sure if serialization-dump/collections/root/collections should have a sub-directory for each namespace, or if snippet folders should have it's own parent directory like serialization-dump/collections/root/snippet-folders, but they shouldn't overlap.

Information about your Metabase Installation:
Only tested 1.37.9 because #14907 made it even more confusing.

Additional context
Should probably be fixed together with #14909, since snippets are not transferred at all, and this just leads to more confusion.

@flamber flamber added Type:Bug Product defects Priority:P2 Average run of the mill bug Operation/Serialization Enterprise contents migration labels Feb 20, 2021
@rlotun rlotun mentioned this issue Apr 28, 2021
5 tasks
@jeff303
Copy link
Contributor

jeff303 commented May 7, 2021

Commit 5 under #15858 should fix this one.

@jeff303 jeff303 linked a pull request May 7, 2021 that will close this issue
17 tasks
@jeff303 jeff303 self-assigned this May 11, 2021
@rlotun rlotun added this to the 0.39.3 milestone May 18, 2021
@flamber
Copy link
Contributor Author

flamber commented May 27, 2021

Fixed by #15858 - will be part of 1.39.3

@flamber flamber closed this as completed May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Operation/Serialization Enterprise contents migration Priority:P2 Average run of the mill bug Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants