Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Couldn't build proto file into descriptor pool! #53

Closed
dhirschfeld opened this issue Oct 15, 2014 · 10 comments
Closed

TypeError: Couldn't build proto file into descriptor pool! #53

dhirschfeld opened this issue Oct 15, 2014 · 10 comments
Labels

Comments

@dhirschfeld
Copy link

When objects with the same name are defined in two separate .proto files the above error is thrown only when using the C++ backend for Python

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Oct 15, 2014

Such name conflict should be reported as an error in every implementation. The pure Python needs to be fixed to report an error as well.

@xfxyjwf xfxyjwf added the bug label Oct 15, 2014
@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 25, 2014

One problem is that in Python there isn't a central DecriptorPool with all generated types so it can't detect such conflicts. Unless such a DescriptorPool is introduced in Python, pure Python implementation won't be able to detect such conflicts. This also applies to Java.

@feiyuw
Copy link

feiyuw commented Apr 22, 2015

hi all,

any update of this issue? I also met this issue.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Apr 22, 2015

Hi feiyuw, if you met this issue, the right solution is to get rid of the duplicated messages (by changing the name of one of them).

@feiyuw
Copy link

feiyuw commented Apr 23, 2015

hi @xfxyjwf , the proto difinition is included in the to decode file together with protobuf message, and the file format is out of my control, now I use python implementation instead of cpp to work around this problem.

@mwildehahn
Copy link

running into this issue too, dropping back to python implementation fixed it.

is the issue really that you can't have objects with the same name in separate .proto files? i have a common practice of defining Request & Response messages in different services and then import them in a common registry.

is the issue just that common registry?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Oct 29, 2015

I think using the same name for different message types is not a good practice. In your case, you can set different package names on these .proto files and that will avoid the conflict.

@mwildehahn
Copy link

they all have different package names

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Oct 29, 2015

If they all have different package names, they will not be considered as conflicts. Could you post the content of the .proto files and the exact error message you got?

@Mubashshira
Copy link

@xfxyjwf how u solved this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants