[go: up one dir, main page]

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

Migration Errors Attempting Dev Branch v0.8.2 #1493

Closed
dohlin opened this issue Aug 22, 2024 · 1 comment
Closed

Migration Errors Attempting Dev Branch v0.8.2 #1493

dohlin opened this issue Aug 22, 2024 · 1 comment
Labels
size: easy status: done Work is completed and released (or scheduled to be released in the next version) type: bug report

Comments

@dohlin
Copy link
dohlin commented Aug 22, 2024

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!!

@pirate
Copy link
Member
pirate commented 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 1d31b88 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.

@pirate pirate closed this as completed Aug 22, 2024
@pirate pirate added type: bug report size: easy status: done Work is completed and released (or scheduled to be released in the next version) labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: easy status: done Work is completed and released (or scheduled to be released in the next version) type: bug report
Projects
None yet
Development

No branches or pull requests

2 participants