google-cloud-python: AttributeError: 'SymbolDatabase' object has no attribute 'RegisterServiceDescriptor'

Today, our daily gcloud ml-engine job has been broken. The problem may come from the changes in the module grpc-google-iam-v1. It seems that you did an update for the module grpc-google-iam-v1 from 0.11.1 (?) to 0.11.3 on the server-side. I compared the “broken” version with the “working” version. I realized that the only diff is in the module grpc-google-iam-v1.

Python version: Python 2.7

Google-Cloud version:

google-cloud==0.24.0
google-cloud-storage==1.2.0
grpc-google-iam-v1==0.11.3

It has been broken because the pip tried to install grpc-google-iam-v1==0.11.3 which did not have the attribute RegisterServiceDescriptor in the object SymbolDatabase

Stacktrace: Traceback (most recent call last): File "/usr/local/bin/pip", line 5, in <module> from pkg_resources import load_entry_point File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3074, in <module> @_call_aside File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3058, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3102, in _initialize_master_working_set for dist in working_set File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3102, in <genexpr> for dist in working_set File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2633, in activate declare_namespace(pkg) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2191, in declare_namespace _handle_ns(packageName, path_item) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2126, in _handle_ns loader.load_module(packageName) File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module mod = imp.load_module(fullname, self.file, self.filename, self.etc) File "/root/.local/lib/python2.7/site-packages/google/cloud/pubsub/__init__.py", line 30, in <module> from google.cloud.pubsub.client import Client File "/root/.local/lib/python2.7/site-packages/google/cloud/pubsub/client.py", line 28, in <module> from google.cloud.pubsub._gax import _PublisherAPI as GAXPublisherAPI File "/root/.local/lib/python2.7/site-packages/google/cloud/pubsub/_gax.py", line 19, in <module> from google.cloud.gapic.pubsub.v1.publisher_client import PublisherClient File "/root/.local/lib/python2.7/site-packages/google/cloud/gapic/pubsub/v1/publisher_client.py", line 37, in <module> from google.iam.v1 import iam_policy_pb2 File "/root/.local/lib/python2.7/site-packages/google/iam/v1/iam_policy_pb2.py", line 296, in <module> _sym_db.RegisterServiceDescriptor(_IAMPOLICY) AttributeError: 'SymbolDatabase' object has no attribute 'RegisterServiceDescriptor'

Steps to reproduce: It’s very easy to reproduce: Cause of #3736, we have to freeze the following version:

google-cloud == 0.24.0
google-cloud-storage == 1.2.0

ps: I did not test the latest version yet but at least the grpc-google-iam-v1==0.11.3 is not compatible with these versions google-cloud

Workaround: freeze the version grpc-google-iam-v1==0.11.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

It seems to be a version conflict, that attribute is just not there in protobof==3.2.0, but the beam_fn_api_pb module assumes it is:

In [1]: import google.protobuf

In [2]: google.protobuf.__version__
Out[2]: '3.2.0'

In [3]: import sys

In [4]: sys.version
Out[4]: '2.7.14 (default, Oct  5 2017, 09:30:02) \n[GCC 5.4.0 20160609]'

In [5]: from google.protobuf import symbol_database

In [6]: symbol_database.SymbolDatabase.RegisterServiceDescriptor
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-a114c41d11ce> in <module>()
----> 1 symbol_database.SymbolDatabase.RegisterServiceDescriptor

AttributeError: type object 'SymbolDatabase' has no attribute 'RegisterServiceDescriptor'

It is there in the current latest version (which is 3.4.0):

In [1]: import sys

In [2]: sys.version
Out[2]: '2.7.14 (default, Oct  5 2017, 09:30:02) \n[GCC 5.4.0 20160609]'

In [3]: import google.protobuf

In [4]: google.protobuf.__version__
Out[4]: '3.4.0'

In [5]: from google.protobuf import symbol_database

In [6]: symbol_database.SymbolDatabase.RegisterServiceDescriptor
Out[6]: <unbound method SymbolDatabase.RegisterServiceDescriptor>

Since the answer seems to be “upgrade protobuf”, I am going to pre-emptively close this.

If I’m misunderstood the problem and solution, I am sorry. I am certainly happy to re-open this or continue discussion if need be.

On Thursday, September 21, 2017 at 12:31:01 PM UTC-7, Luke Sneeringer wrote:

I assume it is, but not sure. I can try to find out.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Is there an eta on the fix? I ran into the same error running a training pipeline today. Or is there a way to modify the ml engine worker environment when submitting a job?