The Anking deck shows but it has 0 cards

I synced from my tablet which also had the Anking deck and it gave the option to change from the AnkiDroid and I chose it because I had already done my reviews and my Ankiweb didn´t have those changes because I did not synced it hours ago. So I did that and then when I opened Anki on my laptop I synced from Ankiweb and now all of my cards and tags are gone. Can someone tell me how to get all the cards back without loosing the progress I have made with the deck? Please.

Error message (don't change this)
Anki 25.09.2 (3890e12c) (ao)
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1
Platform: Windows-11-10.0.26200-SP0

Traceback (most recent call last):

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\taskman.py", line 152, in raise_exception
    raise exception

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\taskman.py", line 148, in _on_closures_pending
    closure()
    ~~~~~~~^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\taskman.py", line 88, in <lambda>
    lambda future: self.run_on_main(lambda: on_done(future))
                                            ~~~~~~~^^^^^^^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\operations\__init__.py", line 253, in wrapped_done
    self._failure(exception)
    ~~~~~~~~~~~~~^^^^^^^^^^^

  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 64, in on_failure
    raise exception

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\python\cpython-3.13.5-windows-x86_64-none\Lib\concurrent\futures\thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\aqt\operations\__init__.py", line 243, in wrapped_op
    return self._op(mw.col)
           ~~~~~~~~^^^^^^^^

  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 68, in <lambda>
    op=lambda _: self._update_deck_media_and_download_missing_media(),
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^

  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 136, in _update_deck_media_and_download_missing_media
    missing_media_names = self._missing_media_for_ah_deck(ah_did)

  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 214, in _missing_media_for_ah_deck
    referenced_media = self._media_referenced_by_notes(ah_did)

  File "C:\Users\Usuario\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py", line 195, in _media_referenced_by_notes
    note = aqt.mw.col.get_note(nid)

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\collection.py", line 497, in get_note
    return Note(self, id=id)

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\notes.py", line 50, in __init__
    self.load()
    ~~~~~~~~~^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\notes.py", line 58, in load
    self._load_from_backend_note(note)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\notes.py", line 68, in _load_from_backend_note
    self._fmap = self.col.models.field_map(self.note_type())
                                           ~~~~~~~~~~~~~~^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\notes.py", line 141, in note_type
    return self.col.models.get(self.mid)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\models.py", line 167, in get
    notetype = from_json_bytes(self.col._backend.get_notetype_legacy(id))
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\_backend_generated.py", line 1309, in get_notetype_legacy
    raw_bytes = self._run_command(23, 7, message.SerializeToString())

  File "C:\Users\Usuario\AppData\Local\AnkiProgramFiles\.venv\Lib\site-packages\anki\_backend.py", line 171, in _run_command
    raise backend_exception_to_pylib(err)

anki.errors.InvalidInput: CollectionNotOpen

Sentry link (for developers)

Thank you for reaching out! Our moderators have been notified and will assist you shortly. In the meantime, you can get an instant response from me simply by @ mentioning my username`. Alternatively, start a private conversation with me (see screenshot below). If you ask me a question, I will do my best to respond using only verified information found in the official AnkiHub docs and the Anki manual.

You can also find answers to common questions in our FAQ and Docs.

Thinking

Search
Found 0 results for ‘tags:official 0 cards after sync from Ankiweb AnKing deck site:community.ankihub.net order:latest max_posts:10 status:open’

You’ve basically told Anki “make all my devices match AnkiWeb” at a point when AnkiWeb didn’t have your cards/progress, so your laptop profile now matches that almost‑empty state. The good news: this usually can be undone if you act quickly and still have a good copy somewhere.

Here’s what to do, in order:


1. Stop syncing everything right now

Until you’re sure where the “good” data is, don’t sync again from any device (tablet, phone, laptop). Further syncing can overwrite your last good copy.


2. Check your tablet (AnkiDroid)

Since you mentioned your tablet had the AnKing deck and you’d done your reviews there, there’s a chance the full deck + progress is still on that device.

On your tablet (AnkiDroid):

  1. Put device in Airplane mode (to prevent accidental sync).
  2. Open AnkiDroid → check:
    • Does the AnKing deck still show the correct number of cards?
    • Do your review counts/progress look right?

If yes, your tablet is your “good” copy. In that case:

  1. On the tablet, go to:
    AnkiDroid → Settings → Advanced → Export collection

    • Export your whole collection (not just one deck).
    • Choose *.colpkg if available (includes media) or regular .apkg if not.
    • Save the file somewhere you can access (local storage/Downloads).
  2. Copy that file to your laptop (via USB, cloud, email, etc.).

  3. On your laptop (desktop Anki):

    • Go to File → Switch Profile…
    • Click Add to create a new test profile (do not use your current one yet).
    • Inside this new profile, go to File → Import… and import the .colpkg / .apkg you exported.
    • Confirm:
      • The AnKing deck appears
      • Card count + progress look correct

If everything looks good in this new profile, we can then:

  1. In the test profile on laptop:
    • Go to Tools → Preferences → Network
    • Log in to AnkiWeb and sync, choosing Upload to AnkiWeb (so AnkiWeb gets the good collection).
  2. On tablet later:
    • Turn off Airplane mode
    • Sync and, when asked, choose Download from AnkiWeb so it matches the good data.
  3. On your original laptop profile, you can either:
    • Keep using the new profile (easiest), or
    • Delete the broken profile after confirming the new one is correct and synced.

3. If the tablet is also missing the cards

If AnkiDroid also shows 0 cards or a broken deck, your best chance is a local backup on your laptop:

On your laptop:

  1. In Anki, go to:
    File → Switch Profile…
    Select your current profile (if not already active).
  2. Go to:
    File → Open Backup…
  3. You’ll see a list of dated backups. Start with one from before this sync problem happened.
  4. Open a backup and check:
    • Does the AnKing deck show the correct card count?
    • Is your progress roughly correct?

If yes:

  1. Once you find a good backup, keep that backup open and sync, choosing Upload to AnkiWeb when prompted.
  2. Then on tablet: sync and choose Download from AnkiWeb.

If none of the backups have the deck/progress, recovery may not be possible.


4. About the error you pasted (AnkiHub media sync)

The error:

anki.errors.InvalidInput: CollectionNotOpen

in the AnkiHub media sync code likely happened because your collection was in a bad state after the sync, not the other way around. Fixing/restoring your Anki collection (via tablet export or backup) should also fix AnkiHub’s media sync.

After you restore:

  • Restart Anki
  • Then try AnkiHub → Download/Update Deck Media again

5. Next steps / what to tell us

If you’re not sure what you see on AnkiDroid or in your backups, please reply with:

  • Does your tablet still have all the AnKing cards? (Yes/No, and approx. how many cards you expect.)
  • On desktop, when you do File → Open Backup…, what’s the most recent backup date that still shows your deck correctly?

Based on that, we can give you more specific click‑by‑click instructions.

Hello,

First, I recommend making sure that you are logged in to the same AnkiWeb account on both your laptop and your mobile device. If you accidentally created two different accounts, one of them might appear empty.

Please note that your AnkiHub account is different from your AnkiWeb account. Visit the two websites below to make sure you have the correct login credentials for each:


Then, I recommend going to your laptop and restoring from a backup created before this incident occurred: How to Restore from Backup. This is the safest approach because I cannot recommend syncing differently with AnkiWeb or mobile devices without knowing the current state of your collection. While this will cause you to lose any progress made since the backup, it ensures that you keep the rest of your data. From now on, just be careful when choosing whether to upload to or download from AnkiWeb.

Let us know if you need help with anything else! :blush:

Hello. Thank you I just did that and it helped. Thank you again for stopping to leave a coment!

1 Like