Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

AttributeError: module 'googleapiclient' has no attribute '__version__' #16

Closed
letsgolesco opened this issue Apr 21, 2020 · 1 comment
Closed

Comments

@letsgolesco
Copy link

We're deploying a flex python service to Google App Engine that includes Flask, Gunicorn and ORTools.

Yesterday, without any changes on our end, builds suddenly started to fail with the error AttributeError: module 'googleapiclient' has no attribute '__version__'.

Our requirements.txt:

Flask==1.1.1
google-cloud-tasks==1.4.0
google-cloud-secret-manager==0.1.1
gunicorn==20.0.4
ortools==7.5.7466
pymongo[srv]==3.10.1
google-python-cloud-debugger==2.14

Our Google App Engine app.yaml:

runtime: python
service: service-name
env: flex
entrypoint: gunicorn -b :$PORT --log-level=debug --timeout=3000 --workers=2 --threads=2 servicename.main:app

runtime_config:
  python_version: 3

env_variables:
  GCLOUD_TASK_QUEUE_LOCATION: "us-central1"
  GCLOUD_TASK_QUEUE_ID: "task-queue-id"
  HOST: "ourhost.com"

liveness_check:
  path: "/api/liveness_check"

readiness_check:
  path: "/api/readiness_check"

manual_scaling:
  instances: 1
resources:
  cpu: 6
  memory_gb: 36
  disk_size_gb: 10

Example stacktrace:

Traceback (most recent call last):
  File "/env/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/env/lib/python3.6/site-packages/gunicorn/workers/gthread.py", line 92, in init_process
    super().init_process()
  File "/env/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/env/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/env/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/env/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/env/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/env/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/vmagent/app/matchpairinggenerator/main.py", line 12, in <module>
    import googleclouddebugger
  File "/env/lib/python3.6/site-packages/googleclouddebugger/__init__.py", line 33, in <module>
    from . import gcp_hub_client
  File "/env/lib/python3.6/site-packages/googleclouddebugger/gcp_hub_client.py", line 33, in <module>
    import apiclient
  File "/env/lib/python3.6/site-packages/apiclient/__init__.py", line 22, in <module>
    __version__ = googleapiclient.__version__
AttributeError: module 'googleapiclient' has no attribute '__version__'
@letsgolesco
Copy link
Author

Closing as duplicate of #15

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

No branches or pull requests

1 participant