axolotl-chat / axolotl

A Signal compatible cross plattform client written in Go, Rust and Vuejs
https://axolotl.chat
GNU General Public License v3.0
326 stars 52 forks source link

[BUG] Flatpak, x86/ARM electron exited with code: 7 #433

Closed oxwivi closed 1 year ago

oxwivi commented 3 years ago

Description

On Manjaro and Manjaro ARM, running the flatpak results in crash before any sort of UI can load:

$ flatpak run org.nanuc.Axolotl
INFO[0000] [axolotl] Starting Signal for Ubuntu version 0.9.8 
INFO[0000] [axolotl] Setup completed                    
INFO[0000] [axolotl] Start electron                     
INFO[0000] [axolotl] Axolotl server started             
INFO[0000] [axolotl] Starting axolotl ws                
DEBU[0000] [axolotl] Using axolotl-web path /app/bin/axolotl-web/dist 
DEBU[0000] [axolotl] Run Backend                        
DEBU[0000] [axolotl] openDb: /home/user/.local/share/textsecure.nanuc/db 
DEBU[0000] [axolotl] NewDataStore                       
INFO[0000] astikit: starting worker...                  
DEBU[0000] [axolotl] NewDataStore finished              
INFO[0000] [axolotl] Loading Chats                      
INFO[0000] [axolotl] Db setup finished                  
DEBU[0000] [axolotl] Start Session after Decryption     
DEBU[0000] [axolotl] starting Signal connection         
DEBU[0000] [axolotl] config path:  /home/user/.config/textsecure.nanuc 
DEBU[2021/03/15 16:29:14] [axoltol] Opening Dialog: getPhoneNumber     
DEBU[2021/03/15 16:29:14] [axolotl-ws] send request getPhoneNumber     
ERRO[0028] '/home/user/.config/textsecure.nanuc/electron/vendor/electron-linux-amd64/electron' exited with code: 7 
INFO[0028] astikit: stopping worker...                  
DEBU[2021/03/15 16:29:42] [axolotl-electron] main: creating window failed: context canceled 
DEBU[2021/03/15 16:29:42] [axolotl-electron] open dev tools false      
INFO[0028] astikit: worker is now waiting...            
ERRO[2021/03/15 16:29:42] [axolotl-electron] Electron App has crashed {app.crash app <nil>   <nil>   <nil>  <nil>  <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil>   <nil> <nil>  <nil> <nil>      <nil>} 
ERRO[0028] accept tcp 127.0.0.1:40997: use of closed network connection while TCP accepting

Steps to Reproduce

  1. Install flatpak from Flathub
  2. Run using .desktop file or flatpak run

Expected behavior: [What you expect to happen] Axolotl running.

Actual behavior: [What actually happens] Axolotl crashes.

Versions

Please provide the Version as written in Settings->About Axolotl N/A

Device

What device or OS are you using? Manjaro/Manjaro ARM

Link to Debug Log

Please provide a link to debug from ~/.cache/upstart/application-click-textsecure.nanuc_textsecure*.log Be careful it contains sensible data N/A (Can't find it in .var/app/org.nanuc.Axolotl dir, doesn't seem like Axolotl got to the point of generating the log; no equivalents on host home folder outside flatpak)

emiljoha commented 3 years ago

Seeing the same thing on a Librem 5 running PureOS.

s4msy commented 3 years ago

Confirmed, same here on pinephone with arch-linux plasma-mobile.

olof-nord commented 3 years ago

Could it be that this is an issue coming from Electron only allowing, per default, 6 connections per host?

From what I understand, the communication between the axolotl backend and frontend is done with WebSockets.

Electron offers a --ignore-connections-limit flag - perhaps setting the localhost domain as without limits could be a solution.

https://www.electronjs.org/docs/api/command-line-switches#--ignore-connections-limitdomains

https://github.com/electron/electron/blob/master/shell/common/options_switches.cc#L260

olof-nord commented 3 years ago

Did some initial testing, and I am starting to believe that this issue is not related to Electron, but to the go-helper go-astilectron which is used. The below issue mentions some problems regarding event handlers.

https://github.com/asticode/go-astilectron/issues/267

Another method might be to provide a known working Electron as a bundle bundle and not rely on downloading it at startup. That would definitely increase the install size though.

https://github.com/asticode/go-astilectron-bundler

We do have a QT version of the Flatpak which can be used, which does not rely on Electron. That could potentially be seen as a workaround as well.

https://github.com/nanu-c/axolotl/blob/main/docs/INSTALL.md#qt-version

oxwivi commented 3 years ago

