New importing feature causes error after importing file with duplicates

I was testing out the beta importing feature, but it seems to have a problem with handling duplicate cards, especially when the “Existing cards” option is left on the default “Update” in the import dialog.

When importing a file with a note that already exists in the deck, Anki claims it skipped the duplicate, but it adds a “ghost card” to the schedule, and when studying, gives the following error when the review comes up:

Error
An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Windows 10
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2022-08-29 14:19:54

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 42, in cmd
  File "aqt.webview", line 149, in _onCmd
  File "aqt.webview", line 624, in _onBridgeCmd
  File "aqt.overview", line 92, in _linkHandler
  File "aqt.main", line 673, in moveToState
  File "aqt.main", line 694, in _reviewState
  File "aqt.reviewer", line 150, in show
  File "aqt.reviewer", line 170, in refresh_if_needed
  File "aqt.reviewer", line 233, in nextCard
  File "aqt.reviewer", line 340, in _showQuestion
  File "anki.cards", line 129, in question
  File "anki.cards", line 145, in render_output
  File "anki.template", line 123, in from_existing_card
  File "anki.cards", line 156, in note
  File "anki.collection", line 478, in get_note
  File "anki.notes", line 52, in __init__
  File "anki._backend.generated", line 564, in new_note
  File "anki._backend", line 146, in _run_command
anki.errors.NotFoundError

Steps to reproduce:

  1. Create a CSV file with a single line:
front,back
  1. On a fresh profile with the new importing option enabled, import the file, keeping the options on default.
  2. Import the same file again.

Now the “ghost card” will appear as a new card.

Running Tools > Check database actually fixes the problem with the message that a card with a missing note was removed.

2 Likes

Thanks for the report. This happens to be already fixed as a side effect of this:

1 Like