-
Notifications
You must be signed in to change notification settings - Fork 13
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
Seshat stopped working for me in Element Desktop 1.9.0 #102
Comments
The query is a valid check for sqlcipher support, you just disabled encryption for your event index. The reindex was presumably triggered because a fresh empty and most importantly unencrypted database was created. We have tests that check for this functionality in the repo, also you can check if this works correctly using $ node
Welcome to Node.js v16.10.0.
Type ".help" for more information.
> const {Seshat} = require('./');
undefined
> const db = new Seshat("path_to_my_store", {passphrase: "MY_PASSPHRASE"}); Adding debug prints for the sqlcipher support yields an additional line when opening the store: $ node
Welcome to Node.js v16.10.0.
Type ".help" for more information.
> const {Seshat} = require('./');
undefined
> const db = new Seshat("path_to_my_store", {passphrase: "MY_PASSPHRASE"});
sqlcipher check: [Ok("4.4.3 community")] In other words, the check works fine. Removing the check is not a fix, nor workaround. It just turns a broken setup into a silently broken one. We can leave the the debug line in and try to run the same Seshat binary through Element, this will yield the line on the terminal from which Element is being executed: sqlcipher check: [] So SQLCipher support seems to be missing, which is strange considering that $ ldd node_modules/matrix-seshat/native/index.node
linux-vdso.so.1 (0x00007fffceddd000)
libsqlcipher.so.0 => /usr/lib/libsqlcipher.so.0 (0x00007fc706bea000)
... Furthermore, when starting up, we can see that Element finds $ strace electron15 . --profile-dir ./profile_dir
...
openat(AT_FDCWD, "/usr/lib/libsqlcipher.so.0", O_RDONLY|O_CLOEXEC) = 41
... Considering that all Seshat tests still pass, the check worked for around ~1 year correctly, no code changes were made in Seshat, and most importantly Seshat works from node, I would say that this seems to be an Electron bug or some other strange interaction with packaging Element. That being said, not sure how to debug this further. |
Right, the new store is unencrypted.
Running that code results in:
Yep, can confirm that seshat is linked properly and the library is correctly installed:
Same for me: ❮ strace electron13 . --profile-dir ./profile_dir |& grep cipher
openat(AT_FDCWD, "/usr/lib/libsqlcipher.so.0", O_RDONLY|O_CLOEXEC) = 39
Good thinking, I forgot to test whether tests are passing and there are some failures for me:
|
Notably, opening the database manually with sqlcipher works:
It's also curious that this is happening for me but not for you with the same |
You didn't run the provided code, the second argument needs to be an object like it was shown in the example above: const db = new Seshat("path_to_my_store", {passphrase: "MY_PASSPHRASE"});
The tests are sadly stateful, remove/restore the
Yes, opening the store seems to work from Seshat and
It is happening for me, I already mentioned that I'm reproducing the issue from within Element, this line:
sqlcipher check: [] |
Ah right, sorry. It indeed loads correctly with that change.
True, and the two stateful tests do indeed fail on subsequent runs, but this error happens on the first too:
|
Ah ok, that was an error in some dependency of |
Could be related to https://bugs.archlinux.org/task/69980. That issue is basically due to GTK3 deciding to link sqlite3 into the process which prevents the process from also linking to sqlcipher since they both use the same symbols. Also see:
I opened an upstream issue for Arch Linux. A workaround for Arch at least which makes Seshat work again is to force the use of sqlcipher for Electron by modifying
As to how this will be fixed properly, I'm not really sure. |
So that’s how it ended up being fixed for Signal: signalapp/better-sqlite3@917a6f5 I don’t know where is the appropriate place for Element to fix that. |
Also related: element-hq/element-desktop#691 Arch just added a patch that makes the Linux build of |
I'm running version 1.10.8-2 on Arch (Repository: Community) with electron17 (17.4.0-1). I'm still getting these crashes if message search is enabled. |
@MountainX Can you get backtraces for them? Cause currently you’re the first to report still having crashes to my knowledge. Maybe there is some broken state somewhere in your local configuration because of the previous way things worked, though I would not advise cleaning the config folder as this might result in messages lost. |
Before I found the workaround of disabling Message Search, I was so desperate for a solution that I deleted my ~/.config/Element folder (and ~/.config/Electron folder) multiple times. Didn't lose any messages, but it also does not help this issue.
In the Element-Desktop room on Matrix, I saw others discussing this issue yesterday, which is what led me to report my issue. One user was on Arch, like me and also running the same versions as me, which are the latest packages in the Arch repos.. At least one of the devs in the room seemed to be aware that the issue was still not full resolved, if I was following the conversation correctly.
I'm not a developer. but I can try if it isn't that involved. What are the steps for getting a backtrace? I can reproduce the issue any time by enabling Message Search. (That's the same behavior I saw others report.) Element & Electron will crash soon after it is enabled. |
I can confirm the issue persists with arch's element desktop 1.10.10-1. They're not immediate, I'm not sure what exactly triggers them, and I have been using the nightly without search (and without the patch) rather than the stable with supposedly fixed search, apart from ~once a month when I actually need the search. In these cases I have still noticed crashes even within just the half hour of running the app. Update: hasn't crashed for 5h. Seems to have to do with actually working the sync or indexing. |
Yes, I'm on the same version and I still have these crashes too when message search is enabled. |
I'm not using arch linux so it's not an option for me, but thanks for the indications |
@Polve That workaround is not Arch-specific: you should still have an |
I don't have the indicated file in the variable LD_PRELOAD in my system, but I have /usr/lib/x86_64-linux-gnu/libsqlcipher.so.0.8.6, I can use it instead? But where do I get the electron13 binary? I don't have /usr/lib/element/app.asar too. Maybe the packaging is different? |
Having same issue on Fedora 37 using https://download.opensuse.org/repositories/home:jejb1:Element/Fedora_37/home:jejb1:Element.repo |
@williamd5 wrote:
But the workaround is the same, on Fedora 38 I am using: |
I had exact same issue with Fedora 38 and same repo
This works 💯 |
Seshat stopped working for me inside Element Desktop 1.9.0 with the following message:
Which is weird because sqlcipher is installed and I haven't changed my setup. I'm not sure when it stopped working and I'm failing to trace it to a particular update.
The problem seems to be that this query returns 0 results. This then makes this check fail. Recompiling element-desktop with that check disabled makes seshat work again (though it triggered a reindexing for some reason).
The text was updated successfully, but these errors were encountered: