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] Axolotl does not start on Mobian with Flathub #468

Closed kop316 closed 2 years ago

kop316 commented 3 years ago

Description

A fresh install of Axolotl does not start on Mobian wit Flathub

Steps to Reproduce

Download Axolotl on Flathub

type in command flatpak run org.nanuc.Axolotl

Expected behavior: [What you expect to happen]

A window to open for Axolotl

Actual behavior: [What actually happens]

mobian@mobian:~$ 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                     
DEBU[0000] [axolotl] Run Backend                        
INFO[0000] astikit: starting worker...                  
DEBU[0000] [axolotl] openDb: /home/mobian/.local/share/textsecure.nanuc/db 
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] NewDataStore                       
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/mobian/.config/textsecure.nanuc 
DEBU[2021/04/13 06:47:51] [axoltol] Opening Dialog: getPhoneNumber     
DEBU[2021/04/13 06:47:51] [axolotl-ws] send request getPhoneNumber     
ERRO[0024] '/home/mobian/.config/textsecure.nanuc/electron/vendor/electron-linux-arm64/electron' exited with code: -1 
INFO[0024] astikit: stopping worker...                  
DEBU[2021/04/13 06:48:15] [axolotl-electron] main: creating window failed: context canceled 
DEBU[2021/04/13 06:48:15] [axolotl-electron] open dev tools false      
INFO[0024] astikit: worker is now waiting... 

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

Device

Mobian/Pinephone (No SIM Card in the modem)

olof-nord commented 3 years ago

Could you try to manually remove the electron binary zip file with rm -f /home/mobian/.config/textsecure.nanuc/electron/vendor/electron-linux-amd64-v12.zip and then start axolotl again? Perhaps the zip file got corrupted during the download.

vasyugan commented 3 years ago

doesn't help (I am on postmarketos, but I see the same, it seems. Here is the console output:

time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Starting Signal for Ubuntu version 0.9.8"
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Setup completed"
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Start electron"
time="2021-05-11T21:16:32Z" level=info msg="astikit: starting worker..."
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Axolotl server started"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] Run Backend"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] openDb: /home/jr/.local/share/textsecure.nanuc/db"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] NewDataStore"
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Starting axolotl ws"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] Using axolotl-web path /app/bin/axolotl-web/dist"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] NewDataStore finished"
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Loading Chats"
time="2021-05-11T21:16:32Z" level=info msg="[axolotl] Db setup finished"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] Start Session after Decryption"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] starting Signal connection"
time="2021-05-11T21:16:32Z" level=debug msg="[axolotl] config path:  /home/jr/.config/textsecure.nanuc"
time="2021/05/11 21:16:32" level=debug msg="[axoltol] Opening Dialog: getPhoneNumber"
time="2021/05/11 21:16:32" level=debug msg="[axolotl-ws] send request getPhoneNumber"
time="2021-05-11T21:16:33Z" level=error msg="'/home/jr/.config/textsecure.nanuc/electron/vendor/electron-linux-arm64/electron' exited with code: 7"
time="2021-05-11T21:16:33Z" level=info msg="astikit: stopping worker..."
time="2021/05/11 21:16:33" level=debug msg="[axolotl-electron] main: creating window failed: context canceled"
time="2021/05/11 21:16:33" level=debug msg="[axolotl-electron] open dev tools false"
time="2021-05-11T21:16:33Z" level=info msg="astikit: worker is now waiting..."
time="2021-05-11T21:16:33Z" level=error msg="accept tcp 127.0.0.1:33389: use of closed network connection while TCP accepting"
lolgzs commented 3 years ago

Hi,

I have the same issue on Manjaro Phosh ( Pinephone with SIM card) AND Manjaro on desktop with gnome. Also fresh install from flathub. Any way to help ?

pshobowale commented 3 years ago

Can confirm it on arch arm. Deleting the file did not change it. BTW the file was electron-...-arm64-v11.1.1.zip not amd-64v12

vaared commented 3 years ago

I'm having this same exact issue. Deleting the file didn't help. Same issue with Flatpak, Snap and with axolotl_0.9.9-3_arm64.deb.

Running Pinephone without SIM card. Pinephone OS: Manjaro Phosh

D4N commented 3 years ago

Same issue here as well with the Flatpak of axolotl on the pinephone with postmarketos and a SIM. Deleting the zip also did not help.

Id2ndR commented 3 years ago

The Flatpak version still is 0.9.9. However Snap version is 1.0.0 and runs on the PinePhone (at least on Manjaro).

chookity-pokk commented 3 years ago

@Id2ndR Is that Manjaro Phosh? They show different version numbers but were also published on the same day so maybe that was a typo?

Id2ndR commented 3 years ago

@ragreenburg, Yes it is Manjaro Phosh, but my understanding is that neither the Flatpak version nor the snap one does depend on the distribution.

lolgzs commented 3 years ago

@ld2ndR Note that for Manjaro there's an AUR package, see https://forum.pine64.org/showthread.php?tid=14223

chookity-pokk commented 3 years ago

@Id2ndR I believe you're right about that, I was just curious if maybe you had it on Manjaro Plasma Mobile.

nanu-c commented 3 years ago

So in order to get things right, this still happens not? When electron terminates with exit code 7 it's an access violation error. I have no manjaro aur mobian but a stacktrace would be helpful to see why it happens.

ghost commented 3 years ago

I have the same results when installed using Flatpak on PostmarketOS with Phosh. I'd love to provide a stack trace, but all I have is terminal output just like the above.

INFO[0000] [axolotl] Starting Signal for Ubuntu version 0.9.8 
INFO[0000] [axolotl] Setup completed                    
INFO[0000] [axolotl] Start electron                     
INFO[0000] astikit: starting worker...                  
DEBU[0000] [axolotl] Run Backend                        
DEBU[0000] [axolotl] openDb: /home/user/.local/share/textsecure.nanuc/db 
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] NewDataStore                       
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/08/21 20:22:06] [axoltol] Opening Dialog: getPhoneNumber     
DEBU[2021/08/21 20:22:06] [axolotl-ws] send request getPhoneNumber     
ERRO[0001] '/home/user/.config/textsecure.nanuc/electron/vendor/electron-linux-arm64/electron' exited with code: 7 
INFO[0001] astikit: stopping worker...                  
DEBU[2021/08/21 20:22:07] [axolotl-electron] main: creating window failed: context canceled 
DEBU[2021/08/21 20:22:07] [axolotl-electron] open dev tools false      
INFO[0001] astikit: worker is now waiting...            
ERRO[0001] accept tcp 127.0.0.1:41203: use of closed network connection while TCP accepting
vasyugan commented 3 years ago

So in order to get things right, this still happens not? When electron terminates with exit code 7 it's an access violation error. I have no manjaro aur mobian but a stacktrace would be helpful to see why it happens.

Yes, still happens. Exactly the same console output. Electron crashes. I guess, for a stacktrace, one has to install the require debug flatpaks. What would those be?

Ferenc- commented 3 years ago

I think it has become evident earlier that this issue has nothing to do with Mobian, so I think we should remove Mobian from the title. Furthermore my findings show that it might not depend on flatpak either, so perhaps that one as well. So far it looks like, that it has more to do with using Wayland in my opinion, and this issue should be investigated/reproduced under Wayland, but more about that later.

@vasyugan the Debug flatpak can be installed like this:

flatpak install flathub org.nanuc.Axolotl.Debug

But this doesn't help whatsoever, since electron is not part of the flatpak, but it is downloaded during first run, from here into your home directory under ~/.config/textsecure.nanuc/electron/vendor/electron-linux-arm64/electron. And that is not a debug build even if you use the debug flatpak. For debugging you need the matching debug symbols. Those are in Google's Breakpad symbol file format, so you can't just load it into gdb directly. One would need a minidump processor.

Anyhow it looks like a futex error, that can be seen even if you don't look for the backtrace but just try to invoke electron, as it would be invoked by axolotl. I started like this, but the electron app path is actually superfluous, as there should be no crash without it either:

flatpak run --command=sh --devel org.nanuc.Axolotl
cd ~/.config/textsecure.nanuc/electron/
vendor/electron-linux-arm64/electron --disable-dev-shm-usage --no-sandbox ./vendor/astilectron
The futex facility returned an unexpected error code.
Aborted (core dumped)

Anyhow the amd64 equivalent of this does work, and also without the electron app path.

gdb ./vendor/electron-linux-arm64/electron
[...]
(gdb) set pagination off
(gdb) r --disable-dev-shm-usage --no-sandbox ./vendor/astilectron
[...]
The futex facility returned an unexpected error code.

