卡片信息提示错误

190847763's Avatar

190847763

05 Dec, 2019 01:33 AM

当我的笔记存在多个卡片模板时,而其中某个卡片是在笔记生成之后,通过在字段中增加内容来生成的(注意:是笔记生成之后,再次通过笔记中的其它模板生成的),此时在浏览器中点击新成生的卡片信息,就是提示如附件的错误。具体错误文字如下:

////////////////////////////////////////////
错误
有一个错误发生了.请在按住shift键的同时启动Anki,这样可以临时的忽略掉你已经安装的插件。
如果仅仅是因为插件引起的问题,请选择工具>插件菜单项来将出错的的插件设置成失效,然后重启Anki,重复以上的步骤直到你发现了具体是哪个插件引起的问题。
当你已经发现是因为插件引起的问题,请在我们的支持网站上 add-ons section 上报告问题。
调试信息
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 7
Flags: frz=True ao=True sv=1

Caught exception:
  File "aqt\browser.py", line 1127, in showCardInfo
  File "aqt\browser.py", line 1153, in _cardInfoData
  File "anki\stats.py", line 27, in report
  File "anki\stats.py", line 76, in date
<class 'OSError'>: [Errno 22] Invalid argument

////////////////////////////////////////////

  1. Support Staff 1 Posted by Damien Elmes on 05 Dec, 2019 07:00 AM

    Damien Elmes's Avatar

    I can not reproduce this. Perhaps one of the add-ons you have installed is causing it?

  2. 2 Posted by 190847763 on 05 Dec, 2019 07:02 AM

    190847763's Avatar

    没有安装任何加载项!程序也是重新安装的!

  3. Support Staff 3 Posted by Damien Elmes on 06 Dec, 2019 01:34 AM

    Damien Elmes's Avatar

    What are you doing differently?

  4. 4 Posted by 190847763 on 06 Dec, 2019 02:13 AM

    190847763's Avatar

    感谢你再次对我的问题进行探究。
    我在基础模板中添加了一个字段,并用这个字段控制是否产生另一张卡片。
    具体见附件中gif动画。

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月6日(星期五) 上午9:34
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  5. Support Staff 5 Posted by Damien Elmes on 06 Dec, 2019 02:39 AM

    Damien Elmes's Avatar

    Hmm, I am not sure why this is happening, and I still can not reproduce it here.

    If you select the problem card in the browse screen, then run the following in the debug console, what does it print?

    pp(bcard()['id'])

    https://apps.ankiweb.net/docs/manual.html#debug-console

  6. 6 Posted by 190847763 on 06 Dec, 2019 02:56 AM

    190847763's Avatar

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月6日(星期五) 上午10:39
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  7. Support Staff 7 Posted by Damien Elmes on 06 Dec, 2019 05:57 AM

    Damien Elmes's Avatar

    Please make sure the problem card is selected in the browser - the debug console is saying nothing is currently selected, or the Browse screen is not currently open.

  8. 8 Posted by 190847763 on 06 Dec, 2019 06:10 AM

    190847763's Avatar

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月6日(星期五) 上午10:39
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  9. Support Staff 9 Posted by Damien Elmes on 06 Dec, 2019 09:51 PM

    Damien Elmes's Avatar

    Thanks, I've found out what is causing this. Anki is picking a card ID that is one higher than the highest card ID in your collection. For some reason, your collection has ~2300 cards that have a card ID number that is too large. I am guessing you used an add-on or external program to import material into your collection? It appears that add-on/program is not creating cards correctly.

  10. 10 Posted by 190847763 on 07 Dec, 2019 12:15 AM

    190847763's Avatar

    完全正确!我实验了,当我重新创建新的账户,在没有任何笔记的情况下,按照之前的操作再进行一遍,问题消失了!
    那要怎么解决呢?是要控制卡的总量吗?!但这好像不是软件设计的初衷,原则上是否应该是只要硬盘容易够,就应无限使用卡的数量的。
    感谢您为此付出的努力!

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月7日(星期六) 凌晨5:51
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  11. Support Staff 11 Posted by Damien Elmes on 07 Dec, 2019 09:13 PM

    Damien Elmes's Avatar

    The number of cards does not matter. You have ~2000 cards that have been created incorrectly. Did you use an add-on or external program to import cards in the past? Or did you import ~2000 cards from a shared deck in the past?

  12. 12 Posted by 190847763 on 08 Dec, 2019 02:06 AM

    190847763's Avatar

    我是用过其它的程序或插件插入过外部卡片!现在要怎么做呢?难道要删除那些卡吗?

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人: "Damien Elmes"<[email blocked]&gt;;
    发送时间: 2019年12月8日(星期天) 凌晨5:13
    收件人: "春暖花开"<[email blocked]&gt;;
    主题: Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  13. Support Staff 13 Posted by Damien Elmes on 08 Dec, 2019 09:49 PM

    Damien Elmes's Avatar

    Please contact the author of the add-on/program you used, tell them about the problem, and ask them if they can fix your collection for you.

  14. 14 Posted by 190847763 on 09 Dec, 2019 12:08 AM

    190847763's Avatar

    我仍然糊涂,当我停用一切插件的时候,如上次的操作视频一样,仍然存在这样的问题,也是那些插件的问题?
    那些插件不是停用了吗?!

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月9日(星期一) 凌晨5:49
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  15. Support Staff 15 Posted by Damien Elmes on 09 Dec, 2019 12:33 AM

    Damien Elmes's Avatar

    The cards were not added correctly to your collection. Disabling the add-on you used will not fix cards that have already been added. You need to let the add-on author know of the problem, and ask them to fix the problem they have caused.

  16. 16 Posted by 190847763 on 09 Dec, 2019 07:58 AM

    190847763's Avatar

    我已经明白是怎么回事了,只要有一个卡片的信息显示是错误的,后面产生的某个卡片当二次修改时就是错误的,即使产生这个卡片的插件没有问题。所有现在我需要对所有的产片进行删除,然后重建!除此之外,似乎没有更好的办法了。我太难了!!!

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月9日(星期一) 上午8:33
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  17. 17 Posted by 190847763 on 09 Dec, 2019 07:59 AM

    190847763's Avatar

    我已经明白是怎么回事了,只要有一个卡片的信息显示是错误的,后面产生的某个卡片当二次修改时就是错误的,即使产生这个卡片的插件没有问题。所以我现在需要对所有的产片进行删除,然后重建!除此之外,似乎没有更好的办法了。我太难了!!!

    ------------------ 原始邮件 ------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月9日(星期一) 上午8:33
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  18. Support Staff 18 Posted by Damien Elmes on 09 Dec, 2019 09:27 AM

    Damien Elmes's Avatar

    It is true that any cards you add now - either manually or with an add-on - will have the same problem until those cards are fixed or deleted. But the question is, what caused the problem in the first place? It is unlikely that Anki added the first problem card. Chances are, you have used an add-on that caused this, or imported a shared deck that contained broken cards. You will need to do some experiments to find out the cause. You can create a new profile, and import any shared decks you imported in the past, then see if adding a new card shows the same problem. If it doesn't, then you will need to try each of the add-ons you've used in the past to see which one is to blame.

  19. 19 Posted by 190847763 on 09 Dec, 2019 01:53 PM

    190847763's Avatar

    我花费了大量的精力仍然无法找到导致卡片信息错误的源头,也许导致这个卡片错误的那个最初插件早已经被我删除不用,但因为我没有发现其危害性,导致我所有的卡片被污染,这就像是病毒,悄然发生,毫无防备。让我不再敢去试用下载网络上的任何插件。

    我想如果这个软件能够有这方面的预防,或者报警,对新生成的卡片进行检测,如卡片信息出错,提醒用户正在使用的插件有问题,或者让用户恢复之前的备份,而不是等到使用者自己去发现,那已经为时太晚了。

    这个非常重要!请您们予以考虑。

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月9日(星期一) 下午5:27
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  20. Support Staff 20 Posted by Damien Elmes on 09 Dec, 2019 09:51 PM

    Damien Elmes's Avatar

    After backing up your collection, you can try the following in the debug console to rewrite the IDs.

    t = intTime(1000)
    for id in mw.col.db.list("select id from cards"):
      mw.col.db.execute("update cards set id=? where id=?", t, id)
      t += 1
    mw.col.setMod()
    mw.col.modSchema(check=False)
    
  21. 21 Posted by 190847763 on 10 Dec, 2019 01:27 AM

    190847763's Avatar

    非常感谢!我小范围里测试了你给的代码,可以使用的。但我不知道这个代码运行何时可以结束,因为我的卡片众多,我不敢轻易的强制结束!

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月10日(星期二) 凌晨5:51
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  22. Support Staff 22 Posted by Damien Elmes on 10 Dec, 2019 09:38 PM

    Damien Elmes's Avatar

    Sorry, I wasn't able to understand your last message. You should only need to run the above command once to fix all cards, and the problem should not come back provided you do not use whatever add-on/shared deck originally caused the problem.

  23. 23 Posted by 190847763 on 11 Dec, 2019 12:16 AM

    190847763's Avatar

    非常感谢你!执行你给我的命令,没过一时,我的所有卡片就不再提示错误了!我原以为需要很长时间呢!
    真要去学一点这方面的编程,以解决学习中遇到的问题!!

    ------------------&nbsp;原始邮件&nbsp;------------------
    发件人:&nbsp;"Damien Elmes"<[email blocked]&gt;;
    发送时间:&nbsp;2019年12月11日(星期三) 凌晨5:38
    收件人:&nbsp;"春暖花开"<[email blocked]&gt;;

    主题:&nbsp;Re: 卡片信息提示错误 [Anki (Computer Version) #37337]

  24. Support Staff 24 Posted by Damien Elmes on 11 Dec, 2019 10:38 AM

    Damien Elmes's Avatar

    Glad to hear that's resolved the problem.

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac