Skip to content

Conversation

@fuweid
Copy link
Member

@fuweid fuweid commented Jan 15, 2026

grpc-gateway v2.0 dropped the legacy "error" JSON field, breaking clients relying on it (grpc-ecosystem/grpc-gateway#1098, grpc-ecosystem/grpc-gateway#1242). Add internalpb.GRPCGatewayError and rewrite Status responses to preserve backward-compatible error payloads.

Deprecation plan: keep "error" alongside "message" in v3.7 with documentation warning; remove "error" in v3.8 once clients migrate.

Fixes: #21100

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fuweid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.38%. Comparing base (c492848) to head (820349e).

Files with missing lines Patch % Lines
server/embed/serve.go 0.00% 9 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
server/embed/serve.go 57.28% <0.00%> (-2.11%) ⬇️

... and 18 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #21143      +/-   ##
==========================================
- Coverage   68.40%   68.38%   -0.03%     
==========================================
  Files         429      429              
  Lines       35242    35251       +9     
==========================================
- Hits        24109    24107       -2     
- Misses       9737     9752      +15     
+ Partials     1396     1392       -4     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c492848...820349e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

grpc-gateway v2.0 dropped the legacy "error" JSON field, breaking
clients relying on it (grpc-ecosystem/grpc-gateway#1098, etcd-io#1242).
Add internalpb.GRPCGatewayError and rewrite Status responses to preserve
backward-compatible error payloads.

Deprecation plan: keep "error" alongside "message" in v3.7 with documentation
warning; remove "error" in v3.8 once clients migrate.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
@k8s-ci-robot
Copy link

@fuweid: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-coverage-report 820349e link true /test pull-etcd-coverage-report

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@serathius
Copy link
Member

Deprecation plan: keep "error" alongside "message" in v3.7 with documentation warning; remove "error" in v3.8 once clients migrate.

We should avoid making any breaking changes for API.

@ahrtr ahrtr self-requested a review January 16, 2026 12:54
@fuweid
Copy link
Member Author

fuweid commented Jan 16, 2026

We should avoid making any breaking changes for API.

Agree, as long as grpc-gateway can provide hook for us to update response status. 😂

@serathius
Copy link
Member

Agree, as long as grpc-gateway can provide hook for us to update response status. 😂

We should ask them nicely.

@ahrtr
Copy link
Member

ahrtr commented Jan 16, 2026

Pls see #21100 (comment)

Let's try to request grpc-gateway to add the error back

Comment on lines +11 to +12
// The "error" field is deprecated in v3.7 and will be removed in v3.8; use
// the standard gRPC Status fields ("code", "message", "details") instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF we plan to remove it in 3.8, then we don't need to resolve the issue at all.

The key for now is that we should formally document/standardize the error response format, either on grpc-gateway side or etcd side. Once finalized, we shouldn't change it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think we can just document this going forward, since the HTTP status code is correct and the error field is duplicated with message. If we all agree not to resolve it, that should be sufficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just document this going forward

If we don't change anything, it means we depend on whatever grpc-gateway provides. We should link to grpc-gateway's doc if any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Error response to /v3/auth/authenticate not tagged as errror in v3.6

4 participants