Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL ERROR: UNIQUE constraint failed: #1088

Closed
Massimo-B opened this issue Mar 23, 2022 · 9 comments
Closed

SQL ERROR: UNIQUE constraint failed: #1088

Massimo-B opened this issue Mar 23, 2022 · 9 comments
Assignees

Comments

@Massimo-B
Copy link

core: Albert version: 0.17.2
core: Build date: Jan 12 2021 05:00:34
core: Qt version: 5.15.2
core: QT_QPA_PLATFORMTHEME: qt5ct
core: Binary location: /usr/bin/albert
core: PWD: /home/massimo
core: SHELL: /bin/bash
core: LANG: de_DE.UTF-8
core: XDG_SESSION_TYPE: tty
core: XDG_CURRENT_DESKTOP:
core: DESKTOP_SESSION:
core: XDG_SESSION_DESKTOP:
core: OS: Gentoo/Linux
core: OS (type/version): gentoo/unknown
core: Build ABI: x86_64-little_endian-lp64
core: Arch (build/current): x86_64/x86_64
core: Kernel (type/version): linux/5.16.11-gentoo-dist

Recently albert crashes when opening the search bar via shortcut and closing it again:

Part of the stdout:

13:47:35 [info:applications] Indexed 59295 files in 3112 directories.
13:47:37 [debg:core] ========== SESSION SETUP STARTED ==========
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.files]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.calculator]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.applications]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.terminal]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.websearch]
13:47:37 [debg:core] TIME:      0 µs SESSION SETUP [org.albert.extension.ssh]
13:47:37 [debg:core] TIME:     54 µs SESSION SETUP OVERALL
13:47:37 [debg:core] ========== QUERY:   ==========
13:47:37 [debg:core] TIME:     25 µs SESSION TEARDOWN OVERALL
13:47:37 [debg:core] TIME:      1 µs MATCHES [org.albert.extension.files]
13:47:37 [debg:core] TIME:      0 µs MATCHES [org.albert.extension.terminal]
13:47:37 [debg:core] TIME:      7 µs MATCHES [org.albert.extension.websearch]
13:47:37 [debg:core] TIME:      1 µs MATCHES [org.albert.extension.ssh]
13:47:37 [debg:core] TIME:      1 µs MATCHES [org.albert]
13:47:37 [debg:core] TIME:     94 µs MATCHES [org.albert.extension.applications]
13:47:37 [debg:core] TIME:      0 µs MATCHES [org.albert.extension.calculator]
13:47:37 [debg:core] TIME:   3631 µs QUERY OVERALL
13:47:38 [debg:core] ========== SESSION TEARDOWN STARTED ==========
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.files]
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.calculator]
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.applications]
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert]
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.terminal]
13:47:38 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.websearch]
13:47:38 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.ssh]
13:47:38 [fatal:default] SQL ERROR: INSERT INTO execution (query_id, handler_id, runtime) VALUES (:query_id, :handler_id, :runtime); UNIQUE constraint failed: execution.query_id, execution.handler_id Unable to fetch row  --  [(null)]
@mbousq
Copy link

mbousq commented Mar 24, 2022

I have that exact same issue. However this only happens when accessing the preferences (both gui and cmd line). Please tell me if I can help somehow.

core:         Albert version: 0.17.2
core:             Build date: Oct 29 2017 00:00:00
core:             Qt version: 5.15.2
core:   QT_QPA_PLATFORMTHEME: 
core:        Binary location: /usr/bin/albert
core:                    PWD: /home/mathieu
core:                  SHELL: /bin/bash
core:                   LANG: en_GB.UTF-8
core:       XDG_SESSION_TYPE: x11
core:    XDG_CURRENT_DESKTOP: ubuntu:GNOME
core:        DESKTOP_SESSION: ubuntu
core:    XDG_SESSION_DESKTOP: ubuntu
core:                     OS: Ubuntu 21.10
core:      OS (type/version): ubuntu/21.10
core:              Build ABI: x86_64-little_endian-lp64
core:   Arch (build/current): x86_64/x86_64
core:  Kernel (type/version): linux/5.13.0-37-generic

@daton89
Copy link

daton89 commented Mar 27, 2022

I'm also having the same issue, coming from a fresh install, as soon as I open the search box with the hotkey and I search for something albert crashes and in the console i get the sql error:

