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

module 'google.api_core' has no attribute 'gapic_v1' #115

Closed
ubaierbhat opened this issue Jun 8, 2020 · 10 comments
Closed

module 'google.api_core' has no attribute 'gapic_v1' #115

ubaierbhat opened this issue Jun 8, 2020 · 10 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ubaierbhat
Copy link

ubaierbhat commented Jun 8, 2020

Since last week my DataFlow runs are failing because of this error. All I see in the logs is the following error

Stack trace

AttributeError: module 'google.api_core' has no attribute 'gapic_v1'
at PublisherClient (/usr/local/lib/python3.7/site-packages/google/cloud/pubsub_v1/gapic/publisher_client.py:245)
at <module> (/usr/local/lib/python3.7/site-packages/google/cloud/pubsub_v1/gapic/publisher_client.py:75)
at <module> (/usr/local/lib/python3.7/site-packages/google/cloud/pubsub_v1/publisher/client.py:29)
at <module> (/usr/local/lib/python3.7/site-packages/google/cloud/pubsub_v1/publisher/__init__.py:17)
at <module> (/usr/local/lib/python3.7/site-packages/google/cloud/pubsub_v1/__init__.py:18)
at <module> (/usr/local/lib/python3.7/site-packages/etl/util.py:13)
at <module> (/usr/local/lib/python3.7/site-packages/etl/extract/m/a.py:10)
at <module> (/usr/local/lib/python3.7/site-packages/etl/extract/m/a.py:6)
at find_class (/usr/local/lib/python3.7/site-packages/dill/_dill.py:474)
at load (/usr/local/lib/python3.7/site-packages/dill/_dill.py:305)
at loads (/usr/local/lib/python3.7/site-packages/dill/_dill.py:317)
at loads (/usr/local/lib/python3.7/site-packages/apache_beam/internal/pickler.py:283)
at __init__ (/usr/local/lib/python3.7/site-packages/dataflow_worker/workercustomsources.py:144)
at get_work_items (/usr/local/lib/python3.7/site-packages/dataflow_worker/workitem.py:131)
at run (/usr/local/lib/python3.7/site-packages/dataflow_worker/batchworker.py:807)

Environment details

python 3.7

$ pip freeze | grep google
google-api-core==1.20.0
google-api-helper==0.3.1
google-api-python-client==1.9.2
google-apitools==0.5.31
google-auth==1.16.1
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.4.1
google-cloud-bigquery==1.24.0
google-cloud-bigtable==1.0.0
google-cloud-core==1.3.0
google-cloud-datastore==1.7.4
google-cloud-dlp==0.13.0
google-cloud-language==1.3.0
google-cloud-pubsub==1.0.2
google-cloud-spanner==1.13.0
google-cloud-videointelligence==1.13.0
google-cloud-vision==0.42.0
google-resumable-media==0.5.1
googleapis-common-protos==1.52.0
grpc-google-iam-v1==0.12.3
@plamut plamut transferred this issue from googleapis/google-cloud-python Jun 9, 2020
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Jun 9, 2020
@plamut plamut added type: question Request for information or clarification. Not an issue. api: pubsub Issues related to the googleapis/python-pubsub API. and removed api: pubsub Issues related to the googleapis/python-pubsub API. labels Jun 9, 2020
@plamut
Copy link
Contributor

plamut commented Jun 10, 2020

@ubaierbhat Could you please provide a bit more info, e.g. versions installed etc.? That would make diagnosing the issue easier, thanks!

(you can take GitHub issue bug report template as a guidance)

@ubaierbhat
Copy link
Author

@plamut I have updated the description. the builds started failing since 5th June. The versions were set dynamically so I can't find out which versions were run before 5th.

@ubaierbhat
Copy link
Author

@plamut regression in google-api-core is causing this problem googleapis/python-api-core#47

This issue can be moved google-api-python-client (as latest version 1.9.* requires google-api-core >= 1.18.0)

the temporary solution is to pin google-api-python-client to an older version

'google-api-core==1.17.0',
'google-api-python-client==1.8.4'

@plamut
Copy link
Contributor

plamut commented Jun 12, 2020

@ubaierbhat Thanks for additional research, I only found the time to come back at this today.

It indeed seems like an external issue, but since a workaround exists, I'll classify it as P2.

By the way - google-api-core 1.17.0 suffers from another regression (fixed in the most recent version) that breaks the streaming pull, thus the users that use that feature should instead temporarily pin google-api-core to an even older version, e.g. 1.16.0.

@plamut plamut added external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed type: question Request for information or clarification. Not an issue. labels Jun 12, 2020
@meredithslota
Copy link
Contributor

The root cause was fixed in googleapis/python-api-core#47 so it should be (famous last words) safe to unpin versions as per @busunkim96's comment on June 18th: googleapis/python-api-core#47 (comment)

@ubaierbhat Can you try bumping the version for google-api-core and seeing if that fixes the issue?

@meredithslota meredithslota self-assigned this Aug 14, 2020
@bayesfactor
Copy link

I had to downgrade to 1.16.0 to resolve the import error

@meredithslota meredithslota assigned pradn and unassigned meredithslota Oct 26, 2020
@meredithslota meredithslota removed the external This issue is blocked on a bug with the actual product. label Feb 2, 2021
@meredithslota
Copy link
Contributor

Removing the "external" label since the external issue is fixed.

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Feb 2, 2021
@plamut
Copy link
Contributor

plamut commented Feb 9, 2021

@ubaierbhat @bayesfactor The external issue has been fixed, can any of you two confirm that by upgrading the dependencies to their latest versions indeed fixes the issue?

Thanks!

@meredithslota
Copy link
Contributor

I'm going to go ahead and close this for now, but please feel free to reopen if the fix does not resolve your issue!

@meredithslota meredithslota removed the 🚨 This issue needs some love. label Feb 17, 2021
@ubaierbhat
Copy link
Author

@meredithslota thanks and sorry, wasn't able to test because of busy schedule. I will test and report if the issue still exists (hopefully won't need to 🤞 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

6 participants