mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #393] Bugfix: ... #260
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jamescochran on GitHub (Jul 29, 2020).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/393
Describe the bug
On a fresh install when I run archivebox init I get the error
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (database is locked)Steps to reproduce
Setup a new vanilla TurnKey Core VM. Got pip installed and setuputils so I could run pip install archivebox. Then did a archivebox init as my non root user.
Screenshots or log output
File "/usr/local/lib/python3.7/dist-packages/django/db/backends/base/base.py", line 243, in _commit
return self.connection.commit()
django.db.utils.OperationalError: database is locked
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/archivebox", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/archivebox/cli/init.py", line 126, in main
pwd=pwd or OUTPUT_DIR,
File "/usr/local/lib/python3.7/dist-packages/archivebox/cli/init.py", line 62, in run_subcommand
module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore
File "/usr/local/lib/python3.7/dist-packages/archivebox/cli/archivebox_init.py", line 35, in main
out_dir=pwd or OUTPUT_DIR,
File "/usr/local/lib/python3.7/dist-packages/archivebox/util.py", line 109, in typechecked_function
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/archivebox/main.py", line 296, in init
for migration_line in apply_migrations(out_dir):
File "/usr/local/lib/python3.7/dist-packages/archivebox/util.py", line 109, in typechecked_function
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/archivebox/index/sql.py", line 81, in apply_migrations
call_command("migrate", interactive=False, stdout=out)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/init.py", line 168, in call_command
return command.execute(*args, **defaults)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/commands/migrate.py", line 233, in handle
fake_initial=fake_initial,
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/executor.py", line 91, in migrate
self.recorder.ensure_schema()
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/recorder.py", line 69, in ensure_schema
raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (database is locked)
Software versions
@jamescochran commented on GitHub (Jul 29, 2020):
It looks like it works fine if I'm in a folder in my home directory. I had mounted a cifs share back to my main server and was running archivebox init there since it has much more space and that's where I want everything stored. Permissions seems fine... I can create files. archivebox init created several files on the share. But I continue to get the database is locked error if I try to run from within a network share.
@jamescochran commented on GitHub (Jul 29, 2020):
I solved this by adding 'nolock' to my line in /etc/fstab
@pirate commented on GitHub (Jul 29, 2020):
Yeah ArchiveBox is very strict about locking its indexes on the filesystem before writing to them, we've had bad pexperiences in the past with index corruption due to race conditions between processes.
If you disable filesystem locking I recommend not running more than one aarchivebox process at a time until v0.5 when we remove the json main index in favor of pure sqlite.