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

How to get more information about Connect Protocol Error for streaming request? #1180

Closed
jlewi opened this issue Aug 20, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@jlewi
Copy link

jlewi commented Aug 20, 2024

Describe the bug

I have a streaming request that is failing with the error.

[2024-08-20T22:55:12.555Z] ERROR Runme: Error processing response: ConnectError: [internal] Protocol error; details: ; rawMessage: Protocol error

I also have the trace

[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)

Is there anyway to get additional information about what the protocol error is and/or where its coming from?

As far as I can tell the request never reaches the server.

Environment (please complete the following information):

  • @connectrpc/connect-web version: (for example, 0.1.0)
  • @connectrpc/connect-node version: (for example, 0.1.0)
    "@connectrpc/connect": "^1.4.0",
    "@connectrpc/connect-node": "^1.1.2",
  • Frontend framework and version: (for example, react@18.2.0)
    vscode ^1.72.0
  • Node.js version: (for example, 18.0.0)
    v18.19.0
  • Browser and version: (for example, Google Chrome 103.0.5060.134)
    Version 126.0.6478.183 (Official Build) (arm64)

Additional context

I'm building a vscode extension. That uses a streaming request
https://github.com/stateful/vscode-runme/tree/jlewi/connect

When I run it in vscode everything works fine. I started running it in codeserver and I started getting protocol errors.

The transport gets created here
https://github.com/stateful/vscode-runme/blob/90752806ef995d794f41260f1148c8ea8f9fd85d/src/extension/ai/manager.ts#L76

@srikrsna-buf
Copy link
Member

Hey! You can look at the cause field of ConnectError to get the original error This is not coming from the connect. From the stack trace it looks like it is coming from a node error on the client side. It also looks like an h/2 frame error. Usually h/2 requires TLS because of the protocol negotiation step unless the clients force h2c (HTTP/2 over clear text). That would be my guess.

Closing this for now, feel free to followup if you need anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants