This repository was archived by the owner on Jul 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
chore: Add release notes for protobuf 4.x upgrade #7363
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2d4442d
chore: Add release notes for protobuf 4.x upgrade
blakeli0 008ae43
Update libraries-bom/releaseNotes.md
blakeli0 ba565d3
Update libraries-bom/releaseNotes.md
blakeli0 49bdb13
Address review comments
blakeli0 3744d58
Update libraries-bom/releaseNotes.md
blakeli0 810ae6b
Update releaseNotes.md
blakeli0 2f0eae1
Update releaseNotes.md
blakeli0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| ### Upgrade Overview | ||
| The `libraries-bom` and its managed libraries have been upgraded to use **Protobuf v4.33.2**. All Protobuf gen code included in the managed libraries has been regenerated using `protoc v33.2`. | ||
|
|
||
| --- | ||
| ### ✅ Backward Compatibility | ||
| The new protobuf-java v4.33.2 runtime is fully backward-compatible with protoc gen code 3.x. You should not experience any incompatibilities from using older gen code with the new runtime. | ||
| Should you experience compatibility issues, please consult the [Known Incompatibilities & Mitigations](#known-incompatibilities-mitigations). If the issue persists, please file a report via the [support console](https://cloud.google.com/support-hub) or our [GitHub repository](https://github.com/googleapis/sdk-platform-java/tree/main) | ||
|
|
||
| --- | ||
| ### ⚠️ Advisory: Vulnerability Warnings | ||
| After upgrading, you may see a new warning in your logs: `Vulnerable protobuf generated type in use`. | ||
| This warning does not mean the Java SDK is vulnerable. It indicates that your application, or one of its other dependencies, is still using gen code < `3.21.7`. | ||
| For a detailed explanation and mitigation steps, please refer to the Java section in the official Protobuf [v4.33.0 release notes](https://github.com/protocolbuffers/protobuf/releases/tag/v33.0). | ||
|
|
||
| --- | ||
|
|
||
| ### Known Incompatibilities & Mitigations | ||
| While rare, the following incompatibilities may occur due to the version update: | ||
|
|
||
| #### 1. Runtime Version Mismatch | ||
| * **Issue:** The minimum required `protobuf-java` runtime version is now **v4.33.2**. Starting with the 4.x runtime, [validations](https://github.com/protocolbuffers/protobuf/blob/1082da2da37a0887d0cfd70abf4a00e8973cd8bf/java/core/src/main/java/com/google/protobuf/RuntimeVersion.java#L55-L73) ensure the runtime version is higher than or equal to the gen code version. Using a lower version of protobuf-java will produce errors below. | ||
| * **Symptoms:** | ||
| * `java.lang.NoClassDefFoundError: com/google/protobuf/RuntimeVersion$RuntimeDomain` (when using 3.x versions). | ||
| * `com.google.protobuf.RuntimeVersion$ProtobufRuntimeVersionException` (when using older 4.x versions). | ||
| * **Mitigation:** Upgrade the version of `protobuf-java` to be greater than or equal to **v4.33.2**. | ||
|
|
||
| #### 2. Class Hierarchy Changes (`GeneratedMessageV3`) | ||
| * **Issue:** `GeneratedMessageV3` is no longer a parent class of gen code. | ||
| * **Symptoms:** Runtime errors will occur if attempting to cast Proto 4.x gen code to `GeneratedMessageV3`. For example, `DeleteInstanceRequest` now extends [GeneratedMessage](https://github.com/googleapis/google-cloud-java/blob/d7a49aa9502012df1209b55ec741b1d4ac639361/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/DeleteInstanceRequest.java#L33) instead of [GeneratedMessageV3](https://github.com/googleapis/google-cloud-java/blob/1b56d017b4f93b5037f7261c488e008ac59897d8/java-compute/proto-google-cloud-compute-v1/src/main/java/com/google/cloud/compute/v1/DeleteInstanceRequest.java#L31). You will run into `java.lang.ClassCastException` when trying to run `(GeneratedMessageV3)DeleteInstanceRequest`. | ||
| * **Mitigation:** Migrate usages of `GeneratedMessageV3` to its parent interface, `Message`. | ||
|
blakeli0 marked this conversation as resolved.
|
||
|
|
||
| #### 3. Descriptor Syntax APIs | ||
| * **Issue:** Certain internal methods in [Descriptors](https://github.com/protocolbuffers/protobuf/commit/1aeacd4f4eb4e0aa05d6336e2988a565e475e9a0) are no longer available. | ||
|
blakeli0 marked this conversation as resolved.
|
||
| * **Symptoms:** `java.lang.NoSuchMethodError` when calling `Syntax`, `getSyntax()`, `hasOptionalKeyword()` or `isSynthetic()`. | ||
| * **Mitigation:** There are no direct alternative methods; it is suggested to stop using them. | ||
|
|
||
| #### 4. Legacy Generated Code (v2.x) | ||
| * **Issue:** The 4.33.x runtime is incompatible with v2.x gen code. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a specific error message that shows up when this occurs? What would the user be looking for in the error message to know that this is the case?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I don't have it. There will be different errors in different scenarios, actually for basic scenarios 4.33.x might still be compatible. Considering this is a very old use case and really hard to reproduce, I think it's OK to not mention the specific errors. |
||
| * **Mitigation:** Migrate gen code to at least **v3.0.0**. Please note that 3.x support will [end in March 2027](https://protobuf.dev/support/version-support/#java); it is strongly recommended to upgrade gen code to 4.x. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we recommend that the customer resolve this ASAP? Since this is technically a CVE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to leave it to the customer. It is a medium CVE and customers may decide to ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can link to the CVE and the customer can decide the importance