Skip to content

Indexing sometime fails with SQLite error about UNIQUE constraint failed. #3622

Closed
@guibou

Description

@guibou

Sometime, during Indexing, hls returns an exception:

HieDb writer thread SQLite error:\n  SQLite3 returned ErrorConstraint while attempting to perform step: UNIQUE constraint failed: defs.hieFile, defs.occ

Your environment

Using NixOS, GHC 9.6.2 (but was happening with 9.6.1 recently), neovim and HLS 1.9.1.0 built from source with minor patchs which should not be relevant (see #TODO)

The project is built with nix with a custom build system and the setup of HLS is done with custom in-house scripts.

Steps to reproduce

I have no idea.

Expected behaviour

Maybe the exception is due to a bug in the indexing mechanism, the exception should not be returned.

Actual behaviour

HieDb writer thread SQLite error:\n  SQLite3 returned ErrorConstraint while attempting to perform step: UNIQUE constraint failed: defs.hieFile, defs.occ

Debug information

Note that I observed this exception and wrote #3610 (comment) because of it. In that MR, I fixed the way HLS was reacted to this exception (it was forgetting to remove the Indexing status), but not the cause of the exception.

Metadata

Metadata

Assignees

Labels

component: hiedbtype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions