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

Sync crashes after deck deletion #28

Open
genedan opened this issue Sep 23, 2020 · 2 comments
Open

Sync crashes after deck deletion #28

genedan opened this issue Sep 23, 2020 · 2 comments

Comments

@genedan
Copy link

genedan commented Sep 23, 2020

Reproduction steps:

  1. Delete a deck
  2. Try to sync

I'm using Anki desktop 2.1.33. Upon sync, the dialogue box pops up:

Anki_296

Here's the traceback from the server:

Traceback (most recent call last):
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/thread.py", line 98, in _run
    ret = self.wrapper.execute(func, args, kw, return_queue)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/collection.py", line 45, in execute
    ret = func(*args, **kw)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 574, in run_func
    res = handler_method(**keyword_args)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 126, in applyGraves
    self.remove(chunk)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync.py", line 197, in remove
    self.col.decks.rem(oid, childrenToo=False)
  File "/home/ubuntu/lib/python3.8/site-packages/anki/decks.py", line 125, in rem
    assert cardsToo and childrenToo
AssertionError
Traceback (most recent call last):
  File "/usr/lib/python3.8/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/home/ubuntu/lib/python3.8/site-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)
  File "/home/ubuntu/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 518, in __call__
    result = self._execute_handler_method_in_thread(url, data, session)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 583, in _execute_handler_method_in_thread
    result = thread.execute(run_func, kw=keyword_args)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/thread.py", line 79, in execute
    raise ret
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/thread.py", line 98, in _run
    ret = self.wrapper.execute(func, args, kw, return_queue)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/collection.py", line 45, in execute
    ret = func(*args, **kw)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 574, in run_func
    res = handler_method(**keyword_args)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync_app.py", line 126, in applyGraves
    self.remove(chunk)
  File "/home/ubuntu/anki-sync-server/src/ankisyncd/sync.py", line 197, in remove
    self.col.decks.rem(oid, childrenToo=False)
  File "/home/ubuntu/lib/python3.8/site-packages/anki/decks.py", line 125, in rem
    assert cardsToo and childrenToo
AssertionError
@genedan
Copy link
Author

genedan commented Sep 24, 2020

Just confirmed that the sync also crashes if you have deleted any cards. To replicate, delete a card, and then try to sync:

[2020-09-24 00:32:31,717]:INFO:ankisyncd.CollectionThread[gene]:Running sanityCheck2(*[], **{'client': [[1, 0, 0], 1, 1, 0, 2, 6, 1, 1], 'full': True})
[2020-09-24 00:32:31,718]:INFO:ankisyncd:sanity check failed with server: graves had usn = -1 client: [[1, 0, 0], 1, 1, 0, 2, 6, 1, 1]

cecini added a commit to cecini/anki-sync-server that referenced this issue Oct 30, 2020
cecini added a commit to cecini/anki-sync-server that referenced this issue Oct 30, 2020
in the server,need update graves usn as maxusn
avoid sync serve log: sanity check failed with
server: graves had usn = -1 such as issue ankicommunity#28
second comment
@dobefore
Copy link
Contributor

dobefore commented Nov 3, 2020

Applying PR code now works well

cecini added a commit to cecini/anki-sync-server that referenced this issue Nov 3, 2020
the change intruduced after 3.1.28 f592672fa
cecini added a commit to cecini/anki-sync-server that referenced this issue Nov 3, 2020
once client items in graves have been remove
in the server,need update graves usn as maxusn
avoid sync serve log: sanity check failed with
server: graves had usn = -1 such as issue ankicommunity#28
second comment
cecini added a commit to cecini/anki-sync-server that referenced this issue Nov 3, 2020
in the server,need update graves usn as maxusn
avoid sync serve log: sanity check failed with
server: graves had usn = -1 such as issue ankicommunity#28
second comment
VikashKothary added a commit that referenced this issue Nov 15, 2020
Fix the remove deck lead server crash issue #28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants