Response closed without grpc-status (Headers only)

See original GitHub issue

Versions of relevant software used 0.12.0 What happened Throw error every about 10 minutes: Response closed without grpc-status (Headers only) What you expected to happen No error here, just normal message How to reproduce it (as minimally and precisely as possible):

Full logs to relevant components

Anything else we need to know Server side: using grpc-node to push message every minute( long polling ) Proxy: using envoy to transport h2 stream Client side: angular app using generated stub

It’s still unclear, whether this is an error from server, client or proxy side. I guess the grpc-status header might not be set for some kind of response. Maybe normal message or ping message. If someone knows more details about that, please help me.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:9

github_iconTop GitHub Comments

1reaction
kroksyscommented, Oct 7, 2021

This happens when Envoy or grpcwebproxy timeout happens. For grpcwebproxy you can set timeout for your needs like bellow.

--server_http_max_write_timeout=3600s 
--server_http_max_read_timeout=3600s

BUT this does not resolve that connection gets closed. So you have to figure out how to reconnect when this happens.

If you are using RxJS as I do you can add retryWhen for subscription if error happens. For example, if you have code like this.something.subscribe(...) Add following logic before .subscribe

.pipe(retryWhen(errorObservable => {
  return errorObservable.pipe(
    switchMap(err => {
      if (err.statusCode == 2
        && err.statusMessage == "Response closed without grpc-status (Headers only)") {
        return of(err)
      }
      return throwError(err);
    })
  )
}))

This would reconnect automatically on receiving this error. Beware that “Response closed without grpc-status” is returned when server is down and “Response closed without grpc-status (Headers only)” is returned when server closed connection. So filtering only by statusCode (2 == Unknown) is not possible.

Complete example would be:

this.something
  .pipe(retryWhen(errorObservable => {
    return errorObservable.pipe(
      switchMap(err => {
        if (err.statusCode == 2
          && err.statusMessage == "Response closed without grpc-status (Headers only)") {
          return of(err)
        }
        return throwError(err);
      })
    )
  }))
  .subscribe(...)

Good luck!

0reactions
sameliecommented, Oct 2, 2021

After switching to the Contour + Envoy setup this error vanished.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Response closed without grpc-status (headers only) #350
This is a common error that we see coming from various Threads Clients. It is essentially the default error coming back from a...
Read more >
improbable-eng/grpc-web Response closed without headers
I have a server in go using gRPC and ...
Read more >
Response closed without grpc-status (Headers only)
I guess the grpc-status header might not be set for some kind of response. Maybe normal message or ping message.
Read more >
GRPC Core: Status codes and their use in gRPC
Code Number Description OK 0 Not an error; returned on success. FAILED_PRECONDITION 9 OUT_OF_RANGE 11
Read more >
Router — envoy 1.25.0-dev-c1cb25 documentation
Response headers like Retry-After or X-RateLimit-Reset instruct the ... gRPC retries are currently only supported for gRPC status codes in response headers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found