The Wayback Machine - https://web.archive.org/web/20201010005456/https://github.com/pimutils/vdirsyncer/issues/720
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 · 9 comments
Open

Improve error message for when status db is locked #720

aleprovencio opened this issue Feb 19, 2018 · 9 comments

Comments

@aleprovencio
Copy link

@aleprovencio 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

@aleprovencio aleprovencio commented Feb 20, 2018

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

@untitaker untitaker reopened this Feb 20, 2018
@untitaker
Copy link
Member

@untitaker untitaker commented Feb 20, 2018

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 christf commented Feb 22, 2018

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

@untitaker
Copy link
Member

@untitaker untitaker commented Feb 23, 2018

@untitaker
Copy link
Member

@untitaker untitaker commented Feb 25, 2018

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

@christf 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

@bepolymathe bepolymathe commented Jan 7, 2019

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

@j605
Copy link

@j605 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 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 {} \;

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.