We do have a QT version of the Flatpak which can be used, which does not rely on Electron. That could potentially be seen as a workaround as well.

https://github.com/nanu-c/axolotl/blob/main/docs/INSTALL.md#qt-version

Doesn't seem like existing flatpak can switch over to the Qt version on the fly.

otrebu commented 3 years ago

Unfortunately the Qt version doesn't work either for me on the pinephone.

MabeyC commented 3 years ago

+1 on Failed to start on Mobian Pinephone Attempted flathub repo and local build, same result as oxwivi

ghost commented 2 years ago

I am seeing the same issue on Artix Linux with the Flatpak I just downloaded.

Ferenc- commented 2 years ago

I am seeing the same issue on Artix Linux with the Flatpak I just downloaded.

The flatpak builds on flathub are currently outdated (v0.9.9 vs v1.0.9 ) and broken. There is WIP MR for fixing that.
In the meantime it should be possible to install like this: https://github.com/nanu-c/axolotl/discussions/615

olof-nord commented 2 years ago

The work on a new Flathub release is completed, and in the coming days there will be a new, updated, Axolotl Flathub version ready to install (using the latest Axolotl release, v1.1.0)

This release not only uses the latest and greatest of the axolotl and axolotl-web projects, but also includes the new libraries and perhaps most importantly, bundles Electron with the installer instead of installing it when first started as was the case previously.

To test this build already, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/78531/org.nanuc.Axolotl.flatpakref
langfingaz commented 2 years ago

Seems like the bug use of closed network connection while TCP accepting still resides in version 1.2.0.

Log from x86 Arch Linux - installed via flatpak ``` time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Starting axolotl version 1.2.0" time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Setup completed" time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl-electron] starting astilelectron with the following switches: [--disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto]" time="2022-04-16T21:50:30+02:00" level=info msg="astikit: starting worker..." time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Axolotl server started" time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Starting axolotl ws" time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Loading Chats" time="2022-04-16T21:50:30+02:00" level=info msg="[axolotl] Db setup finished" time="2022/04/16 21:50:30" level=info msg="[textsecure-crayfish] Starting crayfish-backend" time="2022/04/16 21:50:30" level=info msg="[crayfish] starting crayfish 7bbaf1665234ce8dd3455ded2164b107fae7f972\n" time="2022/04/16 21:50:30" level=info msg="[crayfish] Starting libsignal-service web socket at ws://127.0.0.1:9081/libsignal\n" time="2022-04-16T21:50:30+02:00" level=error msg="'/home/yoda/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-amd64/electron' exited with code: -1" time="2022-04-16T21:50:30+02:00" level=info msg="astikit: stopping worker..." time="2022/04/16 21:50:30" level=error msg="[axolotl-electron] main: creating window failed: context canceled" time="2022-04-16T21:50:30+02:00" level=info msg="astikit: worker is now waiting..." time="2022-04-16T21:50:30+02:00" level=error msg="accept tcp 127.0.0.1:39477: use of closed network connection while TCP accepting" time="2022/04/16 21:50:30" level=info msg="[axolotl] ending axolotl" time="2022/04/16 21:50:30" level=error msg="[axolotl] error stopping crayfish: [textsecure-crayfish-ws] there is no listening connection to stop" ```
Log from PinePhone (DanctNix) - installed via extracted arm64.deb release PKGBUILD used: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=axolotl-bin ``` ERRO[0000] [axolotl] creating settings file open /home/alarm/.config/textsecure.nanuc/settings.yml: no such file or directory INFO[0000] [axolotl] Starting axolotl version 1.2.0 INFO[0000] [axolotl] Setup completed INFO[0000] [axolotl-electron] starting astilelectron with the following switches: [--disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto] INFO[0000] astikit: starting worker... INFO[0000] [axolotl] Axolotl server started INFO[0000] [axolotl] Starting axolotl ws INFO[0000] [axolotl] Loading Chats INFO[0000] [axolotl] Db setup finished ERRO[0000] [axolotl] InitModels open /home/alarm/.config/textsecure.nanuc/settings.yml: no such file or directory INFO[2022/04/16 21:42:47] [textsecure-crayfish] Starting crayfish-backend INFO[2022/04/16 21:42:47] [crayfish] starting crayfish INFO[2022/04/16 21:42:47] [crayfish] Starting libsignal-service web socket at ws://127.0.0.1:9081/libsignal INFO[2022/04/16 21:42:48] [crayfish] establishing client connection... WebSocket ERRO[0044] '/home/alarm/.config/textsecure.nanuc/electron/vendor/electron-linux-arm64/electron' exited with code: -1 INFO[0044] astikit: stopping worker... ERRO[2022/04/16 21:43:32] [axolotl-electron] main: creating window failed: context canceled INFO[0044] astikit: worker is now waiting... ERRO[0044] accept tcp 127.0.0.1:43859: use of closed network connection while TCP accepting INFO[2022/04/16 21:43:32] [axolotl] ending axolotl ```

And lastly I tried the to run the flatpak version on my Pinephone. There it hang for 45 seconds after the time="2022/04/16 22:39:56" level=info msg="[crayfish] establishing client connection... WebSocket\n" but then succeeded! Here is the log:

Log from PinePhone (DanctNix) - installed via flatpak ``` time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Starting axolotl version 1.2.0" time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Setup completed" time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl-electron] starting astilelectron with the following switches: [--disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto]" time="2022-04-16T22:39:55+02:00" level=info msg="astikit: starting worker..." time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Axolotl server started" time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Starting axolotl ws" time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Loading Chats" time="2022-04-16T22:39:55+02:00" level=info msg="[axolotl] Db setup finished" time="2022-04-16T22:39:55+02:00" level=info msg="[textsecure-crayfish] Starting crayfish-backend" time="2022/04/16 22:39:55" level=info msg="[crayfish] starting crayfish 7bbaf1665234ce8dd3455ded2164b107fae7f972\n" time="2022/04/16 22:39:55" level=info msg="[crayfish] Starting libsignal-service web socket at ws://127.0.0.1:9081/libsignal\n" time="2022/04/16 22:39:56" level=info msg="[crayfish] establishing client connection... WebSocket\n" time="2022/04/16 22:40:41" level=info msg="[axolotl] Client Connected false" time="2022/04/16 22:40:41" level=info msg="[axolotl-electron] Page loaded" time="2022/04/16 22:40:41" level=info msg="[axolotl-electron] Electron navigation http://127.0.0.1:9080/" time="2022-04-16T22:40:41+02:00" level=info msg="astikit: worker is now waiting..." time="2022/04/16 22:40:41" level=error msg="[axolotl-ws] wsReader websocket: close 1001 (going away)" time="2022/04/16 22:40:42" level=info msg="[axolotl] Client Connected false" time="2022/04/16 22:40:42" level=error msg="[axolotl-ws] send message websocket: close sent" time="2022/04/16 22:40:42" level=info msg="[axolotl-electron] Page loaded" ```
olof-nord commented 2 years ago

Thanks for getting back!

To rule out local issues with Electron, can you start it without Axolotl?

$HOME/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-amd64/electron https://github.com/nanu-c/axolotl/issues/433

Additionally, just as to allow for a better understanding of your systems, what Desktop Environment do they use, and are you using Wayland or not?

langfingaz commented 2 years ago

x86 Arch Linux - installed via flatpak

I'm using XFCE4 with xorg. uname -r: 5.15.34-1-lts xfwm4 --version: 4.16.1 (revision 5f61a84ad) for Xfce 4.16

$HOME/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-amd64/electron https://github.com/nanu-c/axolotl/issues/433

20220423_143248

PinePhone (DanctNix) - installed via flatpak

I'm using Phosh with wayland. uname -r: 5.17.2-1-danctnix phosh --version: 0.17.0

$HOME/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-arm64/electron https://github.com/nanu-c/axolotl/issues/433

When started via ssh:

arm64/electron https://github.com/nanu-c/axolotl/issues/433
Trace/breakpoint trap (core dumped)

When started in a terminal on the phone: 20220423_^162916

[5250:0423/163656.903352:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[5250:0423/163656.905436:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[5286:0423/163657.436212:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.

Questions

Is the folder $HOME/.var/app/org.nanuc.Axolotl/ on my PinePhone from the flatpak installation? And where would electron reside when I'm using the AUR version? I could test that electron version as well. At the moment I have the AUR version uninstalled (as flatpak is working).

oxwivi commented 2 years ago

Screenshot_20220709_044812

Flatpak Axolotl on Fedora 36, KDE Plasma and Wayland. Basically the save behavior as the last comment except for the STDOUT:

$ $HOME/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-amd64/electron https://github.com/nanu-c/axolotl/issues/433
Gtk-Message: 04:47:20.929: Failed to load module "appmenu-gtk-module"
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[32700:0709/044721.011540:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[32700:0709/044723.526082:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[32700:0709/044726.362623:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[32700:0709/044731.454342:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
nanu-c commented 1 year ago

985 will switch from electron to tauri