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

[BUG] database is locked - when writing to external storage #26

Open
Tiptop4792 opened this issue Nov 12, 2024 · 6 comments
Open

[BUG] database is locked - when writing to external storage #26

Tiptop4792 opened this issue Nov 12, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Tiptop4792
Copy link

Hey! Thanks for the previous fix! Sorry to bother again ...

The previous fix works when files are written to local storage.

I just wanted to start a larger download and save it to an external storage via the -o operator. It worked with previous versions, however now, it reads:


!-- Exception: UNCAUGHT EXCEPTION
!-- File: waybackdownloaderEnvironment/lib/python3.10/site-packages/pywaybackup/db.py
!-- Function: init
!-- Line: 39
!-- Segment: db.cursor.execute(cls.waybackup_table)
!-- Description: database is locked

I'm on waybackup 2.0.3 running Ubuntu 22.04 and Python 3.10.12

Any idea what's causing this?

Many thanks!

@Tiptop4792 Tiptop4792 added the bug Something isn't working label Nov 12, 2024
@Tiptop4792
Copy link
Author

Tiptop4792 commented Nov 12, 2024

Some more info from the error log


Version: 2.0.3

Command: -u example.com -f --start 20130101 --end 20181231 -o /home/xyz/Documents/data/wayback-site/ --retry 1 --workers 6 --keep --progress

2024-11-12 14:01:44

!-- Exception: UNCAUGHT EXCEPTION
!-- File: waybackdownloaderEnvironment/lib/python3.10/site-packages/pywaybackup/db.py
!-- Function: init
!-- Line: 39
!-- Segment: db.cursor.execute(cls.waybackup_table)
!-- Description: database is locked

!-- Local Variables:
-- cls = <class 'pywaybackup.db.Database'>
-- dbfile = ../../Documents/data/wayback-site/waybackup_example.com.db
-- query_identifier = example.com{'current': False, 'full': True, 'save': False}{'explicit': False, 'range': None, 'start': 20130101, 'end': 20181231, 'filetype': None, 'limit': None}
-- db = <pywaybackup.db.Database object at 0x79f6da163520>

Traceback (most recent call last):
File "waybackdownloaderEnvironment/bin/waybackup", line 8, in
sys.exit(main())
File "waybackdownloaderEnvironment/lib/python3.10/site-packages/pywaybackup/main.py", line 19, in main
db.init(config.dbfile, config.query_identifier)
File "waybackdownloaderEnvironment/lib/python3.10/site-packages/pywaybackup/db.py", line 39, in init
db.cursor.execute(cls.waybackup_table)
sqlite3.OperationalError: database is locked

@bitdruid
Copy link
Owner

bitdruid commented Nov 12, 2024

your external storage is a hdd / pendrive ? with a regular mountpoint for example like mount /dev/sda /mnt/storage ? just asking so i can reproduce :)

edit:
my first thought is a permission problem. have you tried as root?

@Tiptop4792
Copy link
Author

Thanks for looking into this. It's cloud based, but yeah, it's mounted at /mounts/data and then symlinked.

When running with sudo the error message reads

sudo: waybackup: command not found

I thought about permissions, too. However, the same dir path worked with previous versions of the tool, when there wasn't a DB.

@bitdruid
Copy link
Owner

did some tests now. do you install the tool via virtual-env or --break-system-packages? tried it with a mounted usb-storage and was not able to set up the database as standard user. but sudo did it.

if you want to use the tool via sudo you have to source into your virtual-env with sudo or otherwise do a pip install as root.

did the database exist before you started the tool (again)? if so, maybe there is a problem with remaining LOCKS after keyboard-interrupt or something similar...

@bitdruid bitdruid self-assigned this Nov 22, 2024
@Tiptop4792
Copy link
Author

I install via virtual-env. Will try with sudo. Hopefully next week! Thanks so much for testing!

@bitdruid
Copy link
Owner

in addition please briefly describe your connected cloud storage. what kind? mountpoint? permissions? (ls -la) was it a new run without an already existing db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants