sourcegraph / jetbrains

Apache License 2.0
61 stars 19 forks source link

WSL PhpStorm [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//") #138

Closed Surt closed 1 month ago

Surt commented 10 months ago

Installation information

PhpStorm 2023.2.3 Build #PS-232.10072.32, built on October 13, 2023 Licensed to XXXXXXXXXXXX Subscription is active until May 3, 2024. XXXXXXXXXX Runtime version: 17.0.8.1+7-b1000.32 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 16 Registry: debugger.watches.in.variables=false run.processes.with.pty=TRUE

Non-Bundled Plugins: com.github.shubham076.darkthemes (3.0.2) com.intellij.ideolog (222.1.0.0) CMD Support (1.0.5) Intellij_GitHub_Dark_Theme (1.1.1) net.vektah.codeglance (1.5.4) com.intellij.kubernetes (232.10072.33) PlantUML integration (7.3.0-IJ2023.2) com.alicannklc.laravel.snippets (1.1.1) ru.adelf.idea.dotenv (2023.2) org.endpointdeps.EndpointDependencies (1.3) de.espend.idea.laravel (0.15.4) net.seesharpsoft.intellij.plugins.csv (3.2.3-232) com.intellij.ml.llm (232.9826) com.nekofar.milad.intellij.nuxtjs (2.0.8) tv.twelvetone.intellij.plugins.intellivue (1.1.43) com.sourcegraph.jetbrains (5.2.7836-nightly) com.intellij.jira (4.6.3) mobi.hsz.idea.gitignore (4.5.2)

(optional) Error message or idea.log output

WARN - #com.sourcegraph.cody.agent.CodyAgent - Error: Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")

Steps to reproduce

Using phpstorm for windows and having the repository on WSL. IT seems to not recognize the path to the files. If i set the repository on windows it works as expected.

Expected behavior

Normal use

jdorfman commented 10 months ago

Thanks for reporting @Surt. Any screenshots you can provide would be helpful.

Surt commented 10 months ago

umm anything in particular?

This is the cody screen loaded and waiting to respond. image

The code is sit at a wsl route image

2023-11-21 14:08:09,754 [103017449]   WARN - #com.sourcegraph.cody.agent.CodyAgent - Error: Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
2023-11-21 14:08:12,546 [103020241]   WARN - #com.sourcegraph.cody.agent.CodyAgent - Error: Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
mkondratek commented 6 months ago

hello @Surt πŸ‘‹ I know it's been a while already but I wanted to let you know that I am actively looking at this issue right now πŸ‘¨β€πŸ­

pkukielka commented 6 months ago

Other report of that issue: https://github.com/sourcegraph/jetbrains/issues/806

java.util.concurrent.CompletionException: java.lang.Exception: Failed to start Cody agent
    at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:413)
    at java.base/java.util.concurrent.CompletableFuture.getNow(CompletableFuture.java:2134)
    at com.sourcegraph.cody.agent.CodyAgentService$Companion.isConnected(CodyAgentService.kt:143)
    at com.sourcegraph.cody.statusbar.CodyAutocompleteStatusService.didStatusChanged(CodyAutocompleteStatusService.kt:64)
    at com.sourcegraph.cody.statusbar.CodyAutocompleteStatusService.onCodyAutocompleteStatusReset$lambda$1(CodyAutocompleteStatusService.kt:43)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:252)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.Exception: Failed to start Cody agent
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$3(CodyAgentService.kt:82)
    ... 10 more
Caused by: java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")

Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
    at f (C:\snapshot\dist\agent.js)
    at e3.t3 (C:\snapshot\dist\agent.js)
    at new e3 (C:\snapshot\dist\agent.js)
    at Function.parse (C:\snapshot\dist\agent.js)
    at _Uri.parse (C:\snapshot\dist\agent.js)
    at C:\snapshot\dist\agent.js
    at MessageDecoder.callback (C:\snapshot\dist\agent.js)
    at MessageDecoder._write (C:\snapshot\dist\agent.js)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (node:internal/streams/readable:766:22)
    at Socket.emit (node:events:537:28)
    at Socket.emit (node:domain:482:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$3(CodyAgentService.kt:69)
    ... 10 more
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")

Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
    at f (C:\snapshot\dist\agent.js)
    at e3.t3 (C:\snapshot\dist\agent.js)
    at new e3 (C:\snapshot\dist\agent.js)
    at Function.parse (C:\snapshot\dist\agent.js)
    at _Uri.parse (C:\snapshot\dist\agent.js)
    at C:\snapshot\dist\agent.js
    at MessageDecoder.callback (C:\snapshot\dist\agent.js)
    at MessageDecoder._write (C:\snapshot\dist\agent.js)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (node:internal/streams/readable:766:22)
    at Socket.emit (node:events:537:28)
    at Socket.emit (node:domain:482:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
    at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
    at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
    at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
    at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    ... 1 more
exigow commented 6 months ago

New exceptions from this week: #884, #895, #896

ManuDoni commented 6 months ago

For every new nightly release of the plugin I try if it works but even with the v5.4.0 (the latest at the moment) it doesn't work. I'm unable to use it, neither the chat nor the inline hints. If you want I could paste here the error's stack trace

JamShady commented 6 months ago

I'm getting this in 2023.3.5

image

In reference to a question asked in #845, the project I'm opening is on a WSL instance

TomDeSmet commented 2 months ago

I have the exact same issue, I cannot use any coding assistant... this is closed without an answer????

mkondratek commented 2 months ago

Hello @TomDeSmet πŸ‘‹ we're sorry you're experiencing these issues. My guess is that it was accidentally closed (we are migrating between issue trackers). We know about this problem and we want to solve it. WSL is a more unique setup than just Linux/Windows/Macos. This configuration takes more time to prepare and work with.

Thank you for raising this issue. Feedback from the community is very valuable to us. I will raise this issue at the next meeting and we will review its priority.

TomDeSmet commented 2 months ago

Thank you. I really like the plugin so I hope to be able to use it properly. And WSL is awful so I feel your pain. But it’s mandatory in some larger companies so we have to bare with it unfortunately. Thanks for reopening this issue.

vroudge commented 1 month ago

Hi @TomDeSmet

Currently I'm unable to use cody because of this error as well.

mkondratek commented 1 month ago

Happy news! The fix is close to be merged: #1970

mkondratek commented 1 month ago

Hi @Surt, @ManuDoni, @JamShady, @TomDeSmet, @vroudge πŸ‘‹ can you please update the plugin to 6.0.25? πŸ™ the issue with WSL should be resolved now 😌