Giter Club home page Giter Club logo

Comments (6)

VikashKothary avatar VikashKothary commented on July 24, 2024 1

Hi @MacKenia,

It looks like this line here is causing the issue for you:

https://github.com/ankicommunity/anki-sync-server/blob/35cf66d403e89b39f8a7023a367b086530334d3f/src/ankisyncd/sync_app.py#L536

I've not seen this error before and it looks like AnkiDesktop version 2.1.65 was released on 21st May 2023. I wonder if there's a change in the latest release that breaks our syncing or if it's just a issue that we've missed.

My AnkiDesktop is a bit older so I'll try and update it to see if I can reproduce this issue.
If anyone else has gotten AnkiDesktop 2.1.65 working, please let me know.

In the meantime, I don't know your background but would you know how to add a print statement in the code to better understand what is causing that line to break?

from ankicommunity-sync-server.

VikashKothary avatar VikashKothary commented on July 24, 2024 1

I feel like this issue might be related to this issue: #158.

There seems to be a new sync protocol that this server doesn't support yet. So I would suggest either using a AnkiDesktop version before 2.1.57 to see if that fixes your issue.

The issue above also linked to the new official sync server which might interest you.

Let me know what you end up doing while I try to investigate this further.

from ankicommunity-sync-server.

sarsamurmu avatar sarsamurmu commented on July 24, 2024 1

You can try the built-in sync server - https://docs.ankiweb.net/sync-server.html

from ankicommunity-sync-server.

MacKenia avatar MacKenia commented on July 24, 2024 1

@sarsamurmu Thanks, It really solve my problem!

from ankicommunity-sync-server.

MacKenia avatar MacKenia commented on July 24, 2024

@VikashKothary

Thanks for your reply.
I add this line above the position you told me and I try again I receive this log:

repeat:b'(\xb5/\xfd\x00X\xcd\x00\x00\x98{"u":"mackenia","p}\x01\x00\x84\x9ba'
body:b'(\xb5/\xfd\x00X\xcd\x00\x00\x98{"u":"mackenia","p}\x01\x00\x84\x9ba'
Traceback (most recent call last):
  File "/usr/lib/python3.10/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/home/asus/anki-sync-server/src/ankisyncd/sync_app.py", line 586, in __call__
    w = self.__wrapped__(*args, **kwargs)
  File "/home/asus/anki-sync-server/src/ankisyncd/sync_app.py", line 687, in __call__
    req.params = req.parse
  File "/home/asus/anki-sync-server/src/ankisyncd/sync_app.py", line 537, in parse
    items = re.split(repeat, body)
  File "/usr/lib/python3.10/re.py", line 230, in split
    return _compile(pattern, flags).split(string, maxsplit)
  File "/usr/lib/python3.10/re.py", line 303, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.10/sre_compile.py", line 788, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.10/sre_parse.py", line 955, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.10/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.10/sre_parse.py", line 843, in _parse
    raise source.error("missing ), unterminated subpattern",
re.error: missing ), unterminated subpattern at position 0
[2023-07-20 22:10:11,100]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/hostKey HTTP/1.1" 500 59

The Code i add:

print(f"repeat:{repeat}\nbody:{body}") # <<< ADD HERE
items = re.split(repeat, body) 

This is a piece of ankiDroid's sync log:

repeat:b'--Anki-sync-boundary'
body:b'--Anki-sync-boundary\r\nContent-Disposition: form-data; name="v"\r\n\r\nankidroid,2.15.6,android:13:MI 9\r\n--Anki-sync-boundary\r\nContent-Disposition: form-data; name="k"\r\n\r\n03ea215ee842558c1e74239c0948fb41\r\n--Anki-sync-boundary\r\nContent-Disposition: form-data; name="c"\r\n\r\n1\r\n--Anki-sync-boundary\r\nContent-Disposition: form-data; name="data"; filename="data"\r\nContent-Type: application/octet-stream\r\n\r\n\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00\xab\xae\x05\x00C\xbf\xa6\xa3\x02\x00\x00\x00\r\n--Anki-sync-boundary--\r\n'
[2023-07-20 22:19:18,909]:INFO:ankisyncd.CollectionThread[mackenia]:Running begin(*[], **{'skey': '60fb8a6c'})
[2023-07-20 22:19:18,910]:INFO:ankisyncd.http:127.0.0.1 "POST /msync/begin HTTP/1.1" 200 52

And I also tried lower version like 2.1.63 and the problem stills there.

from ankicommunity-sync-server.

raywoocn avatar raywoocn commented on July 24, 2024

Try to downgrade to 2.1.56.

from ankicommunity-sync-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.