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

WSL: "No such file or directory" }', src/main.rs:163:14 #36

Open slimsag opened 1 year ago

slimsag commented 1 year ago

Reported by @PriNova in https://github.com/sourcegraph/app/issues/27#issuecomment-1620824198

I tried out the new release and it reported the same error. In WSL, I'm logged in with user-permissions, it tries to call tauri listener at the following path "/root/.asdf/installs/rust/1.68.0/git/checkouts/tauri-plugin-deep-link-808c2311cf9cd633/1cad838/src/linux.rs:94:49" which seems to be conflicting as non-root user.

Port :9000 is not occupied by a system PID or other processes

Logged in as root it is unable to find the 'cacheDir' and 'configDir' even they exists and reports: Sourcegraph starting with args: ["--cacheDir", "/root/.cache/com.sourcegraph.cody", "--configDir", "/root/.local/share/com.sourcegraph.cody"] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:163:14

slimsag commented 1 year ago

Hi @PriNova - I think you're not running into a port conflict. Rather, it seems like tauri_plugin_deep_link::register is not working on your Linux system.

It looks like this code in specific is failing, when trying to create a Unix socket:

https://github.com/FabianLars/tauri-plugin-deep-link/blob/1cad8384a21a8084763864e5a75ce90940d8a6ce/src/linux.rs#L89-L94

Does /tmp exist on your system? Which distro do you use? And which user do you launch the application as?

PriNova commented 1 year ago

Hey @slimsag thank you for your answer.

I'm on Ubuntu 22..04 in WSL container. Cody Version: cody_2023.7.5+1333.e2d4e003e0_amd64.AppImage I've created the 'tmp' folder manually in user and in root home and run into the same issue.

When running Cody App in the user home folder, I got the "Address not found" error. src/main.rs:163:14 When running in a sub-folder of the home folder, I got the "Can't create listener" error. /root/.asdf/installs/rust/1.68.0/git/checkouts/tauri-plugin-deep-link-808c2311cf9cd633/1cad838/src/linux.rs:94:49

MetricMike commented 1 year ago

I have the same stack trace (src/main.rs:163:14), running Ubuntu 22.04 / WSL, but think I tracked it to not having installed xdg-utils, which is noted on https://github.com/FabianLars/tauri-plugin-deep-link/issues/33.

sudo app install xdg-utils and Cody's launches successfully

PriNova commented 1 year ago

I have the same stack trace (src/main.rs:163:14), running Ubuntu 22.04 / WSL, but think I tracked it to not having installed xdg-utils, which is noted on FabianLars/tauri-plugin-deep-link#33.

sudo app install xdg-utils and Cody's launches successfully

Hm, curious, I have this package already installed on my WSL container and it don't helped that much. Tell me, in which folder did you run the Cody App and are you logged in as User or Root?

tfriedel commented 1 year ago

I have the same error in the same environment (WSL2 / Ubuntu 22.04). Installing xdg-utils didn't help. Maybe MetricMike has other packages installed that we don't?

MetricMike commented 1 year ago

I get the same behavior from Cody when logged in as User (I do have an existing /tmp folder) whether I run it from ${HOME} or ${HOME}/myfakeproject or /tmp.

I've also had this distro since the WSL1 days, so its been through a few upgrades and has accumulated a package or two. Specifically, I think I have it using software opengl instead of WSLg's hardware support (so some combination of sudo apt install libegl1-mesa libegl1 mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev). This other rust project had a similar error https://github.com/emilk/egui/issues/380

If I get time I'll see about trying to compile from source with some debug flags, but I'm not 100% clear on how to do that for the cody app (it's got its own repo at sourcegraph/cody, but that repo doesn't appear to have rust sources?)

tfriedel commented 1 year ago

I figured out a way to get it working. It's not pretty. I have to warn you, it will install 1GB of packages:

sudo apt install gnome

Also while the program window is visible, I'm still stuck now after clicking on "Connect to sourcegraph.com". My guess is it tries to open a browser and that's somehow not working in wsl2?

PriNova commented 1 year ago

f I get time I'll see about trying to compile from source with some debug flags, but I'm not 100% clear on how to do that for the cody app (it's got its own repo at sourcegraph/cody, but that repo doesn't appear to have rust sources?)

The cody app stayed in the sourcegraph/sourcegraph repo. in the /cody repo is the Cody Chat functionality outsourced. This will be amazing if you can figure it out. I don't know, if I like to change to other drivers because I'm working with Cuda, cuDNN and a like.

slimsag commented 1 year ago

It sounds like this primarily happens in WSL.

We are working on windows native builds, I don't have an ETA on them yet but hoping to have them available soon.

wysRocket commented 1 year ago

great thanks @Sourcegraph and @tfriedel

sudo apt install gnome

solved! now it works on wsl also ! image

PriNova commented 1 year ago

I figured out a way to get it working. It's not pretty. I have to warn you, it will install 1GB of packages:

sudo apt install gnome

Also while the program window is visible, I'm still stuck now after clicking on "Connect to sourcegraph.com". My guess is it tries to open a browser and that's somehow not working in wsl2?

Did you have installed a browser in WSL? Standard is Chrome, but with installing snap you can have firefox too. You need to start the browser in sandbox mode to work and connecting to the DISPLAY:=0.

I don't know the correct settings to do.

Thank you for this workaround, which is not my reliable way to do.

For me it is suspicious that the app wants to listen to tauri in a root folder.

tfriedel commented 1 year ago

@PriNova I had firefox installed. I installed google chrome and now this opens in the on-boarding. I can now use Cody. Yay!

rfulwell commented 1 year ago

@slimsag

We are working on windows native builds, I don't have an ETA on them yet but hoping to have them available soon.

We are super interested in the Windows native version of the Cody app.

teamgroove commented 1 year ago

I was on the same boat here: WSL Ubuntu 22. Ok, after jumping through some hoops i got it running and finally managed to connect it with VSCode (using WSL).

And now i'm stuck at embedding. It embedded 1 file and then receives a timeouout for a POST. Error embedding repository: error while getting embeddings: Post "https://cody-gateway.sourcegraph.com/v1/embeddings": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Of course are we desperately waiting for the Windows-Version :)


Update: after going to settings: "Embedding jobs" / "Schedule repositories for embedding" and readding the repo twice finally it indexed and embedded 1588 files and skipped 450.

theoparis commented 1 year ago

I'm having the same issue on a debian sid machine that is running on bare metal (not through WSL). It would be nice if the desktop app showed the directory it was trying to access instead of just unwrapping the error.