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

Improve error message for when status db is locked #720

Open
aleprovencio opened this issue Feb 19, 2018 · 11 comments
Open

Improve error message for when status db is locked #720

aleprovencio opened this issue Feb 19, 2018 · 11 comments

Comments

@aleprovencio
Copy link

aleprovencio commented Feb 19, 2018

Hello, lately I can't successfully vdirsyncer sync my calendars because of a
database is locked error. Synchronization works fine with android's davdroid which talks with the same server.

Your vdirsyncer version: 0.16.4
If applicable, which server software (and which version) you're using: Nextcloud 13
Your Python version: 3.6.4
Your operating system: Arch linux
Relevant debug output:

Syncing my_calendars/jucy
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/cli/tasks.py", line 63, in sync_collection
debug:     collection.name) as status:
debug:   File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/cli/utils.py", line 227, in manage_sync_status
debug:     status = SqliteStatus(path)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 119, in __init__
debug:     self._update_schema()
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 127, in _update_schema
debug:     with _exclusive_transaction(self._c) as c:
debug:   File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 13, in _exclusive_transaction
debug:     c = conn.execute('BEGIN EXCLUSIVE TRANSACTION')
Syncing my_calendars/personal
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/cli/tasks.py", line 63, in sync_collection
debug:     collection.name) as status:
debug:   File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/cli/utils.py", line 227, in manage_sync_status
debug:     status = SqliteStatus(path)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 119, in __init__
debug:     self._update_schema()
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 127, in _update_schema
debug:     with _exclusive_transaction(self._c) as c:
debug:   File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/status.py", line 13, in _exclusive_transaction
debug:     c = conn.execute('BEGIN EXCLUSIVE TRANSACTION')
@aleprovencio
Copy link
Author

Not happening anymore, don't know why.
Sorry about the noise.

@untitaker
Copy link
Member

Need to improve error message, reopening as reminder for follow-up issue. If you experience this again, you need to delete a special file in your status directory. I can't think of the exact name at the moment. Sorry for the slow response.

@christf
Copy link

christf commented Feb 22, 2018

I have this as well. which file should I delete?

@untitaker
Copy link
Member

untitaker commented Feb 23, 2018 via email

@untitaker
Copy link
Member

untitaker commented Feb 25, 2018 via email

@untitaker untitaker changed the title Locked database error Improve error message for when status db is locked Mar 3, 2018
@christf
Copy link

christf commented Mar 4, 2018

@untitaker thank you - I did that
cd .vdirsyncer
find . -type f -name "*-journal" -exec rm {} ;
and it worked.

@bepolymathe
Copy link

@untitaker Same problem but it change nothing delete *-journal file in the status dir

@j605
Copy link

j605 commented Jan 30, 2019

I have the same error but there are no -journal files in the status directory. For the three tasks that fail I get

debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/cli/tasks.py", line 63, in sync_collection
debug:     collection.name) as status:
debug:   File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/cli/utils.py", line 227, in manage_sync_status
debug:     status = SqliteStatus(path)
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/sync/status.py", line 119, in __init__
debug:     self._update_schema()
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/sync/status.py", line 127, in _update_schema
debug:     with _exclusive_transaction(self._c) as c:
debug:   File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
debug:     return next(self.gen)
debug:   File "/usr/lib/python3.7/site-packages/vdirsyncer/sync/status.py", line 13, in _exclusive_transaction
debug:     c = conn.execute('BEGIN EXCLUSIVE TRANSACTION')
error: 3 out of 11 tasks failed.

Any idea what can be done? I only have .collections and .items in the status directory.

Edit: Used https://stackoverflow.com/a/3481134. I had to kill a stray vdirsyncer process.

@doug-letough
Copy link

doug-letough commented Aug 20, 2019

Same here after a connection loss.
Removing all items files did the trick:

find ./ -type f -name "*.items*" -exec rm {} \;

@surajsharma
Copy link

I had to kill a stray vdirsyncer process.

this did it for me

@dchersey
Copy link

same here ... ps -ef | grep vdir showed the process and kill -9 (pid) did the deed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants