Skip to content

Conversation

@MengqingCao
Copy link
Contributor

Why are these changes needed?

This pr fixes the AttributeError: 'str' object has no attribute 'DESCRIPTOR' when packaging message to dict using protobuf

Related issue number

Closes #54849

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @MengqingCao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a build-related bug by updating the protobuf dependency version. The change aims to resolve a specific AttributeError encountered when packaging messages to dictionaries, ensuring compatibility and proper functioning of protobuf-related operations.

Highlights

  • Dependency Update: The protobuf library dependency has been updated in python/requirements.txt to >3.20.0. This change specifically removes the previous version constraint !=3.19.5,>=3.15.3.
  • Bug Fix: This dependency update is intended to resolve an AttributeError: 'str' object has no attribute 'DESCRIPTOR' that occurs when packaging messages to dictionaries using protobuf.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@MengqingCao
Copy link
Contributor Author

PTAL, thx! @ruisearch42 @noemotiovon

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the protobuf dependency to address a packaging issue. A suggestion has been made to use a more specific protobuf version.

msgpack<2.0.0,>=1.0.0
packaging
protobuf!=3.19.5,>=3.15.3
protobuf>3.20.0
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider using a more specific protobuf version to avoid potential issues with a .0 release. It's often safer to avoid .0 releases and use >=3.20.1 since 3.20.0 was a release with significant changes and 3.20.1 contains bug fixes.

protobuf>=3.20.1

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree with the AI, let's do >=3.20.3 since it should be only bug fixes (https://pypi.org/project/protobuf/3.20.3/)

Copy link
Collaborator

Choose a reason for hiding this comment

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

ping @MengqingCao ^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh sorry for missing that, I'll update right now.

@noemotiovon
Copy link
Contributor

LGTM! Appreciate your effort.

@ray-gardener ray-gardener bot added community-contribution Contributed by the community core Issues that should be addressed in Ray Core labels Jul 25, 2025
Yikun pushed a commit to vllm-project/vllm-ascend that referenced this pull request Jul 30, 2025
### What this PR does / why we need it?
Fix protobuf version in Dockerfile to resolve `AttributeError: 'str'
object has no attribute 'DESCRIPTOR' when packaging message to dict`
using protobuf. will remove version specification after
ray-project/ray#54910 is merged

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
CI passed with existing test.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@0e36abf

Signed-off-by: MengqingCao <[email protected]>
@israbbani israbbani requested a review from a team August 5, 2025 21:52
Copy link
Contributor

@israbbani israbbani left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. @edoakes @jjyao @aslonnie merge if no objections.

Copy link
Collaborator

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

Good with me

Copy link
Collaborator

@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

@MengqingCao
Copy link
Contributor Author

Sorry, scanned it too quickly. We also need to update setup.py (per the comment above: https://github.com/ray-project/ray/pull/54910/files#diff-b72f6e5561c432513e240838ae1eeb3f85237fa3ed5d701ad4c3be2a55c57b9dR5)

Thanks for pointing that, updated now :-)

@aslonnie
Copy link
Collaborator

aslonnie commented Aug 6, 2025

well.. if core team says it is okay, I have no objection..

this is practically firing ray users that cannot upgrade protobuf to >3.20.

I wonder if there is a min reproduce script with ray (rather than through vllm) that can prove that ray (core) does not work with protobuf 3.20 or below any more.

there is basically only protobuf 3.20.3 that is above 3.20.0. maybe it is better to just say protobuf>=4 now..

@edoakes
Copy link
Collaborator

edoakes commented Aug 6, 2025

3.20 is from 2022 and we already required >3.15.3

@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Aug 6, 2025
Copy link
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

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

defer for @edoakes for final review actions.

@aslonnie
Copy link
Collaborator

aslonnie commented Aug 6, 2025

the failing gpu tests should be already fixed on master.

@MengqingCao
Copy link
Contributor Author

the failing gpu tests should be already fixed on master.

Thanks for this info, I have rebased the code to the latest master now

@MengqingCao
Copy link
Contributor Author

MengqingCao commented Aug 11, 2025

It seems CI failed due to network issue, could you help retrigger this? @edoakes
image

