ankicommunity / ankicommunity-sync-server

A personal Anki sync server (so you can sync against your own server rather than AnkiWeb)
GNU Affero General Public License v3.0
870 stars 80 forks source link

Sync errors when trying to sync using anki 2.0.52 #150

Open justpeanuts opened 2 years ago

justpeanuts commented 2 years ago

OS: Linux Mint 20.0 Python version: Python 3.8.10

Issue: I am trying to use anki 2.0.52 (because of support for an addon, Advanced Previewer) I followed the instructions in the readme and installed anki-sync-server. i have anki 2.0.52 installed in the system. I get the following error when trying to sync from inside anki 2.0.52 :-

Syncing failed:
AnkiWeb encountered an error. Please try again in a few minutes, and if the problem persists, please file a bug report.

The errors that are outputted by the running instance of anki-sync-server, when i try to sync from anki are as follows:-

[2022-09-17 13:15:43,252]:INFO:ankisyncd:ankisyncd [unknown version] (https://github.com/ankicommunity/anki-sync-server.git)
[2022-09-17 13:15:43,268]:INFO:ankisyncd:Loaded config from /home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd.conf
[2022-09-17 13:15:43,269]:INFO:ankisyncd.users:Found auth_db_path in config, using SqliteUserManager for auth
[2022-09-17 13:15:43,269]:INFO:ankisyncd.sessions:Found session_db_path in config, using SqliteSessionManager for auth
[2022-09-17 13:15:43,270]:INFO:ankisyncd:Serving HTTP on 0.0.0.0 port 27701...
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/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 517, in __call__
    w= self.__wrapped__(*args, **kwargs)
  File "/home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 641, in __call__
    raise HTTPForbidden()
webob.exc.HTTPForbidden: Access was denied to this resource.
[2022-09-17 13:15:57,132]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/meta HTTP/1.1" 500 59
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/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 517, in __call__
    w= self.__wrapped__(*args, **kwargs)
  File "/home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 641, in __call__
    raise HTTPForbidden()
webob.exc.HTTPForbidden: Access was denied to this resource.
[2022-09-17 13:16:10,182]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/meta HTTP/1.1" 500 59
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/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 517, in __call__
    w= self.__wrapped__(*args, **kwargs)
  File "/home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 641, in __call__
    raise HTTPForbidden()
webob.exc.HTTPForbidden: Access was denied to this resource.
[2022-09-17 13:16:14,526]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/meta HTTP/1.1" 500 59
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/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 517, in __call__
    w= self.__wrapped__(*args, **kwargs)
  File "/home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 641, in __call__
    raise HTTPForbidden()
webob.exc.HTTPForbidden: Access was denied to this resource.
[2022-09-17 13:16:54,025]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/meta HTTP/1.1" 500 59
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/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 517, in __call__
    w= self.__wrapped__(*args, **kwargs)
  File "/home/arjun/LINUX_SOFTWARE/TRYING_OUT/anki-sync-server/src/ankisyncd/sync_app.py", line 641, in __call__
    raise HTTPForbidden()
webob.exc.HTTPForbidden: Access was denied to this resource.
[2022-09-17 13:17:21,563]:INFO:ankisyncd.http:127.0.0.1 "POST /sync/meta HTTP/1.1" 500 59

Can someone please help by providing the exact instructions required to setup sync between anki 2.0.52 in linux and ankidroid ?

dglava commented 1 year ago

Sorry for not being able to help directly, but I had the same issue. It was an error in my setup with a reverse proxy and accessing the sync server remotely.

I don't know how you are connecting to your sync server, but my advice is to first try a simple, local connection and sort that one out. Make sure that no firewall is blocking connections and that you're pointing everything to the correct address in your clients/server.

dobefore commented 1 year ago

As far as I know,2.0 version may be not supported ,you could try https://github.com/dsnopek/anki-sync-server or https://github.com/tsudoko/anki-sync-server .Those are ones that have not been maintianed for long ,though I cannot guarantee that they would work.

Edit: Or just update from 2.0 to 2.1.