continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.65k stars 1.72k forks source link

SQLITE_CORRUPT: database disk image is malformed #2016

Open smiling-watermelon opened 3 months ago

smiling-watermelon commented 3 months ago

Before submitting your bug report

Relevant environment info

- OS: Fedora Linux 40 (Workstation Edition)
- Continue: v0.8.46
- IDE: VS Code 1.92.1
- Model: -
- config.json:

 {
  "models": [
    {
      "title": "GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiKey": "...",
      "systemMessage": "You are an expert software developer. You give helpful and concise responses."
    },
    {
      "title": "LLama 3",
      "provider": "ollama",
      "model": "llama3-8b",
      "systemMessage": "You are an expert software developer. You give helpful and concise responses. Whenever you write a code block you include the language after the opening ticks."
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "allowAnonymousTelemetry": true,
  "docs": []
}

Description

When the extension starts, I get this error. I'm not sure what/where this database image is, I couldn't find in the extension folder of Continue.

I'm not sure how I can cause it to be malformed, since last time I've used it, I have exited the editor as usual.

To reproduce

Since Log Output doesn't support pasting images, I'll attach one here. image

Log output

[2024-08-15T05:20:55] [DEBUG] Logging initialized
[2024-08-15T05:20:55] [ERROR] Error adding item to minisearch: t is not iterable TypeError: t is not iterable
    at bc.addAll (https://file+.vscode-resource.vscode-cdn.net/home/woka/.vscode/extensions/continue.continue-0.8.46-linux-x64/gui/assets/index.js:684:8064)
    at https://file+.vscode-resource.vscode-cdn.net/home/woka/.vscode/extensions/continue.continue-0.8.46-linux-x64/gui/assets/index.js:684:23379
[2024-08-15T05:20:55] [ERROR] {}
smiling-watermelon commented 3 months ago

Note, found it after reading the source code, it's in: ~/.continue/index

I've removed the tab-autocomplete database (and related files), for now the app seems to be working properly.

I'd suggest handling this type of error, and show which database is malformed, at least.

fry69 commented 3 months ago

Switch to the latest Pre-Release 0.9.197 in the extension view for Continue (top right).

Also stop VSCode, delete the entire ~/.continue/index folder (it will get rebuilt automatically) and start VSCode again.

If this problem appears again, please post here.

(BTW: This is the first corrupt SQLite db file I see, this is very rare. Are you sure nothing else is interfering on your system? SQLite and their db files are extremely widely used and extremely stable. To corrupt a SQLite db file extraordinary things usually happen, none of which Continue is capable of.)

JakubCerven commented 3 months ago

Switch to the latest Pre-Release 0.9.197 in the extension view for Continue (top right).

Also stop VSCode, delete the entire ~/.continue/index folder (it will get rebuilt automatically) and start VSCode again.

If this problem appears again, please post here.

(BTW: This is the first corrupt SQLite db file I see, this is very rare. Are you sure nothing else is interfering on your system? SQLite and their db files are extremely widely used and extremely stable. To corrupt a SQLite db file extraordinary things usually happen, none of which Continue is capable of.)

encountered same problem as described in the issue, upgrading to pre-release solved the problem

fry69 commented 3 months ago

encountered same problem as described in the issue, upgrading to pre-release solved the problem

You also saw a corrupt SQLite db file? This should absolutely never happen IMHO. Can you please post your system specs roughly, which OS version, which VSCode/Continue version (before you upgraded), etc?

sealad886 commented 3 months ago

I'm pretty reliably able to corrupt the SQLite DB by adding or removing files outside of VSC within a previously indexed path, then moving the Window back to somewhere that includes that folder. Took me a while to get there, but that's the behavior I'm able to re-create at this point. Of note, VSC can be open or closed, and it will still corrupt the db when trying to refresh.