‘Bucket does not exist’ errors importing from Vikunja export

While attempting to import (on v0.24.6) an export from another Vikunja instance, I see these errors in the log. They appear to possibly be caused by using the old bucket ID when processing a related task?

2024-12-22T22:32:58-07:00: DEBUG	▶ 480 [Vikunja File Import] Importing a zip file containing 5 files
2024-12-22T22:32:58-07:00: DEBUG	▶ 481 [Vikunja File Import] Found a data file
2024-12-22T22:32:58-07:00: DEBUG	▶ 482 [Vikunja File Import] Found a blob file
2024-12-22T22:32:58-07:00: DEBUG	▶ 483 [Vikunja File Import] Found a filter file
2024-12-22T22:32:58-07:00: DEBUG	▶ 484 [Vikunja File Import] Found a blob file
2024-12-22T22:32:58-07:00: DEBUG	▶ 485 [Vikunja File Import] Found a version file
2024-12-22T22:32:58-07:00: DEBUG	▶ 486 [Vikunja File Import] 
2024-12-22T22:32:58-07:00: DEBUG	▶ 487 [creating structure] Creating 2 projects
2024-12-22T22:32:58-07:00: DEBUG	▶ 48a [creating structure] Created project 12
2024-12-22T22:32:58-07:00: DEBUG	▶ 48b [creating structure] Creating 1 buckets
2024-12-22T22:32:58-07:00: DEBUG	▶ 492 [creating structure] Created bucket 22, old ID was 26
2024-12-22T22:32:58-07:00: DEBUG	▶ 496 Sending project created notifications to 0 subscribers for project 12
2024-12-22T22:32:58-07:00: DEBUG	▶ 4ae [creating structure] Creating 30 tasks
2024-12-22T22:32:58-07:00: DEBUG	▶ 4bd [creating structure] Created task 31
2024-12-22T22:32:58-07:00: DEBUG	▶ 4cf [creating structure] Created new label 11
2024-12-22T22:32:58-07:00: DEBUG	▶ 4e2 [creating structure] Associated task 31 with label 11
2024-12-22T22:32:58-07:00: DEBUG	▶ 4e6 Did not find any webhook for the task.updated event for project 12, not sending
2024-12-22T22:32:58-07:00: DEBUG	▶ 4f4 Did not find any webhook for the task.updated event for project 12, not sending
2024-12-22T22:32:58-07:00: DEBUG	▶ 4fe [creating structure] Created task 32
2024-12-22T22:32:58-07:00: DEBUG	▶ 4ff [creating structure] Creating 1 related task kinds
2024-12-22T22:32:58-07:00: DEBUG	▶ 500 [creating structure] Creating 1 related tasks for kind parenttask
2024-12-22T22:32:58-07:00: DEBUG	▶ 516 Did not find any webhook for the task.updated event for project 12, not sending
2024-12-22T22:32:58-07:00: ERROR	▶ 51b [creating structure] Error while creating structure: Bucket does not exist [BucketID: 26]
2024-12-22T22:32:58-07:00: ERROR	▶ 51c could not insert data: Bucket does not exist [BucketID: 26]

The first task (31), which was created successfully, had no related tasks. The second task (32) and third task (33, not mentioned in log) were related, but that relation was not restored. Manually deleting all related_tasks entries in the export allowed it to be imported successfully, albeit without any relations!

(Note, it is not possible due to external reasons to update the exporting server, running v0.21.0, thus why I’m moving my data to another instance.)

I also noticed that the import breaks (converting empty string to int) if there’s a directory entry (files/) in the zip file, meaning zip -r new.zip * doesn’t work, needs zip -rD new.zip * or so. This makes it more fragile in case someone crazy wants to modify it before importing :slight_smile: A simple skip if the name is exactly files/ around pkg/modules/migration/vikunja-file/vikunja.go line 80 would prevent that…

I think we have fixed something similar recently. Can you check if the same problem happens with an unstable build?

Well, since it’s not really meant to do that, we didn’t pay attention to that. If you want to add this, I’d love a PR.

Unstable version of both Dec 22 (41406f6589342bb92a23ed789661ef10297edbfaaf6645fc0803635718c77918) and today (3853eb0a5319deeea706e1adc14da3fc9ee7102c8c6fb4747b91181b964cccf5) don’t respond and cause gateway timeout with no logs.

(Is it intended that the unstable version identifies itself as v0.24.1-617-b8fd5dde3b???)

2024-12-30T13:07:37-07:00: INFO	▶ 001 Using config file: /home/vikunja/config.yml
2024-12-30T13:07:37-07:00: INFO	▶ 002 Running migrations…
2024-12-30T13:07:37-07:00: INFO	▶ 06d Ran all migrations successfully.
2024-12-30T13:07:37-07:00: DEBUG	▶ 06e [Task Reminder Cron] Timezone is America/Denver
2024-12-30T13:07:37-07:00: INFO	▶ 06f Vikunja version v0.24.1-617-b8fd5dde3b
[try to load it]
2024-12-30T13:08:00-07:00: DEBUG	▶ 0eb [Task Reminder Cron] Looking for reminders between 2024-12-30 13:08:00 -0700 MST and 2024-12-30 13:09:00 -0700 MST to send...
2024-12-30T13:08:00-07:00: DEBUG	▶ 0ee [Task Reminder Cron] Found 0 reminders
2024-12-30T13:08:00-07:00: DEBUG	▶ 0f1 [Undone Overdue Tasks Reminder] Sending reminders to 0 users
[... browser eventually shows 504]

Also…
vikunja-unstable-linux-amd64-full.zip 100%[==========================================================================================================================================================================>] 31.39M 163KB/s in 3m 12s

When you’re importing a dump?