# Every Sync Must Be Forced, Normal Sync Results in Error 400

**URL:** <https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671>\
**Category:** Syncing & AnkiWeb\
**Created:** [February 20, 2021, 8:51pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671 "2021-02-20T20:51:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![OblivionWing](https://avatars.discourse-cdn.com/v4/letter/o/b5a626/32.png) [@OblivionWing](https://forums.ankiweb.net/u/OblivionWing)\
**Post date:** [February 20, 2021, 8:51pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/1 "2021-02-20T20:51:22Z")

</div>

I have had this issue for around a month (started early January 2020 iirc). I’m not sure what triggered it, as all I was doing was syncing normally, then one day it just didn’t work for PC or Android.

I tried finding other posts here and on Reddit about this issue, but only one post offered a solution (set up a new Ankiweb account) which didn’t work for me.

**Version:** 2.1.24 (same issue when upgrading to 38)

**OS** : Ubuntu 18.04 (hesitant to upgrade without this issue fixed)

I installed Anki via the commandline – I did _not_ install the 2.1.0 version that Ubuntu offers through the package manager.

* * *

**Current Issue:** Syncing normally on Anki for PC _and_ Ankidroid results in the same message. It will actually sync some data (never the same amount) before displaying the error.

When I first encountered this problem, the error message on PC was slightly different than the error message I get now.

[So at some point, the error message actually changed, and I’m not sure why.]

* * *

**First Error Message (screenshotted around 28 Jan 2021, on PC):** [[screenshot here]](https://i.imgur.com/F8Dydj1.png)

`A network error occurred.`  
`Error details: HTTP status client error (400 Bad Request) for url ()`

On Ankidroid, there was no error message – a blank box would appear with “:”.

As of 31 Jan 2021, a different message appeared:

**Second Error Message:** [[screenshot here]](https://i.imgur.com/VDmNaKP.png)

On Anki for PC, this is the exact message I get:

`Syncing failed:`  
`Traceback (most recent call last):`  
`File "aqt/sync.py", line 429, in _sync`  
`File "aqt/sync.py", line 409, in _abortingSync`  
`File "anki/sync.py", line 120, in sync`  
`File "anki/sync.py", line 603, in chunk`  
`File "anki/sync.py", line 619, in _run`  
`File "anki/sync.py", line 546, in req`  
`File "anki/sync.py", line 479, in assertOk`  
`Exception: Unknown response code: 400`

On AnkiDroid, the message is less verbose: \*Syncing error, type 400 message: \*

* * *

**Attempted Solutions:**

- Disabling addons and using Check Database does nothing. Choosing not to sync media/images does nothing.

- Upgrading to the latest version of Anki on Desktop. Error still persisted.

- Reinstalled and downgraded back to version 2.1.24. No fix.

- Created a new Ankiweb account and synced to that, also no fix.

- Uploading backups from May - December 2020 results in the same error (which is odd because if this was an issue with the way I recently edited anything, any issues with the collection should have been solved with a November backup).

* * *

**What Works for Anki on PC:**

Creating a new profile, _not_ importing my current collection to it (just added some basic-type cards for testing), and synced that to my new Ankiweb account – it syncs normally.

If I delete all the decks in my collection, and sync only cards I just added and reviewed in my default deck, it syncs normally.

But after opening numerous backups and trying to add a new card using a non-default template to a fresh profile – it will not sync normally even if I add a new card after deleting every deck. I have to open another profile to attempt further troubleshooting.

I also tried to transfer cards from my other decks into the Default one in hopes that it might fix something, but the error still appears.

* * *

Note: Anki _will_ sync new media “normally” as long as I’ve not reviewed any cards – but it will not sync any new cards even if I don’t review anything.

* * *

Recreating all my cards from scratch is simply not feasible. I’ve put a lot of time into studying these decks and am concerned that one day I may not be able to depend on forcing syncs.

Importing collection backups from Feb - April 2020 appear to potentially solve the syncing issue. Is there some way I can merge my recent data into an older backup like this (by merging the records of the two \*.db2 files somehow)? I’m relatively comfortable using DB Browser for SQLite, but am not very comfortable with Anki’s particular data structures.

Is there something else I could do that might solve the issue and preserve my data? Would upgrading Ubuntu help?

(Edited to fix formatting/grammar)

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [February 21, 2021, 12:03am UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/2 "2021-02-21T00:03:52Z")

</div>

You have bad data in your collection, probably from an add-on you used about a year ago. The following in the debug console will remove it, and then you’ll need to upload to AnkiWeb.

```python
mw.col.db.execute("delete from revlog where type > 4")
mw.col.modSchema(check=False)

```

[https://docs.ankiweb.net/#/misc?id=debug-console](https://docs.ankiweb.net/#/misc?id=debug-console)

---

<div class="post-metadata">

**Author:** ![OblivionWing](https://avatars.discourse-cdn.com/v4/letter/o/b5a626/32.png) [@OblivionWing](https://forums.ankiweb.net/u/OblivionWing)\
**Post date:** [February 21, 2021, 2:07am UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/3 "2021-02-21T02:07:01Z")

</div>

It’s fixed now, thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![mkohler](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@mkohler](https://forums.ankiweb.net/u/mkohler)\
**Post date:** [April 5, 2021, 5:21pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/4 "2021-04-05T17:21:25Z")

</div>

I was experiencing very similar symptoms to what @OblivionWing described, and tried the same fix you suggested, and it also worked for me. In case it’s helpful, I’m using Anki 2.1.38 on Ubuntu 20.04, and the only add-on I use is “Syntax Highlighting for Code”.

---

<div class="post-metadata">

**Author:** ![TArtz](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TArtz](https://forums.ankiweb.net/u/TArtz)\
**Post date:** [December 8, 2021, 1:29pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/5 "2021-12-08T13:29:35Z")

</div>

Hello

I did try the above debugging. Which worked at first, but as soon as I made new cards, that the same Error sign came up again. Any other recommendations?

Thanks again!

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [December 8, 2021, 10:24pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/6 "2021-12-08T22:24:31Z")

</div>

Please upgrade to the latest Anki version, use Check Database and a full sync, and then try again.

---

<div class="post-metadata">

**Author:** ![pavreh](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pavreh](https://forums.ankiweb.net/u/pavreh)\
**Post date:** [October 26, 2022, 3:56pm UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/7 "2022-10-26T15:56:35Z")

</div>

New link to the manual, debug console  
[https://docs.ankiweb.net/misc.html?#debug-console](https://docs.ankiweb.net/misc.html?#debug-console)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 6:11am UTC](https://forums.ankiweb.net/t/every-sync-must-be-forced-normal-sync-results-in-error-400/7671/8 "2023-05-01T06:11:11Z")

</div>

Closed on May 1, 2023, 6:11am UTC


