element-web icon indicating copy to clipboard operation
element-web copied to clipboard

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

Open nyanpasu64 opened this issue 4 years ago • 22 comments

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

nyanpasu64 avatar Sep 13 '21 04:09 nyanpasu64

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

Should probably be mitigated by #18164

germain-gg avatar Sep 20 '21 08:09 germain-gg

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

Should probably be mitigated by #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.

G2G2G2G avatar Sep 27 '21 21:09 G2G2G2G

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.

nyanpasu64 avatar Sep 27 '21 21:09 nyanpasu64

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

G2G2G2G avatar Sep 27 '21 21:09 G2G2G2G

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

germain-gg avatar Sep 28 '21 08:09 germain-gg

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.

nyanpasu64 avatar Sep 28 '21 08:09 nyanpasu64

@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?

G2G2G2G avatar Sep 28 '21 15:09 G2G2G2G

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)

mrambossek avatar Oct 03 '21 16:10 mrambossek

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 avatar Oct 05 '21 17:10 G2G2G2G

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.

G2G2G2G avatar Oct 15 '21 09:10 G2G2G2G

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.

msrd0 avatar Oct 15 '21 15:10 msrd0

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

nyanpasu64 avatar Oct 15 '21 15:10 nyanpasu64

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

G2G2G2G avatar Oct 16 '21 05:10 G2G2G2G

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 https://github.com/matrix-org/seshat/issues/102. If you're seeing something else, then you're likely encountering a different bug.

For https://github.com/matrix-org/seshat/issues/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.

dkasak avatar Oct 18 '21 07:10 dkasak

@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/ )

G2G2G2G avatar Oct 19 '21 09:10 G2G2G2G

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.

dud1337 avatar Feb 01 '22 21:02 dud1337

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

viasux avatar Jun 21 '22 20:06 viasux

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

dolfies avatar Jun 23 '22 23:06 dolfies

This https://github.com/vector-im/element-web/issues/14229#issuecomment-745276193 worked for me as a temporary fix, but one must wait for reindexing.

dud1337 avatar Jun 24 '22 02:06 dud1337

Having this problem too. Using Element on Windows 11.

HammyHavoc avatar Jul 12 '22 11:07 HammyHavoc

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.

carnifexx avatar Aug 05 '22 13:08 carnifexx

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

viasux avatar Aug 05 '22 16:08 viasux

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.

jxu avatar Sep 03 '22 01:09 jxu

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

KeenMaron avatar Sep 30 '22 16:09 KeenMaron

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

I've not understood if there is workaround

Polve avatar Oct 26 '22 16:10 Polve

@Polve, see https://github.com/matrix-org/seshat/issues/102#issuecomment-943311270 for the only known workaround.

dkasak avatar Oct 26 '22 17:10 dkasak

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.

bdrewery avatar Oct 30 '22 23:10 bdrewery

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

t3chguy avatar Oct 31 '22 12:10 t3chguy