[GH-ISSUE #1493] Migration Errors Attempting Dev Branch v0.8.2 #878

Closed
opened 2026-03-01 14:47:00 +03:00 by kerem · 1 comment
Owner

Originally created by @dohlin on GitHub (Aug 22, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1493

Recently installed a fresh v0.7.2 docker compose instance of Archivebox, only transferring over my /data folder from my previous VM (was having some strange issues with my previous install and decided to just try and start fresh). Got things up and running and then just for kicks I decided I would try out v0.8.2, so I did the following:

cd ~/archivebox
[edit docker-compose.yml to archivebox:dev]
docker compose pull
docker compose up

It then gets through a fair number of 'ArchiveResult' migrations that I don't fully understand, but eventually the archivebox container crashes and dies with the following error:

archivebox-1            |    Updating 2169 SnapshotTag.snapshot_id values in place... (may take an hour or longer for large collections...)
archivebox-1            | Migrated 0/2169 SnapshotTag objects...
archivebox-1            | Migrated 100/2169 SnapshotTag objects...
archivebox-1            | Migrated 200/2169 SnapshotTag objects...
archivebox-1            | Migrated 300/2169 SnapshotTag objects...
archivebox-1            | Migrated 400/2169 SnapshotTag objects...
archivebox-1            | Migrated 500/2169 SnapshotTag objects...
archivebox-1            | Migrated 600/2169 SnapshotTag objects...
archivebox-1            | Migrated 700/2169 SnapshotTag objects...
archivebox-1            | Migrated 800/2169 SnapshotTag objects...
archivebox-1            | Migrated 900/2169 SnapshotTag objects...
archivebox-1            | Migrated 1000/2169 SnapshotTag objects...
archivebox-1            | Migrated 1100/2169 SnapshotTag objects...
archivebox-1            | Migrated 1200/2169 SnapshotTag objects...
archivebox-1            | Migrated 1300/2169 SnapshotTag objects...
archivebox-1            | Migrated 1400/2169 SnapshotTag objects...
archivebox-1            | Migrated 1500/2169 SnapshotTag objects...
archivebox-1            | Migrated 1600/2169 SnapshotTag objects...
archivebox-1            | Migrated 1700/2169 SnapshotTag objects...
archivebox-1            | Migrated 1800/2169 SnapshotTag objects...
archivebox-1            | Migrated 1900/2169 SnapshotTag objects...
archivebox-1            | Migrated 2000/2169 SnapshotTag objects...
archivebox-1            | Migrated 2100/2169 SnapshotTag objects...
archivebox-1            |    Updating 1 Tag.id, ArchiveResult.uuid values in place...
archivebox-1            | Traceback (most recent call last):
archivebox-1            |   File "/usr/local/bin/archivebox", line 8, in <module>
archivebox-1            |     sys.exit(main())
archivebox-1            |              ^^^^^^
archivebox-1            |   File "/app/archivebox/cli/__init__.py", line 181, in main
archivebox-1            |     run_subcommand(
archivebox-1            |   File "/app/archivebox/cli/__init__.py", line 118, in run_subcommand
archivebox-1            |     module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
archivebox-1            |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/cli/archivebox_server.py", line 64, in main
archivebox-1            |     server(
archivebox-1            |   File "/app/archivebox/util.py", line 160, in typechecked_function
archivebox-1            |     return func(*args, **kwargs)
archivebox-1            |            ^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/main.py", line 1311, in server
archivebox-1            |     run_subcommand('init', subcommand_args=['--quick'], stdin=None, pwd=out_dir)
archivebox-1            |   File "/app/archivebox/cli/__init__.py", line 118, in run_subcommand
archivebox-1            |     module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
archivebox-1            |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/cli/archivebox_init.py", line 43, in main
archivebox-1            |     init(
archivebox-1            |   File "/app/archivebox/util.py", line 160, in typechecked_function
archivebox-1            |     return func(*args, **kwargs)
archivebox-1            |            ^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/main.py", line 356, in init
archivebox-1            |     for migration_line in apply_migrations(out_dir):
archivebox-1            |                           ^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/util.py", line 160, in typechecked_function
archivebox-1            |     return func(*args, **kwargs)
archivebox-1            |            ^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/app/archivebox/index/sql.py", line 156, in apply_migrations
archivebox-1            |     call_command("migrate", interactive=False, stdout=out)
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
archivebox-1            |     return command.execute(*args, **defaults)
archivebox-1            |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute
archivebox-1            |     output = self.handle(*args, **options)
archivebox-1            |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 107, in wrapper
archivebox-1            |     res = handle_func(*args, **kwargs)
archivebox-1            |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 357, in handle
archivebox-1            |     post_migrate_state = executor.migrate(
archivebox-1            |                          ^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate
archivebox-1            |     state = self._migrate_all_forwards(
archivebox-1            |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
archivebox-1            |     state = self.apply_migration(
archivebox-1            |             ^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 255, in apply_migration
archivebox-1            |     state = migration.apply(state, schema_editor)
archivebox-1            |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply
archivebox-1            |     operation.database_forwards(
archivebox-1            |   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/operations/special.py", line 196, in database_forwards
archivebox-1            |     self.code(from_state.apps, schema_editor)
archivebox-1            |   File "/app/archivebox/core/migrations/0059_tag_id.py", line 53, in update_archiveresult_ids
archivebox-1            |     assert tag.name
archivebox-1            |            ^^^^^^^^
archivebox-1            | AssertionError
archivebox-1 exited with code 1

image

Any thoughts on what might be going on here? Thanks!!

Originally created by @dohlin on GitHub (Aug 22, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1493 Recently installed a fresh v0.7.2 docker compose instance of Archivebox, only transferring over my /data folder from my previous VM (was having some strange issues with my previous install and decided to just try and start fresh). Got things up and running and then just for kicks I decided I would try out v0.8.2, so I did the following: ```bash cd ~/archivebox [edit docker-compose.yml to archivebox:dev] docker compose pull docker compose up ``` It then gets through a fair number of 'ArchiveResult' migrations that I don't fully understand, but eventually the archivebox container crashes and dies with the following error: ```logs archivebox-1 | Updating 2169 SnapshotTag.snapshot_id values in place... (may take an hour or longer for large collections...) archivebox-1 | Migrated 0/2169 SnapshotTag objects... archivebox-1 | Migrated 100/2169 SnapshotTag objects... archivebox-1 | Migrated 200/2169 SnapshotTag objects... archivebox-1 | Migrated 300/2169 SnapshotTag objects... archivebox-1 | Migrated 400/2169 SnapshotTag objects... archivebox-1 | Migrated 500/2169 SnapshotTag objects... archivebox-1 | Migrated 600/2169 SnapshotTag objects... archivebox-1 | Migrated 700/2169 SnapshotTag objects... archivebox-1 | Migrated 800/2169 SnapshotTag objects... archivebox-1 | Migrated 900/2169 SnapshotTag objects... archivebox-1 | Migrated 1000/2169 SnapshotTag objects... archivebox-1 | Migrated 1100/2169 SnapshotTag objects... archivebox-1 | Migrated 1200/2169 SnapshotTag objects... archivebox-1 | Migrated 1300/2169 SnapshotTag objects... archivebox-1 | Migrated 1400/2169 SnapshotTag objects... archivebox-1 | Migrated 1500/2169 SnapshotTag objects... archivebox-1 | Migrated 1600/2169 SnapshotTag objects... archivebox-1 | Migrated 1700/2169 SnapshotTag objects... archivebox-1 | Migrated 1800/2169 SnapshotTag objects... archivebox-1 | Migrated 1900/2169 SnapshotTag objects... archivebox-1 | Migrated 2000/2169 SnapshotTag objects... archivebox-1 | Migrated 2100/2169 SnapshotTag objects... archivebox-1 | Updating 1 Tag.id, ArchiveResult.uuid values in place... archivebox-1 | Traceback (most recent call last): archivebox-1 | File "/usr/local/bin/archivebox", line 8, in <module> archivebox-1 | sys.exit(main()) archivebox-1 | ^^^^^^ archivebox-1 | File "/app/archivebox/cli/__init__.py", line 181, in main archivebox-1 | run_subcommand( archivebox-1 | File "/app/archivebox/cli/__init__.py", line 118, in run_subcommand archivebox-1 | module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/cli/archivebox_server.py", line 64, in main archivebox-1 | server( archivebox-1 | File "/app/archivebox/util.py", line 160, in typechecked_function archivebox-1 | return func(*args, **kwargs) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/main.py", line 1311, in server archivebox-1 | run_subcommand('init', subcommand_args=['--quick'], stdin=None, pwd=out_dir) archivebox-1 | File "/app/archivebox/cli/__init__.py", line 118, in run_subcommand archivebox-1 | module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/cli/archivebox_init.py", line 43, in main archivebox-1 | init( archivebox-1 | File "/app/archivebox/util.py", line 160, in typechecked_function archivebox-1 | return func(*args, **kwargs) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/main.py", line 356, in init archivebox-1 | for migration_line in apply_migrations(out_dir): archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/util.py", line 160, in typechecked_function archivebox-1 | return func(*args, **kwargs) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/app/archivebox/index/sql.py", line 156, in apply_migrations archivebox-1 | call_command("migrate", interactive=False, stdout=out) archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command archivebox-1 | return command.execute(*args, **defaults) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute archivebox-1 | output = self.handle(*args, **options) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 107, in wrapper archivebox-1 | res = handle_func(*args, **kwargs) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 357, in handle archivebox-1 | post_migrate_state = executor.migrate( archivebox-1 | ^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate archivebox-1 | state = self._migrate_all_forwards( archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards archivebox-1 | state = self.apply_migration( archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 255, in apply_migration archivebox-1 | state = migration.apply(state, schema_editor) archivebox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply archivebox-1 | operation.database_forwards( archivebox-1 | File "/usr/local/lib/python3.11/site-packages/django/db/migrations/operations/special.py", line 196, in database_forwards archivebox-1 | self.code(from_state.apps, schema_editor) archivebox-1 | File "/app/archivebox/core/migrations/0059_tag_id.py", line 53, in update_archiveresult_ids archivebox-1 | assert tag.name archivebox-1 | ^^^^^^^^ archivebox-1 | AssertionError archivebox-1 exited with code 1 ``` ![image](https://github.com/user-attachments/assets/0da816cc-9f11-4bb9-971f-e2a78d90ffb6) Any thoughts on what might be going on here? Thanks!!
kerem 2026-03-01 14:47:00 +03:00
Author
Owner

@pirate commented on GitHub (Aug 22, 2024):

It's complaining that you have a Tag with an empty name=``. I recommend deleting that Tag in the Admin UI as it will only cause problems, but in the meantime I also just pushed a code fix for this edge case 1d31b88f and updated v0.8.2-rc.

Thanks for helping test the beta release!

You can pull the latest :dev build and re-run to get the fix. It should pick up the migrations were it left off without issue:

docker compose pull archivebox
docker compose down
docker compose up

Comment back if you encounter any other issues and I'll reopen the ticket.

<!-- gh-comment-id:2305916698 --> @pirate commented on GitHub (Aug 22, 2024): It's complaining that you have a Tag with an empty name=``. I recommend deleting that Tag in the Admin UI as it will only cause problems, but in the meantime I also just pushed a code fix for this edge case 1d31b88f and updated v0.8.2-rc. Thanks for helping test the beta release! You can pull the latest `:dev` build and re-run to get the fix. It should pick up the migrations were it left off without issue: ``` docker compose pull archivebox docker compose down docker compose up ``` Comment back if you encounter any other issues and I'll reopen the ticket.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#878
No description provided.