Multi Distribution builds of Element

Element is the glossy matrix web tool in an electron wrapper

Name Changed
Comments 9

Petr Rezacek's avatar

Great repo with very fast updates of element! Do you plan to create builds for Fedora 37? Thank you for reply and keep up good work! Just let me know if I can help

Regards


Crab Grass's avatar

Hi,

For whatever reason I cannot use the message search feature under Fedora 37. Under "Message search" in the settings, I am getting the error 'Message search initialisation failed', 'Error opening the database: SqlCipherError("Sqlcipher support is missing")'. Is there a known solution to this?

Thank you in advance!


James Bottomley's avatar

I don't have an actual Fedora system to check on, but the package lists

libsqlcipher-3.34.1.so.0()(64bit)

As a dependency. Can you check if you actually have it installed? If you do, it's likely something is broken with the Fedora installation of sqlcipher


Crab Grass's avatar

Yes, the sqlcipher package is installed:

$ dnf info sqlcipher
Last metadata expiration check: 0:00:42 ago on Wed 08 Mar 2023 13:16:27 GMT.
Installed Packages
Name         : sqlcipher
Version      : 4.4.3
Release      : 5.fc37
Architecture : x86_64
Size         : 2.3 M
Source       : sqlcipher-4.4.3-5.fc37.src.rpm
Repository   : [@System](https://build.opensuse.org/users/System)
From repo    : fedora
Summary      : SQLCipher is an open source extension to SQLite that provides transparent 256-bit AES encryption of database files.
URL          : https://github.com/sqlcipher/sqlcipher
License      : BSD
Description  : SQLCipher is an open source library that provides transparent, secure 256-bit
             : AES encryption of SQLite database files. SQLCipher has been adopted as a secure
             : database solution by many commercial and open source products, making it one of
             : the most popular encrypted database platforms for Mobile, Embedded, and Desktop
             : applications

I also have the libsqlcipher shared library installed:

$ ls -lah /usr/lib64 | grep sqlcipher
lrwxrwxrwx. 1 root root    28 Jul 23  2022 libsqlcipher-3.34.1.so.0 -> libsqlcipher-3.34.1.so.0.8.6
-rwxr-xr-x. 1 root root  943K Jul 23  2022 libsqlcipher-3.34.1.so.0.8.6

After setting the path of this shared library with LD_PRELOAD, the message search feature appears to work, however it crashes after having indexed some number of messages (in this case, it managed to index about 800 messages before crashing):

$ LD_PRELOAD='/usr/lib64/libsqlcipher-3.34.1.so.0.8.6' /usr/bin/element-desktop
/home/jazz/.config/Element exists: yes
/home/jazz/.config/Riot exists: no
No update_base_url is defined: auto update is disabled
Fetching translation json for locale: en_EN
Changing application language to en
Fetching translation json for locale: en
Resetting the UI components after locale change
Resetting the UI components after locale change
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Changing application language to en
Fetching translation json for locale: en
Resetting the UI components after locale change
[11801:0308/132740.487308:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[11801:0308/132745.172579:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[11801:0308/132748.483524:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
Trace/breakpoint trap (core dumped)

Note that this crashing behaviour (after indexing some number of messages) is common under Fedora with the flatpak element package ( https://flathub.org/apps/details/im.riot.Riot ).

It looks like this user https://github.com/flathub/im.riot.Riot/issues/339#issuecomment-1459712493 is experiencing the same issue as me (with the same symptoms, outlined above) with this element-desktop rpm package.


James Bottomley's avatar

This sounds like a bug in the Fedora sqlcipher package. Leap 15.4 has the same version

sqlcipher-4.4.3-bp154.1.64.x86_64

but searching thousands of encrypted messages there works just fine for me


Matthias Andree's avatar

https://github.com/matrix-org/seshat/issues/102

The thing is that GNOME/GTK want tracker, which uses libtracker-sparql, which then pulls in the sqlite3 shared object (library, 2nd from bottom below) which prevents sqlcipher from loading. Screenshot from Fedora 38 x86_64:

Install pax-utils and possibly python3-pyelftools, then you have an lddtree script which gives:

/usr/bin/element-desktop (interpreter => /lib64/ld-linux-x86-64.so.2)
...
    libgtk-3.so.0 => /lib64/libgtk-3.so.0
        libgdk-3.so.0 => /lib64/libgdk-3.so.0
            libwayland-cursor.so.0 => /lib64/libwayland-cursor.so.0
            libwayland-egl.so.1 => /lib64/libwayland-egl.so.1
            libXcursor.so.1 => /lib64/libXcursor.so.1
                libXrender.so.1 => /lib64/libXrender.so.1
            libXinerama.so.1 => /lib64/libXinerama.so.1
        libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0
        libharfbuzz.so.0 => /lib64/libharfbuzz.so.0
            libfreetype.so.6 => /lib64/libfreetype.so.6
            libharfbuzz.so.0 => !!! circular loop !!!
                libbz2.so.1 => /lib64/libbz2.so.1
                libpng16.so.16 => /lib64/libpng16.so.16
                libbrotlidec.so.1 => /lib64/libbrotlidec.so.1
                    libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1
            libgraphite2.so.3 => /lib64/libgraphite2.so.3
        libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0
        libfontconfig.so.1 => /lib64/libfontconfig.so.1
            libxml2.so.2 => /lib64/libxml2.so.2
        libfribidi.so.0 => /lib64/libfribidi.so.0
        libcairo-gobject.so.2 => /lib64/libcairo-gobject.so.2
        libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0
            libjpeg.so.62 => /lib64/libjpeg.so.62
        libepoxy.so.0 => /lib64/libepoxy.so.0
        libXi.so.6 => /lib64/libXi.so.6
        libcloudproviders.so.0 => /lib64/libcloudproviders.so.0
        libtracker-sparql-3.0.so.0 => /lib64/libtracker-sparql-3.0.so.0
            libjson-glib-1.0.so.0 => /lib64/libjson-glib-1.0.so.0
            libsqlite3.so.0 => /lib64/libsqlite3.so.0
        libwayland-client.so.0 => /lib64/libwayland-client.so.0

For me, using LD_PRELOAD to force a preloading of libsqlcipher seems to fix this with your existing OBS package as of element-desktop-1.11.31-2.1.x86_64. Not sure if it's worthwhile trying to link sqlcipher statically for Fedora. LD_PRELOAD=/lib64/libsqlcipher.so /usr/bin/element-desktop


James Bottomley's avatar

I think this has to be the solution. I know how to build matrix seshat with static sqlcipher, but the problem is Fedora (at least the version available to OBS) doesn't actually have a package with the static library in it. I could potentially do a modified server:database:sqlcipher to package it statically for Fedora, but that would be awfully fragile


Petr Rezacek's avatar

Hello jejb1, could you please take a look on the packages which are used for build?

I got following error for version 1.11.49 and 1.11.50

Error: Transaction test error:
  file /usr/lib/.build-id/07/023eb4f297ae1d4591ec808ab20b2788c542be from install of element-desktop-1.11.50-1.1.x86_64 conflicts with file from package python3-3.12.0-1.fc39.x86_64

Thank you!


James Bottomley's avatar

This seems to be a known problem with fedora builds:

https://build.opensuse.org/package/show/home:jejb1:Element/element-desktop#comment-1742980

But I don't know how to fix it (except by force installing)

openSUSE Build Service is sponsored by