Corrupted deck! Please help...

171 views
Skip to first unread message

Scot

unread,
Nov 25, 2010, 3:45:09 PM11/25/10
to AnkiDroid
Hello,

I've been using Anki on my Nexus One to learn Mandarin for the first
few months. I generally use AnkiDroid to study, and then connect/
mount my device and use the full Anki app on either my Mac or WinXP PC
to add new vocab as needed.

Just now I hard a terrible surprise when trying to add some vocab via
Anki for Windows (1.0.1). The program complained about a corrupted
deck, with the following output:

Debug info:
Traceback (most recent call last):
File "ankiqt\ui\main.pyc", line 716, in loadDeck
File "anki\deck.pyc", line 2814, in Deck
File "anki\deck.pyc", line 685, in rebuildQueue
File "anki\deck.pyc", line 671, in checkDue
File "anki\db.pyc", line 114, in statement
File "anki\db.pyc", line 90, in execute
File "sqlalchemy\orm\session.pyc, line 753, in execute
File "sqlalchemy\engine\base.pyc", line 824, in execute
File "sqlalchemy\engine\base.pyc", line 874, in
_execute_clauseelement
File "sqlalchemy\engine\base.pyc", line 896, in __execute_context
File "sqlalchemy\engine\base.pyc", line 950, in _cursor_execute
File "sqlalchemy\engine\base.pyc", line 931, in
_handle_dbapi_exception
OperationalError: (OperationalError) database or disk is full u'update
cards set isDue = 1 where type = 1 and isDue = 0 and priority in
(1,2,3,4) and combinedDue <= ?' [1290717206.0150001]

I then ejected my phone and tried to open it in AnkiDroid with the
error message:

"Failed to load deck. Please, press menu and select one of the decks
stored in your sd card."

This is a huge disaster. I have a ton of cards and study history in
that deck. I'm now kicking myself for not backing up regularly.

I've uploaded the deck to Dropbox at http://dl.dropbox.com/u/2405832/English-Chinese.anki

Is there anything that can be done to recover this?

FWIW, I suspect this happened when I mounted the device. Whereas I
normally take care to kill AnkiDroid prior to doing this, I skipped
that step this time. Perhaps Anki was mid-write when the device was
mounted?

Thanks in advance for any help. Let me know if there's any additional
info that I can provide.

-Scot

Nicolas Raoul

unread,
Nov 25, 2010, 6:34:53 PM11/25/10
to anki-a...@googlegroups.com
Hi Scot!

Sorry for the inconvenience!
Which version of AnkiDroid are you using?
Actually I never kill AnkiDroid before mouting/editing on the PC, and
never had any corruption,maybe I was lucky.

Cheers!
Nicolas

> --
> You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
> To post to this group, send an email to anki-a...@googlegroups.com.
> To unsubscribe from this group, send email to anki-android...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/anki-android?hl=en-GB.
>
>

iniju

unread,
Nov 26, 2010, 12:01:11 AM11/26/10
to AnkiDroid
Hi Scot,

Anki has an option for fixing decks that were somehow corrupted: from
memory it's something like deck > advanced > check database. Or
something like that.
I hope it works, good luck.

I don't think it matters much wherher AnkiDroid is open or not,when
you unmoumt, unless you're really fast.
Another thing to be careful about is when mounting the sdcard via USB,
to stop the device from windows XP (or properly dismount from linux)
prior to mounting from the phone.
Again, best luck.

Kostas
> I've uploaded the deck to Dropbox athttp://dl.dropbox.com/u/2405832/English-Chinese.anki

Edu Zamora

unread,
Nov 26, 2010, 12:51:57 AM11/26/10
to AnkiDroid
Hi Scot,

Are you sure that the deck you uploaded to Dropbox is the one that is
giving you trouble?

I have just downloaded and tested it both in Anki Desktop (version
1.0.1 on Mac OS X) and in AnkiDroid and it works perfectly. I
completed a review session and I even could add a fact.

So when the error exactly happens, when trying to open the deck or
when trying to add a fact?

Anyway, like Kostas said very well, try to perform a check of the
database ('Tools' > 'Advanced' > 'Check Database...') and see if it
solves your problem. If you cannot do it for some reason tell me, I'll
do it for you and I'll send you your deck back.

Good luck and don't worry so much! Your deck is going to be fine.

Edu

Damien Elmes

unread,
Nov 26, 2010, 3:45:11 AM11/26/10
to anki-a...@googlegroups.com
#1: the error indicates your disk/device is full or the journal file
can't be written to. Sqlite will not work if the disk is full.

#2: if there is a -journal file next to the deck, you should close the
deck before copying/editing it elsewhere.

#3: Anki desktop takes a backup every time you open the deck. Please
see http://ichi2.net/anki/wiki/DeckErrors

Nicolas Raoul

unread,
Nov 26, 2010, 3:55:08 AM11/26/10
to anki-a...@googlegroups.com
> #1: the error indicates your disk/device is full or the journal file
> can't be written to. Sqlite will not work if the disk is full.

I guess SQLite generates an exception that we could catch to let the user know?

> #2: if there is a -journal file next to the deck, you should close the
> deck before copying/editing it elsewhere.

That's for Anki Desktop right?

Cheers!
Nicolas Raoul

Damien Elmes

unread,
Nov 26, 2010, 4:02:00 AM11/26/10
to anki-a...@googlegroups.com
The same thing applies for AnkiDroid. If the last transaction has
finished and you have no timers that check the deck then chances or
corruption are low, but better to be safe than sorry.

Reply all
Reply to author
Forward
0 new messages