sourcegraph / jetbrains

Apache License 2.0
50 stars 14 forks source link

Autocomplet not working and the agent fails to start. #1769

Open ericbsd opened 1 month ago

ericbsd commented 1 month ago

IDE Information

PyCharm 2024.1.1 (Community Edition) Build #PC-241.15989.155, built on April 29, 2024 Runtime version: 17.0.11+9-1 amd64 VM: OpenJDK 64-Bit Server VM by OpenJDK BSD Porting Team FreeBSD 14.0-stable GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 16 Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true Non-Bundled Plugins: eu.osimowicz.plugins.intellij.CodeBlocksSorter (0.1.2) com.jetbrains.space (241.15989.9) com.sourcegraph.jetbrains (6.0.3) name.kropp.intellij.makefile (241.14494.150) Current Desktop: MATE

Bug Description

Due to that issue, I have been unable to use Cody for over two months. It is a duplicate of what I reported before.

Additional context

Stacktrace:

java.util.concurrent.ExecutionException: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
 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$4(CodyAgentService.kt:181)
 at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154)
 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:840)
Caused by: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
mkondratek commented 1 month ago

Hello @ericbsd 👋 we are sorry you experience this problem and it lasts so long 🙇

Could you please share more details? What do you usually do to get this error?

ericbsd commented 1 month ago

I get this error when I open PyCharm.

mkondratek commented 4 weeks ago

@ericbsd, I tested the plugin on Windows and macOs and it works. I am trying to setup the project and play with it on my Ubuntu machine. Research in progress 🕵️

In the meantime, I kindly ask you to do the following tests:

Share the logs from the crash

  1. Close IDE
  2. Open IDE and a project
  3. Ensure that the error appears
  4. Go to Help > Show Log in Files (Show Log in <smth>, idk what the precise name in FreeBSD)
  5. Copy the file and paste it here

Increase your memory settings

In your setup it is 2048.

  1. Go to Help > Change Memory Settings
  2. Set it to 4096.
  3. Restart IDE.
  4. Verify if the problem persists.

can you please try them? 🙏

ericbsd commented 4 weeks ago

Here is the idea log. idea.log

ericbsd commented 4 weeks ago

The error persist after changing the memory from 2048 to 4096 and restarting Pycharm.

ericbsd commented 1 week ago

I just noticed that the IDE Internal Errors are only sent on a log.

Log 1

java.lang.Throwable: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$4$lambda$1(CodyAgentService.kt:178)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1008)
    at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2364)
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$4(CodyAgentService.kt:176)
    at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    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:840)

Log 2

Failed to start Cody agent

java.util.concurrent.ExecutionException: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
    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$4(CodyAgentService.kt:181)
    at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    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:840)
Caused by: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed

Log 3

java.lang.Throwable: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$4$lambda$1(CodyAgentService.kt:178)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1008)
    at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2364)
    at com.sourcegraph.cody.agent.CodyAgentService.startAgent$lambda$4(CodyAgentService.kt:176)
    at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154)
    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:840)

Log 4

Failed to start Cody agent

java.util.concurrent.ExecutionException: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
    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$4(CodyAgentService.kt:181)
    at com.intellij.openapi.application.impl.RwLockHolder$executeOnPooledThread$1.run(RwLockHolder.kt:154)
    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:840)
Caused by: com.sourcegraph.cody.agent.CodyAgentException: Creating agent unsuccessful: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
vroudge commented 1 week ago

I would add that I am also unable to use Cody at all with the same issue as the poster above, although I'm running WSL2.

mkondratek commented 3 days ago

hey @ericbsd, a new version is out. Can you please check 6.0.12? Can you still see the problem?

ericbsd commented 3 days ago

Yes