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.48k stars 1.69k forks source link

Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: code_snippets.path, code_snippets.cacheKey... #2111

Open appinteractive opened 2 months ago

appinteractive commented 2 months ago

Before submitting your bug report

Relevant environment info

- OS: macOS 14.5 
- Continue: v0.8.46
- IDE: VS Code
- Model: Codestral + Claude 3.5 Sonnet
- config.json:

{
  "models": [
    {
      "title": "Codestral",
      "provider": "mistral",
      "model": "codestral-latest",
      "apiKey": "***"
    },
    {
      "model": "claude-3-5-sonnet-20240620",
      "contextLength": 200000,
      "title": "Claude 3.5 Sonnet",
      "apiKey": "***",
      "provider": "anthropic"
    },
    {
      "title": "Llama 3",
      "provider": "ollama",
      "model": "llama3"
    },
    {
      "title": "Ollama",
      "provider": "ollama",
      "model": "AUTODETECT"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "***"
  },
  "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": false
}

Description

I do always get this error in a project, and the deletion of the index (~/.continue/index) does not help as it will crash again.

2078 and #2100 seem to be similar, but not exactly the same.

Bildschirmfoto 2024-08-27 um 11 46 26

To reproduce

Try to use continue in a project, and after some time the index starts to fail and does not recover.

Log output

no logs found, neigter in vscode nore in the ~/.continue/ dir
mathiasleroy commented 2 months ago

Same here. I tried to

This is new since today for me.

LeonardoMantovani commented 2 months ago

Same error on IDEA after updating the IDE and the plugin to the latest version

priyashpatil commented 2 months ago

There are some improvements being made in code indexing these should be resolved sooner. For a workaround see if there is any popup for rebuilding the index if not then deleting the ~/.continue/index folder should fix the issue (after deleting make sure to reindex by clicking on the indexing indicator or CMD+Shift+P -> Continue: Codebase force re-index).

woq commented 2 months ago

There are some improvements being made in code indexing these should be resolved sooner. For a workaround see if there is any popup for rebuilding the index if not then deleting the ~/.continue/index folder should fix the issue (after deleting make sure to reindex by clicking on the indexing indicator or CMD+Shift+P -> Continue: Codebase force re-index).

The same error occurred. When I directly clicked "Rebuild" in Pycharm and Webstorm, the problem could not be solved. According to your solution, after deleting the index, this problem was solved.

appinteractive commented 2 months ago

There are some improvements being made in code indexing these should be resolved sooner. For a workaround see if there is any popup for rebuilding the index if not then deleting the ~/.continue/index folder should fix the issue (after deleting make sure to reindex by clicking on the indexing indicator or CMD+Shift+P -> Continue: Codebase force re-index).

Hey @priyashpatil thanks for replying, sadly as mentioned in the description, deleting the index does not help as the same error occurs again very quickly.

So fingers crossed 🤞 for the improvements in the next version

sestinj commented 2 months ago

This should now be solved in the latest EAP release and VS Code version 0.9.202. I'll wait to close the issue however until we've had time to verify that this is not happening for anyone in version 0.0.65

Patrick-Erichsen commented 2 months ago

This issue appears to have regressed in JetBrains: https://github.com/continuedev/continue/issues/2320

appinteractive commented 1 month ago

For me it seems to be gone