Skip to content
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

[BUG] Axolotl does not start on Mobian with Flathub #468

Closed
kop316 opened this issue Apr 13, 2021 · 21 comments
Closed

[BUG] Axolotl does not start on Mobian with Flathub #468

kop316 opened this issue Apr 13, 2021 · 21 comments
Labels

Comments

@kop316
Copy link

kop316 commented Apr 13, 2021

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
Copy link
Collaborator

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
Copy link

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
Copy link

lolgzs commented May 12, 2021

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
Copy link

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
Copy link

vaared commented May 18, 2021

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
Copy link

D4N commented May 18, 2021

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
Copy link

Id2ndR commented Jul 10, 2021

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
Copy link

@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
Copy link

Id2ndR commented Jul 15, 2021

@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
Copy link

lolgzs commented Jul 15, 2021

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

@chookity-pokk
Copy link

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

@nanu-c
Copy link
Collaborator

nanu-c commented Aug 10, 2021

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
Copy link

ghost commented Aug 21, 2021

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
Copy link

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?

@ghost ghost mentioned this issue Oct 2, 2021
@Ferenc-
Copy link
Contributor

Ferenc- commented Oct 15, 2021

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:
electron/electron#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:
electron/electron#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:
keybase/client#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 nanu-c added the flatpak label Oct 15, 2021
@nanu-c
Copy link
Collaborator

nanu-c commented Oct 15, 2021

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
Copy link
Collaborator

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

@olof-nord
Copy link
Collaborator

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-
Copy link
Contributor

Ferenc- commented Oct 27, 2021

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 olof-nord changed the title [BUG] Axolotl does not start on Mobian wit Flathub [BUG] Axolotl does not start on Mobian with Flathub Oct 27, 2021
@olof-nord
Copy link
Collaborator

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
Copy link
Author

kop316 commented Jun 22, 2022

I am seeming to get a new issue with this:
#835

But it still will not start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests