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

"Message search initialisation failed, check your settings for more information" #904

Closed
nyanpasu64 opened this issue Sep 13, 2021 · 45 comments · Fixed by #1001
Closed

"Message search initialisation failed, check your settings for more information" #904

nyanpasu64 opened this issue Sep 13, 2021 · 45 comments · Fixed by #1001
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Upstream

Comments

@nyanpasu64
Copy link

Steps to reproduce

  1. Open an encrypted chat in the People category.
  2. Click the search button.

What happened?

What did you expect?

Search works.

What happened?

I see a message saying "Message search initialisation failed, check your settings for more information".

Operating system

Windows 10 x64

Application version

Element version: 1.8.2, Olm version: 3.2.3

How did you install the app?

winget install element, subsequently upgraded within Element

Homeserver

matrix.org

Have you submitted a rageshake?

No

@SimonBrandner SimonBrandner added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Sep 13, 2021
@germain-gg
Copy link
Contributor

Thank you for raising this issue,
Could you go in your settings and report the error message mentioned there?

Should probably be mitigated by element-hq/element-web#18164

@G2G2G2G
Copy link

G2G2G2G commented Sep 27, 2021

Thank you for raising this issue,
Could you go in your settings and report the error message mentioned there?

Should probably be mitigated by element-hq/element-web#18164

Next time tell him where the hell to find the error because it isn't intuitive at all.

Error opening the database: IndexError(IOError(IOError { path: None, err: Custom { kind: Other, error: "Invalid MAC" } }))

1

