pimutils / pimutils/vdirsyncer

Improve error message for when status db is locked

Open
#720 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: ui good first issue ready type: enhancement
Dominant language
Python
Stars
1.9k
Forks
185
Avg merge
11h 49m
Merged PRs (30d)
1

Description

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')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing path in vdirsyncer/cli/tasks.py and vdirsyncer/cli/utils.py, then inspect SqliteStatus and _exclusive_transaction in vdirsyncer/sync/status.py. Reproduce the locked status-database failure and determine the expected improved error message; done means the failure reports the problem clearly without obscuring the original context.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.