Sync problems and debugging it

I was using Anki 2.1.35, and some days ago I started receiving the message below:

Please use the Check Database function, then sync again. If problems persist, please force a full sync in the preferences screen.

I have tried the following, so far:

  • The latest thing I had done was to add a subdeck and another subdeck within it, both empty (I built the structure to start working it, but hadn’t added any content yet). I have seen on the Internet reports of problems related to capitalization of deck/subdeck names causing this type of issue, so I checked for that, and then tried adding some content on both subdecks and resyncing
  • I have upgraded to latest (2.1.42)
  • Of course, I have tried the database check, which completes without any errors
  • I have tried exporting my decks and reimporting
  • I did a full download, but did not resync. Instead I overwrote it with a backup (because it didn’t have my last day’s work)

None of that worked.

I’d rather not work from the outdated version on the server, as I have been doing 60+ cards a day, and these updates are just not there on the server. I don’t think I have new cards added since then, so it will be a last resort thing, but I’d like to avoid it.

I have some experience with Python, though. So, here are my questions:

  • Is there any type of ‘debug mode’ with proper logging so I can try to understand what’s going on?
  • Is there a way for me to manually move the deck out elsewhere (move file or directory), so I try an import from a clean slate?
  • Anybody else having this problem and have a solution other than ‘download from AnkiWeb’? I’m open to that solution, but, again, as a last resort.

By the way, I use no add-ons, but even so tried the start with ‘shift’ down, to no avail.

To start with, upgrade to latest Anki.app.

khs, thanks for the input. That part, I have already tried, though. I installed 2.1.42, which is just 4 days old. Or were you suggesting something else?

Sorry my mistake, read the first part mentioning 2.1.35. There are cases where a full sync from either side is needed, hence important to sync all the time, at each session.

Here’s what I did:

  • Save current local state (local backup)
  • Full sync from server; save server state (remote backup)
  • Import local backup; full sync to remote
  • Sync again

Apparently, it worked; the message is gone and the local changes reflect on remote (checked via AnkiWeb).

Hope that is good; if not, I hope the backups work :slight_smile:

It is still working on the following day, so I’ll mark my own answer as a solution.

It’s worthy noting why I think this is different from the default answer ‘do a full sync’, and why I asked it in the first place.

The error message does not explain what is wrong: it asks for a database check (which implies the local copy might be corrupt) and then proposes a full sync if that does not help (without telling to which direction).

I didn’t want to simply download from AnkiWeb, but I was also concerned that I might have something corrupt on my local copy, and that pushing it to the server might somehow ‘contaminate’ it.

Turns out that, apparently, the two versions (local and remote) were simply somehow incompatible; one of them was not necessarily corrupt.

The step by step instructions above may be helpful for other people having the same issue.

I just wish, though, that someone had answered about my debugging question. I really wonder what was the specific problem with the deck.

As a last note, all this happened before my update to the new scheduler in 2.1. I have done that update immediately after all this process (including push to server).

The logs point to your device having one more deck than the server did at the end of the sync. A full sync should resolve the issue. If you’re syncing at the start and end of each session and can reproduce the issue with specific steps in the latest Anki version, please let us know.

@dae, thanks for looking into it. I’m guessing the logs you mentioned are server logs, as I haven’t shared any logs myself (actually, I was looking for a way to produce them with this question).

I always sync at start and end of each session, yes, but it was an one-off; I can’t reproduce it after I ran my procedure above (and I actually hope I don’t reproduce it in the future… :slight_smile: ).

Would there be any way to see that kind of error detail on the client side? If I had just that piece of information before (one more deck on the client than the server), I’d have removed that new and empty deck, and it might have got me to bypass, without a one-way full sync.

When the counts don’t match it indicates your collections are out of sync. Adding or removing a deck may have masked the error, but wouldn’t have necessarily caused the clients to match again, so a re-sync is the safest option.

Gotcha. Thanks for your attention :slight_smile: