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

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

Open
slimsag opened this issue Jul 7, 2023 · 15 comments
Open

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

slimsag opened this issue Jul 7, 2023 · 15 comments

Comments

@slimsag
Copy link
Member

slimsag commented Jul 7, 2023

Reported by @PriNova in #27 (comment)

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

slimsag commented Jul 7, 2023

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

PriNova commented Jul 7, 2023

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

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

@PriNova
Copy link

PriNova commented Jul 8, 2023

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

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

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 emilk/egui#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
Copy link

tfriedel commented Jul 11, 2023

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

PriNova commented Jul 11, 2023

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 slimsag changed the title Linux: "No such file or directory" }', src/main.rs:163:14 WSL: "No such file or directory" }', src/main.rs:163:14 Jul 11, 2023
@slimsag
Copy link
Member Author

slimsag commented Jul 11, 2023

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

wysRocket commented Jul 12, 2023

great thanks @sourcegraph and @tfriedel

sudo apt install gnome

solved! now it works on wsl also !
image

@PriNova
Copy link

PriNova commented Jul 12, 2023

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

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

@rfulwell
Copy link

rfulwell commented Jul 14, 2023

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

teamgroove commented Jul 19, 2023

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

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.

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

No branches or pull requests

8 participants