Skip to content

Request: Migrate from protoc-gen-validate (PGV) to Buf’s protovalidate Runtime #7775

Description

@AdamMagaluk

Summary

Hi TTN team,

I’m currently integrating TTN’s gRPC API into a codebase and encountered a recurring issue stemming from TTN’s continued use of:

buf.build/envoyproxy/protoc-gen-validate

which corresponds to the deprecated protoc-gen-validate (PGV) runtime.

This is creating namespace conflicts with modern Buf-generated protobuf code using the Protovalidate runtime: https://protovalidate.com/

Specifically, PGV and Protovalidate both register the same proto:

validate/validate.proto

which leads to the following panic at runtime:

panic: proto: file "validate/validate.proto" is already registered
    previously from: "buf.build/gen/go/envoyproxy/protoc-gen-validate/protocolbuffers/go/validate"
    currently from:  "github.com/envoyproxy/protoc-gen-validate/validate"

Current Situation

No response

Why do we need this? Who uses it, and when?

Why TTN Should Migrate to Protovalidate
1. PGV is no longer maintained, and the Envoy project does not recommend using its Go runtime.
2. Protovalidate is the official successor, built and maintained by Buf.
3. Protovalidate:
• provides a more modern validation engine
• supports rich validation semantics
• avoids global registration conflicts
• integrates cleanly with Buf’s ecosystem and codegen
4. Many Go teams (mine included) are increasingly adopting Protovalidate, making PGV-based APIs difficult to integrate without hacks or stubbing modules.

Proposed Implementation

In Buf yaml: buf.build/envoyproxy/protoc-gen-validate -> buf.build/bufbuild/protovalidate

And change imports in protos:

import "buf/validate/validate.proto";

Contributing

  • I can help by doing more research.
  • I can help by implementing the feature after the proposal above is approved.
  • I can help by testing the feature before it's released.

Validation

Code of Conduct

Activity

  1. added
    wontfixWe're not going to do this
    and removed
    needs/triageWe still need to triage this
    on Dec 8, 2025
  2. KrishnaIyer commented on Dec 8, 2025

    @KrishnaIyer
    Member

    Hey @AdamMagaluk. Thanks for filing the issue! We agree in theory with the idea, but this is a lot of work for us to test all the changes and account for edge-cases.

    We'll consider starting with protovalidate in a future major version of TTS.

  3. AdamMagaluk commented on Dec 8, 2025

    @AdamMagaluk
    Author

    Thank you for the response. Yeah the change is a bit larger than I expected originally. I tried playing with it locally.

    For those needing it I did find a work around by providing: GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn as an env var when running the golang binary where both protos define validate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixWe're not going to do this

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions