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

ClientHttp2Stream.h2StreamError from extension in code-server #6983

Open
1 of 2 tasks
jlewi opened this issue Sep 5, 2024 · 7 comments
Open
1 of 2 tasks

ClientHttp2Stream.h2StreamError from extension in code-server #6983

jlewi opened this issue Sep 5, 2024 · 7 comments
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer upstream:vscode Needs to be fixed upstream in VSCode

Comments

@jlewi
Copy link

jlewi commented Sep 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: MacOS
  • Remote OS: MacOs
  • Remote Architecture: Arm
  • code-server --version:
    4.92.2 de65bfc with Code 1.92.2

Steps to Reproduce

  1. Run code-server
  2. To install the RunMe VSCode Extension
  3. Download and configure Foyle (www.foyle.io)
  4. Run foyle serve
  5. In RunMe enable AI Auto Cell Option
  6. Open a markdown document as a RunMe notebook
  7. Start typing in a markdown cell to trigger an RPC to Foyle

Expected

Foyle should generate a completion and insert it a cell into the notebook.

Actual

We get an error in vscode.

In the RunMe Output window we see the error

[2024-09-05T15:02:20.696Z] ERROR Runme(AIGenerate): AI Generate request failed ConnectError: [internal] Protocol error

Chrome console shows the following error

[Extension Host] Error in PromiseIterator: ConnectError: [internal] Protocol error
	at ConnectError.from (/home/user/.local/share/code-server/extensions/stateful.runme-3.7.2-jlewi.4/out/extension.js:1303796:20)
	at connectErrorFromNodeReason (/home/user/.local/share/code-server/extensions/stateful.runme-3.7.2-jlewi.4/out/extension.js:1302558:39)
	at Promise.reject (/home/user/.local/share/code-server/extensions/stateful.runme-3.7.2-jlewi.4/out/extension.js:1303074:110)
	at ClientHttp2Stream.h2StreamError (/home/user/.local/share/code-server/extensions/stateful.runme-3.7.2-jlewi.4/out/extension.js:1302963:22)
	at ClientHttp2Stream.emit (node:events:518:28)
	at emitErrorNT (node:internal/streams/destroy:169:8)
	at emitErrorCloseNT (node:internal/streams/destroy:128:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I believe the error indicates there is lack of support for HTTP2 clients. It works in native vscode so I suspect the problem must be something with code-server.

Logs

No response

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

No, this works as expected in native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

No response

@jlewi jlewi added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Sep 5, 2024
@coder-labeler coder-labeler bot added the upstream:vscode Needs to be fixed upstream in VSCode label Sep 5, 2024
@code-asher
Copy link
Member

Is it trying to reach out to localhost or something? Some extensions do this but of course that will not work in the web, they need to use the proxy to get to the port.

We should test in Codespaces though, if it is broken there then it will either be an issue with VS Code or the plugin.

@code-asher
Copy link
Member

Actually it must be using the proxy, right? Otherwise the error would be "connection refused " or something.

I think the package we use for proxying does not support HTTP/2.

@code-asher
Copy link
Member

Here is the upstream issue: http-party/node-http-proxy#1237

Maybe there is a different package we can use 🤔

@jlewi
Copy link
Author

jlewi commented Sep 5, 2024

@code-asher Thank you for replying.

Is it trying to reach out to localhost or something? Some extensions do this but of course that will not work in the web, they need to use the proxy to get to the port.

Yes. It is trying to reach out to local host. Specifically http://localhost:8877/api.

I'm unfamiliar with the architecture of code-server; can you explain where a proxy gets used? I thought code-server had a server with a thin web-client. I thought the server is where the vscode extension host is running and where the RPC should be coming from. code-server is running on my laptop and so I would expect it be able to access localhost.

@code-asher
Copy link
Member

code-asher commented Sep 10, 2024

Yup, code-server is mostly just a thin web client around VS Code, but it also has a simple reverse proxy. The reason being that extensions (like this) spin up their own server on some port (8877 in this case) and they need a way to access that from the local browser to the remote (where localhost will not work). The proxy is used when an extension calls asExternalUri.

So it can be that either it is trying to reach localhost:8877 from the browser and it needs to be changed to use asExternalUir, or is it already using that but our proxy does not support http/2.

@code-asher
Copy link
Member

Ah but yeah in your case, if it is running locally, accessing localhost will work and that means our proxy is not involved, so maybe this is some other issue entirely? It should work the same as native VS Code in that case.

@code-asher
Copy link
Member

If the request runs from the browser, maybe there is some difference in the browser vs Electron with regards to http/2, so something to look into might be whether the package that is providing the http/2 connection has browser support.

If the request runs from Node though, I am not sure. The only difference there from native VS Code is plain Node vs Electron but I am not sure that could be making a difference here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer upstream:vscode Needs to be fixed upstream in VSCode
Projects
None yet
Development

No branches or pull requests

2 participants