# DbError { info: "InvalidColumnType(6, \\"factor\\", Real)", kind: Other }

**URL:** <https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949>\
**Category:** Help\
**Created:** [September 25, 2023, 1:48am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949 "2023-09-25T01:48:15Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 1:48am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/1 "2023-09-25T01:48:15Z")

</div>

I started 2.1.66 on my 2.1.22 collection. It showed some DbErrors in the Browser. Exporting showed an exception.  
I deleted all the contents and tags from all cards, because I want to try the optimizer in [How to use the next-generation spaced repetition algorithm FSRS on Anki?](https://forums.ankiweb.net/t/how-to-use-the-next-generation-spaced-repetition-algorithm-fsrs-on-anki/25415)  
After running

```auto
mw.col.db.execute("update cards set factor=round(factor)")
mw.col.modSchema(False)

```

there are no more DbErrors near the top of the list in the Browser, but exporting (as described in that thread) still fails with `DbError { info: "InvalidColumnType(6, \"factor\", Real)", kind: Other }`

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 2:03am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/2 "2023-09-25T02:03:40Z")

</div>

Try `update cards set factor = cast(factor as int)`

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 2:07am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/4 "2023-09-25T02:07:55Z")

</div>

Same error. There may still be errors in the Browser, but none are near the top.  
With 2.1.22, I’ve been using modified autoEaseFactor.  
In 2.1.66 (running in safe mode, because it wouldn’t start otherwise), I turned the V3 scheduler on, but didn’t review anything.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 4:00am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/5 "2023-09-25T04:00:50Z")

</div>

What does this print?

select typeof(factor), count(\*) from cards;

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 4:43am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/6 "2023-09-25T04:43:22Z")

</div>

I restored 2.1.22 for now, but to make sure I am running the correct command, I tried with it:

```auto
>>> mw.col.db.execute("select typeof(factor), count(*) from cards;")
<no output>

```

```auto
>>> print(mw.col.db.execute("select typeof(factor), count(*) from cards;"))
<sqlite3.Cursor object at 0x7f61ac235880>

```

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 4:59am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/7 "2023-09-25T04:59:13Z")

</div>

`print(mw.col.db.all("select typeof(factor), count(*) from cards;"))`

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 5:03am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/8 "2023-09-25T05:03:15Z")

</div>

2.1.22:

```auto
>>> mw.col.db.execute("select typeof(factor), count(*) from cards;")
... print(mw.col.db.all("select typeof(factor), count(*) from cards;"))
[('integer', 172403)]

```

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 5:32am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/9 "2023-09-25T05:32:10Z")

</div>

Not sure what’s going on there. Can you share the file with me?

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 5:35am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/10 "2023-09-25T05:35:37Z")

</div>

Can you make the thread private? I don’t want to send it by e-mail.  
2.1.66 output with the deck after all the operations is `[['integer', 172429]]`

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 5:36am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/11 "2023-09-25T05:36:34Z")

</div>

You can contact me privately on [https://anki.tenderapp.com](https://anki.tenderapp.com)

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 5:59am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/12 "2023-09-25T05:59:41Z")

</div>

Sent as a .gz file. Trying to upload .zst and .anki2 caused errors.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 25, 2023, 6:02am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/13 "2023-09-25T06:02:14Z")

</div>

update revlog set factor = max(0, cast(factor as integer));

---

<div class="post-metadata">

**Author:** ![Aleksej](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksej](https://forums.ankiweb.net/u/Aleksej)\
**Post date:** [September 25, 2023, 6:04am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/14 "2023-09-25T06:04:41Z")

</div>

Thank you, it was exported as a 37 MB .apkg file with a 103 MB collection.anki21 and small other files.

Going from my 2.1.22 collection to Anki 2.1.66 requires both sets of commands:

```auto
mw.col.db.execute("update cards set factor=round(factor)")
mw.col.modSchema(False)
print(mw.col.db.all("update revlog set factor = max(0, cast(factor as integer));"))

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [October 25, 2023, 6:05am UTC](https://forums.ankiweb.net/t/dberror-info-invalidcolumntype-6-factor-real-kind-other/34949/15 "2023-10-25T06:05:01Z")

</div>

Closed on October 25, 2023, 6:05am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