11:47:47 [debg:core] ========== QUERY: mi  ==========
11:47:47 [debg:core] TIME:    221 µs SESSION TEARDOWN OVERALL
11:47:47 [debg:core] TIME:      8 µs MATCHES [org.albert]
11:47:47 [debg:core] TIME:    390 µs MATCHES [org.albert.extension.websearch]
11:47:47 [debg:core] TIME:     13 µs MATCHES [org.albert.extension.system]
11:47:47 [debg:core] TIME:      1 µs MATCHES [org.albert.extension.terminal]
11:47:47 [debg:core] TIME:    225 µs MATCHES [org.albert.extension.applications]
11:47:47 [debg:core] TIME:    293 µs MATCHES [org.albert.extension.firefoxbookmarks]
11:47:47 [debg:calculator] Muparser SetExpr exception:  Unexpected token "mi" found at position 0.
11:47:47 [debg:core] TIME:    360 µs MATCHES [org.albert.extension.chromium]
11:47:47 [debg:core] TIME:    831 µs MATCHES [org.albert.extension.calculator]
11:47:47 [debg:core] TIME:  17797 µs QUERY OVERALL
11:47:48 [debg:core] ========== QUERY: min  ==========
11:47:48 [debg:core] TIME:    216 µs SESSION TEARDOWN OVERALL
11:47:48 [debg:core] TIME:      1 µs MATCHES [org.albert.extension.terminal]
11:47:48 [debg:core] TIME:      6 µs MATCHES [org.albert]
11:47:48 [debg:core] TIME:     13 µs MATCHES [org.albert.extension.system]
11:47:48 [debg:core] TIME:    301 µs MATCHES [org.albert.extension.chromium]
11:47:48 [debg:core] TIME:    295 µs MATCHES [org.albert.extension.websearch]
11:47:48 [debg:core] TIME:    303 µs MATCHES [org.albert.extension.applications]
11:47:48 [debg:core] TIME:    306 µs MATCHES [org.albert.extension.firefoxbookmarks]
11:47:48 [debg:calculator] Muparser SetExpr exception:  Unexpected token "min" found at position 0.
11:47:48 [debg:core] TIME:    546 µs MATCHES [org.albert.extension.calculator]
11:47:48 [debg:core] TIME:  17597 µs QUERY OVERALL
11:47:48 [debg:core] ========== QUERY: mind  ==========
11:47:48 [debg:core] TIME:    164 µs SESSION TEARDOWN OVERALL
11:47:48 [debg:core] TIME:      7 µs MATCHES [org.albert]
11:47:48 [debg:core] TIME:      1 µs MATCHES [org.albert.extension.terminal]
11:47:48 [debg:core] TIME:     13 µs MATCHES [org.albert.extension.system]
11:47:48 [debg:core] TIME:    263 µs MATCHES [org.albert.extension.firefoxbookmarks]
11:47:48 [debg:core] TIME:    156 µs MATCHES [org.albert.extension.applications]
11:47:48 [debg:core] TIME:    453 µs MATCHES [org.albert.extension.websearch]
11:47:48 [debg:core] TIME:    266 µs MATCHES [org.albert.extension.chromium]
11:47:48 [debg:calculator] Muparser SetExpr exception:  Unexpected token "mind" found at position 0.
11:47:48 [debg:core] TIME:    517 µs MATCHES [org.albert.extension.calculator]
11:47:48 [debg:core] TIME:   7134 µs QUERY OVERALL
11:47:49 [debg:core] ========== SESSION TEARDOWN STARTED ==========
11:47:49 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.firefoxbookmarks]
11:47:49 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.websearch]
11:47:49 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.chromium]
11:47:49 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.terminal]
11:47:49 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert]
11:47:49 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.applications]
11:47:49 [debg:core] TIME:      0 µs SESSION TEARDOWN [org.albert.extension.calculator]
11:47:49 [debg:core] TIME:      1 µs SESSION TEARDOWN [org.albert.extension.system]
11:47:49 [fatal:default] SQL ERROR: INSERT INTO execution (query_id, handler_id, runtime) VALUES (:query_id, :handler_id, :runtime); UNIQUE constraint failed: execution.query_id, execution.handler_id Unable to fetch row  --  [(null)]

core:         Albert version: 0.17.2
core:             Build date: Oct 29 2017 00:00:00
core:             Qt version: 5.12.8
core:   QT_QPA_PLATFORMTHEME: 
core:        Binary location: /usr/bin/albert
core:                    PWD: /home/daton
core:                  SHELL: /usr/bin/zsh
core:                   LANG: en_US.UTF-8
core:       XDG_SESSION_TYPE: x11
core:    XDG_CURRENT_DESKTOP: ubuntu:GNOME
core:        DESKTOP_SESSION: ubuntu
core:    XDG_SESSION_DESKTOP: ubuntu
core:                     OS: Ubuntu 20.04.4 LTS
core:      OS (type/version): ubuntu/20.04
core:              Build ABI: x86_64-little_endian-lp64
core:   Arch (build/current): x86_64/x86_64
core:  Kernel (type/version): linux/5.13.0-37-generic

@charlesharries
Copy link

Ran into the same issue, looks like it has to do with Albert dumping after system updates. Maintainer says that it'll be fixed in 0.18, but in the meantime you can delete the core database and it should start working again:

rm ~/.config/albert/core.db

@daton89
Copy link

daton89 commented Apr 4, 2022

just tested the workaround and seems to work for me! thanks!

@Massimo-B
Copy link
Author

This ticket should be closed as duplicate of #1033 and closed. Seems that I can't do that.

@darioseidl
Copy link

I'm having the same problem. Removing the core.db only helps temporarily, after a while the error always comes back. I happens always when clicking on the settings cog, and (I think) sometimes when searching too. If posting logs or any debugging info would help, I can do that ...

@ManuelSchneid3r
Copy link
Member

aa1c46e

@ManuelSchneid3r
Copy link
Member

Can you help me debuggin this issue? I cant reproduce it.

@ManuelSchneid3r
Copy link
Member

I'll close this since it should actually be fixed with the commit above. If there's no delete operation there should be no missing foreign keys.

If you encounter the issue let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants