Cannot Sync on Ubuntu

Not sure why, but cannot sync my cards to ankiweb, error code doesn’t seem to give a clue. Tried using mtr to ankiweb and it shows no packet loss to any server. I have version 2.1.15 on Ubuntu

This is the message given when trying to sync

Syncing failed:
Traceback (most recent call last):
File “/usr/share/anki/aqt/sync.py”, line 376, in _sync
ret = self._abortingSync()
File “/usr/share/anki/aqt/sync.py”, line 356, in _abortingSync
return self.client.sync()
File “/usr/share/anki/anki/sync.py”, line 120, in sync
ret = self.server.sanityCheck2(client=c)
File “/usr/share/anki/anki/sync.py”, line 614, in sanityCheck2
return self._run(“sanityCheck2”, kw)
File “/usr/share/anki/anki/sync.py”, line 624, in _run
self.req(cmd, io.BytesIO(json.dumps(data).encode(“utf8”))).decode(“utf8”))
File “/usr/share/anki/anki/sync.py”, line 559, in req
self.assertOk(r)
File “/usr/share/anki/anki/sync.py”, line 498, in assertOk
raise Exception(“Unknown response code: %s” % resp.status_code)
Exception: Unknown response code: 400

If someone could help that would be much appreciated! Thank you!

Updating your Anki should fix the issue

1 Like

More info: Linux Distro Packages - Anki Manual

Unfortunately, Anki is known to be poorly packaged on most Linux distributions, however I have made a small list of ways of you have to actually install the latest Anki version on any distribution here.
You should find at least one that suits you, although none is really satisfying because you circumnavigate your default package manager. If you really want to stick to a single way to install packages (which is reasonable), and if you use gnome-software to install your packages (the default in Ubuntu (Gnome or Unity), Xubuntu and Lubuntu), be aware that there are extensions to make it compatible with flatpak or snap, meaning you can install with these package managers through gnome-software (it’s not possible with nix as using an imperative way of installing packages is not the way it works).