sourcegraph / app

Issue tracker for the Sourcegraph app - a lightweight single-binary version of Sourcegraph for your local machine
27 stars 2 forks source link

Linux: Cody app crashes trying to open browser #32

Open ar-jan opened 1 year ago

ar-jan commented 1 year ago

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:

Actual behavior:

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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

hleroy commented 11 months ago

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 commented 11 months ago

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

csrn commented 10 months ago

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