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 server cannot add new collections #91

Open
LumenYoung opened this issue May 14, 2021 · 3 comments
Open

Sync server cannot add new collections #91

LumenYoung opened this issue May 14, 2021 · 3 comments

Comments

@LumenYoung
Copy link

LumenYoung commented May 14, 2021

Hello, I am new to anki and find this project. I successfully deployed this project but find the server would crash if I try to add a group in one user or sync from a client with multiple card groups. Below is what happen in the server side when I try to sync multiple collections.

The reproduce is quiet simple. Just clone from the git, add user and run the server. just login and add whatever new collection in the client. Then the problem would occur when you press sync. This leads to the crash of the whole server. Personally I cannot believe that you users never use multiple collections. So I think its some bug and there is a fix. Worth noticing is that my python is 3.8, I didn't use a python2 for this project because it says its python3 compatible.

Any reply is appreciated and thank you for this project.

[2021-05-14 13:38:31,559]:INFO:ankisyncd.CollectionThread[yang]:Running meta([], **{'v': 10, 'cv': 'anki,2.1.44 (b2b3275f),lin:pop:20.10'})
[2021-05-14 13:38:31,561]:INFO:ankisyncd.http:192.168.3.74 "POST /sync/meta HTTP/1.1" 200 139
[2021-05-14 13:38:31,604]:INFO:ankisyncd.CollectionThread[yang]:Running start(
[], **{'minUsn': 2, 'lnewer': True, 'graves': None})
[2021-05-14 13:38:31,605]:ERROR:ankisyncd.CollectionThread[yang]:Unable to start(*[], **{'minUsn': 2, 'lnewer': True, 'graves': None}): 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/home/yang/anki-sync-server/src/ankisyncd/thread.py", line 98, in _run
ret = self.wrapper.execute(func, args, kw, return_queue)
File "/home/yang/anki-sync-server/src/ankisyncd/collection.py", line 45, in execute
ret = func(*args, **kw)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 579, in run_func
res = handler_method(**keyword_args)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 124, in start
self.remove(graves)
File "/home/yang/anki-sync-server/src/ankisyncd/sync.py", line 189, in remove
self.col.remove_cards_and_orphaned_notes(graves['cards'])
TypeError: 'NoneType' object is not subscriptable
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/yang/.local/lib/python3.8/site-packages/webob/dec.py", line 129, in call
resp = self.call_func(req, *args, **kw)
File "/home/yang/.local/lib/python3.8/site-packages/webob/dec.py", line 193, in call_func
return self.func(req, *args, **kwargs)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 523, in call
result = self._execute_handler_method_in_thread(url, data, session)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 588, in _execute_handler_method_in_thread
result = thread.execute(run_func, kw=keyword_args)
File "/home/yang/anki-sync-server/src/ankisyncd/thread.py", line 79, in execute
raise ret
File "/home/yang/anki-sync-server/src/ankisyncd/thread.py", line 98, in _run
ret = self.wrapper.execute(func, args, kw, return_queue)
File "/home/yang/anki-sync-server/src/ankisyncd/collection.py", line 45, in execute
ret = func(*args, **kw)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 579, in run_func
res = handler_method(**keyword_args)
File "/home/yang/anki-sync-server/src/ankisyncd/sync_app.py", line 124, in start
self.remove(graves)
File "/home/yang/anki-sync-server/src/ankisyncd/sync.py", line 189, in remove
self.col.remove_cards_and_orphaned_notes(graves['cards'])
TypeError: 'NoneType' object is not subscriptable
[2021-05-14 13:38:31,613]:INFO:ankisyncd.http:192.168.3.74 "POST /sync/start HTTP/1.1" 500 59
[2021-05-14 13:38:31,677]:INFO:ankisyncd.http:192.168.3.74 "POST /sync/abort HTTP/1.1" 404 154

@LumenYoung LumenYoung changed the title Sync server cannot add new group of cards Sync server cannot add new collections May 14, 2021
@dobefore
Copy link
Contributor

Anki ver 2.1.44 is not yet supported ,please return back to this site sometimes to see its status .

@dobefore
Copy link
Contributor

apply PR #94 , #83 ,Then it works

@LumenYoung
Copy link
Author

apply PR #94 , #83 ,Then it works

Thank you for your contribution! I'll try it later. Right now I'm using the docker vision of sync server, which is not the latest but works.

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