MengqingCao added a commit to MengqingCao/vllm-ascend-fork that referenced this pull request Aug 11, 2025
Fix protobuf version in Dockerfile to resolve `AttributeError: 'str'
object has no attribute 'DESCRIPTOR' when packaging message to dict`
using protobuf. will remove version specification after
ray-project/ray#54910 is merged

N/A

CI passed with existing test.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@0e36abf

Signed-off-by: MengqingCao <[email protected]>
@edoakes
Copy link
Collaborator

edoakes commented Aug 11, 2025

It seems CI failed due to network issue, could you help retrigger this? @edoakes

Done. You can always re-trigger by merging latest master and pushing as well.

@edoakes edoakes enabled auto-merge (squash) August 11, 2025 15:19
@edoakes edoakes merged commit f9373d2 into ray-project:master Aug 11, 2025
6 checks passed
@MengqingCao
Copy link
Contributor Author

MengqingCao commented Aug 11, 2025 via email

sampan-s-nayak pushed a commit that referenced this pull request Aug 12, 2025
This pr fixes the `AttributeError: 'str' object has no attribute
'DESCRIPTOR'` when packaging message to dict using `protobuf`

Closes #54849

Signed-off-by: MengqingCao <[email protected]>
Co-authored-by: Edward Oakes <[email protected]>
Signed-off-by: sampan <[email protected]>
wangxiyuan pushed a commit to vllm-project/vllm-ascend that referenced this pull request Aug 14, 2025
### What this PR does / why we need it?

Fix protobuf version in Dockerfile to resolve `AttributeError: 'str'
object has no attribute 'DESCRIPTOR' when packaging message to dict`
using protobuf. will remove version specification after
ray-project/ray#54910 is merged

backport of #2028

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
CI passed with new added test.

---------

Signed-off-by: MengqingCao <[email protected]>
dioptre pushed a commit to sourcetable/ray that referenced this pull request Aug 20, 2025
This pr fixes the `AttributeError: 'str' object has no attribute
'DESCRIPTOR'` when packaging message to dict using `protobuf`

Closes ray-project#54849

Signed-off-by: MengqingCao <[email protected]>
Co-authored-by: Edward Oakes <[email protected]>
Signed-off-by: Andrew Grosser <[email protected]>
jugalshah291 pushed a commit to jugalshah291/ray_fork that referenced this pull request Sep 11, 2025
This pr fixes the `AttributeError: 'str' object has no attribute
'DESCRIPTOR'` when packaging message to dict using `protobuf`

Closes ray-project#54849

Signed-off-by: MengqingCao <[email protected]>
Co-authored-by: Edward Oakes <[email protected]>
Signed-off-by: jugalshah291 <[email protected]>
chopper0126 pushed a commit to chopper0126/vllm-ascend that referenced this pull request Sep 26, 2025
### What this PR does / why we need it?
Fix protobuf version in Dockerfile to resolve `AttributeError: 'str'
object has no attribute 'DESCRIPTOR' when packaging message to dict`
using protobuf. will remove version specification after
ray-project/ray#54910 is merged

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
CI passed with existing test.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@0e36abf

Signed-off-by: MengqingCao <[email protected]>
dstrodtman pushed a commit to dstrodtman/ray that referenced this pull request Oct 6, 2025
This pr fixes the `AttributeError: 'str' object has no attribute
'DESCRIPTOR'` when packaging message to dict using `protobuf`

Closes ray-project#54849

Signed-off-by: MengqingCao <[email protected]>
Co-authored-by: Edward Oakes <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Angazenn pushed a commit to Angazenn/vllm-ascend that referenced this pull request Oct 21, 2025
### What this PR does / why we need it?
Fix protobuf version in Dockerfile to resolve `AttributeError: 'str'
object has no attribute 'DESCRIPTOR' when packaging message to dict`
using protobuf. will remove version specification after
ray-project/ray#54910 is merged

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
CI passed with existing test.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@0e36abf

Signed-off-by: MengqingCao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[protobuf_compat] AttributeError: 'str' object has no attribute 'DESCRIPTOR'

5 participants