cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.17k stars 3.82k forks source link

db-console: non-json api v2 error responses cause cryptic "RequestError: Empty message" in DD #136038

Open kyle-a-wong opened 20 hours ago

kyle-a-wong commented 20 hours ago

The fetchDataJson function expects non error responses to return Response objects. When they don't, a RequestError response with undefined fields is created, see: https://github.com/cockroachdb/cockroach/blob/d5f328ea6f3efd8fbe631c97d59f7b74307d22f9/pkg/ui/workspaces/cluster-ui/src/api/fetchData.ts#L115

The effect of this is that failed requests in cc-console result in cryptic "RequestError: Empty message" logs in Datadog. We should either change this function to be more flexible with different types, audit our api v2 apis to make sure they return JSON, or maybe even both.

Jira issue: CRDB-44832

blathers-crl[bot] commented 20 hours ago

Hi @kyle-a-wong, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.