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

Linux: Cody app crashes trying to open browser #32

Open
ar-jan opened this issue Jul 3, 2023 · 10 comments
Open

Linux: Cody app crashes trying to open browser #32

ar-jan opened this issue Jul 3, 2023 · 10 comments
Labels

Comments

@ar-jan
Copy link

ar-jan commented Jul 3, 2023

  • Sourcegraph version: Sourcegraph.com
  • Platform information: Void Linux (with KDE5 Plasma)

Steps to reproduce:

  1. Run cody_2023.6.28+1331.1867679b11_amd64.AppImage
  2. Click "Connect to Sourcegraph.com" (nothing happens)
  3. Click "About Sourcegraph" in the Cody app system tray icon

Expected behavior:

  • Clicking Connect to Sourcegraph.com button should do something
  • Clicking a menu item in the system tray should not crash the app

Actual behavior:

  • Click "Connect to Sourcegraph.com" --> Nothing happens
  • Click "About Sourcegraph" or "Settings" in the Cody app system tray icon --> the app crashes

RUST_BACKTRACE=full ./cody_2023.6.28+1331.1867679b11_amd64.AppImage

Sourcegraph starting with args: ["--cacheDir", "/home/arjan/.cache/com.sourcegraph.cody", "--configDir", "/home/arjan/.local/share/com.sourcegraph.cody"]
thread 'main' panicked at 'called Result::unwrap() on an Err value: Shell("failed to open: Scoped shell IO error: exit status: 4")', src/tray.rs:54:88
stack backtrace:
0: 0x5625aa8acd1c -
1: 0x5625aa7efc3e -
2: 0x5625aa881f24 -
3: 0x5625aa8af4af -
4: 0x5625aa8af0af -
5: 0x5625aa8b012d -
6: 0x5625aa8afc04 -
7: 0x5625aa8afb6c -
8: 0x5625aa8afb41 -
9: 0x5625aa6ff752 -
10: 0x5625aa6ffba2 -
11: 0x5625aa7ab766 -
12: 0x5625aa7367d0 -
13: 0x5625aa7607a7 -
14: 0x5625aa7a79ec -
15: 0x5625aa7341cb -
16: 0x5625aa7354f3 -
17: 0x5625aa733196 -
18: 0x5625aa7b077f -
19: 0x5625aa72e6a9 -
20: 0x5625aa7b30a1 -
21: 0x7f80ced5f20c - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
22: 0x7f80ced5f2bc - __libc_start_main_impl
at ./csu/../csu/libc-start.c:381:3
23: 0x5625aa70bb6e -
24: 0x0 -
Aborted

@slimsag slimsag transferred this issue from sourcegraph/sourcegraph-public-snapshot Jul 3, 2023
@slimsag slimsag changed the title Cody app crashes Cody app crashes trying to open browser on Linux Jul 3, 2023
@slimsag
Copy link
Member

slimsag commented Jul 3, 2023

Thanks for filing! It looks like something with your system is incompatible with tauri-plugin-shell

Unfortunately it may be quite difficult for us to reproduce/fix this, I think we will need to reproduce your OS setup and see if we can reproduce the behavior there.

@ar-jan
Copy link
Author

ar-jan commented Jul 3, 2023

I believe this PR should stop the app from crashing and hopefully reveal why the shell cannot open paths/urls. I also couldn't find the log file, presumably because opening that file/dir also failed on shell::open(). The config dir ~/.local/share/com.sourcegraph.cody was created without issue though.

Only I haven't figured out how to build just the Tauri app (or I have to complete the full development environment).

@slimsag
Copy link
Member

slimsag commented Jul 4, 2023

@ar-jan thanks for looking into this! I'm happy to merge that PR and include it in our next release if you think that will help (or will help find the cause.)

If you want to try building just the Tauri app, you should be able to do the following:

./enterprise/dev/app/build.sh

It may require some dependencies, which you could set up by following these steps. No guarantee it'll work, setting up our dev environments is fairly involved - but maybe worth a quick try?

@ar-jan
Copy link
Author

ar-jan commented Jul 4, 2023

I'd like to get that set up, but ran into trouble with some dependencies because I'm not using Ubuntu (posted in #cody-development channel).

@slimsag
Copy link
Member

slimsag commented Jul 5, 2023

@ar-jan A new build with your PR included is available here if you want to give it a try: https://github.com/sourcegraph/sourcegraph/releases/tag/app-v2023.7.5%2B1333.e2d4e003e0

@ar-jan
Copy link
Author

ar-jan commented Jul 5, 2023

Great! So, this build does not crash, but it doesn't give more information either:

Failed to open URL: Shell("failed to open: Scoped shell IO error: exit status: 4")
** (cody:10088): WARNING **: 01:09:51.693: atk-bridge: get_device_events_reply: unknown signature

BUT, for some reason my local build does actually work, I can complete the authorization and the app is functional. It also seems to show a possible reason for the problem with the official build:

** (WebKitWebProcess:7039): WARNING **: 01:04:06.243: Error loading the injected bundle (././/lib64/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so): ././/lib64/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so: cannot open shared object file: No such file or directory
[/home/arjan/.cargo/git/checkouts/tauri-plugin-deep-link-808c2311cf9cd633/1cad838/src/linux.rs:104] buffer = "sourcegraph://app/auth/callback?code=[snip]&destination=%2Fapp-setup%2Fwelcome%3FemailCheck%3Dtrue"

This was fixed in Tauri, upgrading tauri-cli to 1.4.0 should solve the libwebkit2gtkinjectedbundle.so issue for Void Linux.

It is strange that my local build does work and also shows an error that's not there with other builds. It seems to be using a build artifact that's not part of the AppImage?

@slimsag
Copy link
Member

slimsag commented Jul 11, 2023

sounds like a version incompatibility between a library we're building against when producing our release binaries, and what's available on your system. I don't know that for sure, but I suspect that over time this will get resolved as part of us updating dependencies (and perhaps updating tauri)

I'll see if we can get on that soon-ish

@slimsag slimsag changed the title Cody app crashes trying to open browser on Linux Linux: Cody app crashes trying to open browser Jul 11, 2023
@slimsag slimsag added the linux label Jul 11, 2023
@hleroy
Copy link

hleroy commented Aug 6, 2023

Having the same issue (Click "Connect to Sourcegraph.com" --> Nothing happens) running Kubuntu 23.04. The app doesn't crash though. It's just that nothing happens. Happy to help troubleshooting if you can provide guidance.

@Ownistic
Copy link

I have the same issue, I'm using Fedora 38 with the KDE spin if that helps

@csrn
Copy link

csrn commented Sep 20, 2023

Same issue here (Manjaro, KDE, Wayland).

Edit:
You can right-click the button to copy the web link and use it on your own. App authorization seems to work afterwards.

It is "building the code graph" of a test folder for several minutes. I do not know yet, if this will work or not.

image

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

5 participants