Thread 1 "electron" received signal SIGABRT, Aborted.
0x0000fffff61671d8 in raise () from /usr/lib/aarch64-linux-gnu/libc.so.6

And here is the some (so far) no sym backtace from the thread which causes the abort, which is not that useful in this form:

Thread 1 (Thread 0xfffff5008cb0 (LWP 42)):
#0  0x0000fffff61671d8 in raise () at /usr/lib/aarch64-linux-gnu/libc.so.6
#1  0x0000fffff6153aa0 in abort () at /usr/lib/aarch64-linux-gnu/libc.so.6
#2  0x0000fffff61a1a18 in __libc_message () at /usr/lib/aarch64-linux-gnu/libc.so.6
#3  0x0000fffff61a1aa8 in __libc_fatal () at /usr/lib/aarch64-linux-gnu/libc.so.6
#4  0x0000fffff79a8af0 in sem_post () at /usr/lib/aarch64-linux-gnu/libpthread.so.0
#5  0x0000aaaaac33d504 in uv_sem_post ()
#6  0x0000aaaaac452b20 in  ()
#7  0x0000aaaab22c08c0 in  ()
(gdb) 

It seems that, if I run electron outside of flatpak, then I get a crash anyway, only it's SIGSEGV (segmentation fault), and not SIGABRT and no complaints about futex issue.

Back to the futex issue, it's not entirely unheard of: https://github.com/electron/electron/issues/28244 In that issue, people correlate this with not using X Server, and I guess it's safe to assume, that the people who have seen this bug, are all using Wayland on their phones.

While we figure out how to get some readable minidump symbols, I was wondering, why the 11.1.1 version of electron gets downloaded? I mean here we set something like VersionElectron: "12.0.0" which looks odd, but perhaps I misunderstand it. But for example 15.2.0 is now out and 16 is also almost there. Would it make sense to try a newer one? I mean is it likely that electron would fix such a bug on the 11 series?

And here is the thing, if I try to run electron --disable-dev-shm-usage --no-sandbox ... from the electron-v15.2.0-linux-arm64.zip package, then I get a bit better error message:

ERROR:browser_main_loop.cc(1400)] Unable to open X display.
The futex facility returned an unexpected error code.
Aborted (core dumped)

And this is also an issue, that has surfaced before and correlates with the lack of proper X config: https://github.com/electron/electron/issues/24696 But now on Wayland, simply export DISPLAY=:1 won't help.

On the other hand, for example with this:

flatpak run --command=sh --devel  org.nanuc.Axolotl
export DISPLAY=:0
export WAYLAND_DISPLAY=wayland-0
axolotl

This was suggested for the keybase electron gui: https://github.com/keybase/client/issues/19614

Electron does start up without a crash, only it displays the '404 page not found' message. But that is a different issue I believe. So far with these settings at least electron itself appears to start up.

nanu-c commented 3 years ago

the 404 page not found error is a different issue. It means axolotl-web hasn't been build or packaged, so it's quite a step forward. I have no knowledge in flatpaks, so pr's really welcome.

Flaburgan commented 3 years ago

And that, ladies n' gentlemen, is what I call an investigation. Thank you for your work @Ferenc-

olof-nord commented 3 years ago

As the person who set up that initial Flatpak build, this did bother me ever since reported. I was however lacking the tooling, experience and knowledge how to move forward.

Your investigation and documentation of that process, @Ferenc- is very impressive.

Thank you! Really great work.

Now, to update the Flatpaks :)

Ferenc- commented 3 years ago

I think #604 already helped a lot, although it's not a must but #619 tries to further prevent crashes and other isses caused by using the XWayland client instead of native Wayland implementation. Like @olof-nord says, from here on it is about fixing the flatpak build on aarch64.

olof-nord commented 2 years ago

Hello everyone, after some time focusing on other things I finally came back to Axolotl and its Flatpak build. With the most recent local Flatpak setup, there has been a few improvements.

1) Electron is not downloaded at start, but bundled with the rest of the application at buildtime 2) The most recent Electron version is used. 3) The environment variables mentioned by @Ferenc- are set 4) Chromium Ozone flags are set

If someone wants to try it out there are two makefile targets:

make build-dependencies-flatpak-web make install-flatpak-web

In the coming days, weeks I will publish this version to Flathub too.

kop316 commented 2 years ago

I am seeming to get a new issue with this: https://github.com/nanu-c/axolotl/issues/835

But it still will not start