Also note this happens in e2e rooms only, and the NON ENCRYPTED MESSAGES do appear in those rooms (for example I sent POST requests via a bot into the room ID and those are (red alarm marked as non-encrypted) they appear via the search fine but no other post does. The error shows up regardless if the bot is in the room or not.. it shows up in all e2e rooms.

This error appeared last few months, some of my rooms are year+ old and worked fine until month ago or more no idea.. now they do not.

@nyanpasu64
Copy link
Author

nyanpasu64 commented Sep 27, 2021

Next time tell him where the hell to find the error because it isn't intuitive at all.

them*

Also the error is: Error opening the database: SqlCipherError("Sqlcipher support is missing")

But yes, the error message needs to be presented better to the user. If this is an Arch Linux packaging error, perhaps Element should check for Sqlcipher up front, and refuse to launch (or popup a dialog on startup) saying it's missing, so the Arch packagers won't ship a subtly broken package.


The weird thing is that I already have sqlcipher-4.4.3-1 installed, since the element-desktop package already requires sqlcipher... but it still fails to load.

@G2G2G2G
Copy link

G2G2G2G commented Sep 27, 2021

Could be an arch issue, I am using https://aur.archlinux.org/packages/element-desktop-nightly-bin/ with a different error message (as posted above) however both are related to search..

@anoadragon453 (assuming it's the same person) said

Element Desktop supports searching messages locally in encrypted rooms through something called seshat, which is bundled in the debian package. Seshat has a runtime dependency on libsqlcipher, and Element Desktop will print the following error upon startup if libsqlcipher is not found:

~ >>> element-desktop-nightly
Seshat unexpected error: Error: libsqlcipher.so.0: cannot open shared object file: No such file or directory Installing the sqlcipher package from the community repo solves this error and enables encrypted message search. I recommend adding it as a dependency of this package.

3.34.1 2021-01-20 14:10:07 10e20c0b43500cfb9bbc0eaa061c57514f715d87238f4d835880cd846b9ealt1 (SQLCipher 4.4.3 community)

I also have it looks like

@germain-gg
Copy link
Contributor

Could you both try to "reset" the message index?
You might experience a suboptimal search experience whilst seshat crawls through the sync history, but it will eventually catch up to the state it was on

It would be interesting to see whether Element can recover and initialise seshat properly. If that's the case, it could indicate a race condition during the first initialisation phase. Otherwise it could be a packaging issue

@nyanpasu64
Copy link
Author

I tried clicking Reset, and the settings page didn't change except for a spinner, and trying to open search still popped up "Message search initialisation failed". When I closed and reopened the Settings page, I still see "Message search initialisation failed", but the settings shows an Enable button instead, and clicking it didn't do anything immediately (but create a spinner).

When I try clicking the Enable button, the dev tools shows error:

Uncaught (in promise) TypeError: Cannot read property 'addInitialCheckpoints' of null
    at EventIndexPanel.tsx:129

The rageshake.tar file shows EventIndex: Error initializing the event index {"message":"Error opening the database: SqlCipherError(\"Sqlcipher support is missing\")"} in the most recent log-0.log file, even though this message no longer appears on the GUI.

@G2G2G2G
Copy link

G2G2G2G commented Sep 28, 2021

@gsouquet
tbh didn't even know this section of settings existed, would have clicked that earlier

Main page goes to:

Securely cache encrypted messages locally for them to appear in search results, using 2 MB to store messages from 22 rooms.

When you click "manage" it shows:
1
(by default it was 3000ms but I set it to 500)

It's still going but it looks like my searches are working, none report and error.

Space used: 89 MB
Indexed messages: 75,784
Indexed rooms: 23 out of 24

So at some point my indexes broke and they weren't able to fix themselves?

And nyan's stuff.. just can't find sqlcipher I guess?

@mrambossek
Copy link

mrambossek commented Oct 3, 2021

So at some point my indexes broke and they weren't able to fix themselves?

does your search actually find stuff from e2e channels now, though?
i had a similar issue, was able to fix it by clicking reset, but search simply wont find content from e2e channels now, even though the counter says i have thousands of messages indexed. words in non-e2e channels can be found fine.
(yes i did wait for it to finish indexing and tried restarting element-desktop several times etc etc... doesn't matter)

@G2G2G2G
Copy link

G2G2G2G commented Oct 5, 2021

does your search actually find stuff from e2e channels now, though?

Yes that is what "looks like my searches are working" means
make sure the sqlcipher is installed (if you're on linux) no idea from there, mine is working fine now.

@G2G2G2G
Copy link

G2G2G2G commented Oct 15, 2021

Looks like it broke again lmao

Error opening the database: SqlCipherError("Sqlcipher support is missing")

reindexing fixed it again...

hahah nvm it just broke again and now it hangs on
1
forever. I've recompiled it too and it does it still so whatever
I'll leave it for a night maybe it is indexing.. but barely any cpu/disk usage compared to last time.

@msrd0
Copy link

msrd0 commented Oct 15, 2021

I have exactly the same problem as @G2G2G2G. I couldn't search messages, tried to reset the index and now it cannot be recreated. I've installed element through the official ArchLinux packages.

@nyanpasu64
Copy link
Author

nyanpasu64 commented Oct 15, 2021

The Arch bug is being tracked at https://bugs.archlinux.org/task/72359, which references matrix-org/seshat#102 (probably the same bug reported in a different tracker). However it doesn't seem fixed yet.

@G2G2G2G
Copy link

G2G2G2G commented Oct 16, 2021

Leaving it on all night (like I said in last comment) didn't do anything.

Also if it helps anyone get to the bottom of it: I've recreated it on manjaro too (idk how similar the distros are or whatever)

This is the error clicking the "enable" (button above in screenshot) produces
1

@dkasak
Copy link
Member

dkasak commented Oct 18, 2021

Note that if you're seeing Message search initialisation failed (and Error opening the database: SqlCipherError("Sqlcipher support is missing") when expanded), then this is likely about matrix-org/seshat#102. If you're seeing something else, then you're likely encountering a different bug.

For matrix-org/seshat#102, a temporary workaround, which works for Arch at least, can be found here. This workaround will be applied to the Arch package (or has been already) so that you don't need to do it manually, but it might be useful for other affected distributions.

@G2G2G2G
Copy link

G2G2G2G commented Oct 19, 2021

@dkasak thanks worked for me with my error of not being able to click the "enable" button (which was underlying sqlcipher issue as we know from previously)

LD_PRELOAD=/usr/lib/libsqlcipher.so exec "/opt/Element-Nightly/element-desktop-nightly" --disable-dev-mode "$@"

(I'm using https://aur.archlinux.org/packages/element-desktop-nightly-bin/ )

@dud1337
Copy link

dud1337 commented Feb 1, 2022

I have this issue on debian testing with element 1.10.1. With the following error message:

Error opening the database: DatabaseUnlockError("Invalid passphrase")

image

I did not have this issue on debian bullseye on element 1.9.9 and 1.10.1. Might try W10 later.

@viasux
Copy link

viasux commented Jun 21, 2022

I have this issue too. Arch Linux,
Element version: 1.10.15
Olm version: 3.2.8

@dolfies
Copy link

dolfies commented Jun 23, 2022

Also have this issue.
Windows version: Windows 11 Insider Preview (25140.1000)
Element version: 1.10.15
Olm version: 3.2.8

@dud1337
Copy link

dud1337 commented Jun 24, 2022

This element-hq/element-web#14229 (comment) worked for me as a temporary fix, but one must wait for reindexing.

@HammyHavoc
Copy link

Having this problem too. Using Element on Windows 11.

@carnifexx
Copy link

carnifexx commented Aug 5, 2022

the search was always completely broken for the windows app. it can't find even a single or any messaged word directly shown below.
at least in the webapp you can use the browser search, i assume, but here it doesn't even begin to search any of the words already shown.

@viasux
Copy link

viasux commented Aug 5, 2022

the search was always completely broken for the windows app. it can't find even a single or any messaged word directly shown below. at least in the webapp you can use the browser search, i assume, but here it doesn't even begin to search any of the words already shown.

funny, for me it only worked on my windows install

@jxu
Copy link

jxu commented Sep 3, 2022

I have this issue as well on Ubuntu 22.04
Element version: 1.10.15
Olm version: 3.2.8

I pressed the reset button and it seems to be recaching my messages correctly for search.

@KeenMaron
Copy link

Have the same issue. Sometimes it works, but in the most use cases it does not.

Windows 10
Version Element: 1.11.8
Version Olm: 3.2.12

@Polve
Copy link

Polve commented Oct 26, 2022

I have the same problem with v1.11.12 on ubuntu 22.04

I've not understood if there is workaround

@dkasak
Copy link
Member

dkasak commented Oct 26, 2022

@Polve, see matrix-org/seshat#102 (comment) for the only known workaround.

@bdrewery
Copy link

bdrewery commented Oct 30, 2022

The EventStore directory on Windows does not respect the --profile flag. It uses the default profile directory/EventStore. After deleting that one then the 2nd profile search was able to initialize for me.

@t3chguy
Copy link
Member

t3chguy commented Oct 31, 2022

@bdrewery good spot, just made a PR to ensure EventStore is maintained per-profile

@ManuelFte
Copy link

ManuelFte commented Dec 19, 2022

I tend to get this error whenever Manjaro is updated, and it has never been solved with any of the fixes I've found; but it does get solved merely by uninstalling the app and installing it again. ¯\_(ツ)_/¯

@t3chguy
Copy link
Member

t3chguy commented Dec 19, 2022

@ManuelFte the manjaro package is community maintained, I suggest reporting it to them given I've not seen similar reports for the official packages

@jcierocki
Copy link

I noticed those errors after upgrading from Fedora 36 to 37. The error was probably there before (the upgrade).

Initially, I was getting:

Error opening the database: IndexError(IOError(IOError { path: None, err: Custom { kind: Other, error: "Invalid MAC" } }))

After resetting the search index I am getting:

Error opening the database: DatabaseUnlockError("Invalid passphrase")

The versions I am currently using:
Element: 1.11.17
Olm: 3.2.12

Do you recommend me to re-install the app or maybe downgrade the version the some of the previous ones?

@jxu
Copy link

jxu commented Jan 6, 2023

Matrix was also down yesterday
try again today

@JeanPaulLucien
Copy link
Contributor

JeanPaulLucien commented Jan 19, 2023

Error opening the database: DatabaseUnlockError("Invalid passphrase")

Windows 7x64, Element Desktop 1.11.17. What should I do to fix?

@Anagastes
Copy link

Its back amon the living with the debian precompiled package

Version von Element: 1.11.23
Version von Olm: 3.2.12

If I use the Arch-Version, element-desktop crash if search is enable ...

@thegcat
Copy link

thegcat commented Feb 20, 2023

I also have the error Invalid MAC on macOS, versions:

Version von Element: 1.11.23
Version von Olm: 3.2.12

@czarau
Copy link

czarau commented Mar 20, 2023

Error opening the database: DatabaseUnlockError("Invalid passphrase")

Windows 7x64, Element Desktop 1.11.17. What should I do to fix?

I fixed this issue by shutting down element. I then deleted C:\Users\AAAAAA\AppData\Roaming\Element\EventStore and restarted the app. I then watched the indexes rebuild correctly under Settings / Security & Privacy / Message search / Manage.

@InklingGirl
Copy link

InklingGirl commented Apr 1, 2023

Search has been working for me for months, but this issue just happened to me today, how can I fix it? I use Element on Ubuntu 22.04 as an apt package from the Debian repo.

@KeenMaron
Copy link

Error opening the database: DatabaseUnlockError("Invalid passphrase")

Windows 7x64, Element Desktop 1.11.17. What should I do to fix?

I fixed this issue by shutting down element. I then deleted C:\Users\AAAAAA\AppData\Roaming\Element\EventStore and restarted the app. I then watched the indexes rebuild correctly under Settings / Security & Privacy / Message search / Manage.

Good to know but still such workarounds shouldn't be normality to use the software as intended

@t3chguy t3chguy transferred this issue from element-hq/element-web Apr 25, 2023
@Porkepix
Copy link

I've reset my messages index after encountering the issue, and now have regular crashes probably related. Opened #932 for that.

@HammyHavoc
Copy link

C:\Users\AAAAAA\AppData\Roaming\Element\EventStore

Just did this and now watching it rebuild my message index. Strange problem.

@BubuOT
Copy link

BubuOT commented Oct 17, 2023

My element desktop was perpetually stuck at "Message search initialisation failed: Unknown error".

Removing ~/.config/Element/EventStore/ and starting element again started the re-index process (which now keeps running into #932).

This is with the offical element deb packages.

@sergiomb2
Copy link

sergiomb2 commented Jan 2, 2024

My element desktop was perpetually stuck at "Message search initialisation failed: Unknown error".

Removing ~/.config/Element/EventStore/ and starting element again started the re-index process (which now keeps running into #932).

This is with the offical element deb packages.

I just found add export LD_PRELOAD=/usr/lib64/libsqlcipher.so before start element-desktop, fix the problem for me . based on NixOS/nixpkgs#153279 , If you enter in electron console (ctrl + shit + i) you may find on reset event store the message "Sqlcipher support is missing"

@sergiomb2
Copy link

I think the original issue is this one matrix-org/seshat#102

@sergiomb2
Copy link

well the problem is with sqlcipher sqlcipher/sqlcipher#385

@amontalenti
Copy link

amontalenti commented Jun 10, 2024

I also hit this issue on element-desktop, Ubuntu Linux 20.04 LTS.

Element version: 1.11.68
Crypto version: Rust SDK 0.7.0 (068a0af), Vodozemac 0.6.0

My package is installed via apt / dpkg using this sources.list line:

deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main                                                          

Whereas apt shows:

❯ apt show element-desktop
Package: element-desktop
Version: 1.11.68
[...]

In my case the error in "Message search" section of Settings is "Unknown error." I haven't tried resetting the index. It affects E2E encrypted DMs, not un-encrypted rooms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.