1

I am trying to build the discovery docs for my endpoints application, but I am getting the following error:

pc@pc:~/backend$ endpointscfg.py get_discovery_doc [PROJECT_NAME]
Traceback (most recent call last):
  File "/home/pc/Downloads/google-cloud-sdk/bin/endpointscfg.py", line 10, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/pc/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 22, in <module>
    from googlecloudsdk.core.credentials import store as c_store
  File "/home/pc/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 30, in <module>
    from googlecloudsdk.core.credentials import creds
  File "/home/pc/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/credentials/creds.py", line 32, in <module>
    from oauth2client.contrib import multistore_file
ImportError: cannot import name multistore_file

The version of oauth2client is 4.1.0. It seems the file oauth2client.contrib.multistore_file was deprecated and then removed from oauth2client (https://github.com/google/oauth2client/pull/589), so I assumed my google client libraries were out of date, but I have run gcloud components update app-engine-python and I still get the same error.

Am I doing something wrong?

Borja
  • 1,411
  • 11
  • 20

1 Answers1

3

I'm afraid the solution is that you have to use an older version of oauth2client. If you ensure you have the latest (1.1.2) version of google-endpoints-api-management, then you will want to install google-apitools version 0.5.11 and oauth2client version 3.0.0.

Rose Davidson
  • 652
  • 4
  • 7
  • 1
    It's still a problem as of today. I have google_endpoints `4.6.1` + google_endpoints_api_management `1.10.0` + google_apitools `0.5.24` + oauth2client `3.0.0`. I checked the source code and it seems `apitools/base/py/credentials_lib.py` in particular is the one that import `multistore_file` and caused the problem. Maybe it can be updated to refer to new/recommended module? – Clint Sep 11 '18 at 19:50
  • 1
    Also for context, this problem causes very slow responses (> 13 seconds) for some of my requests. – Clint Sep 11 '18 at 19:53
  • There is no available replacement for these modules. – Rose Davidson Sep 17 '18 at 18:07
  • How do we fix this error? Some of my appengine project responses are taking a very long time – mparkes Dec 15 '18 at 20:08
  • We can't fix it. The newest versions don't work on App Engine and never will. – Rose Davidson Dec 17 '18 at 19:55
  • Any update on this issue? I just migrated a project from V1 of endpoints and am receiving this error after following: https://cloud.google.com/endpoints/docs/frameworks/python/migrating – mparkes Feb 08 '19 at 22:28
  • Nope, there's no possible fix for this issue due to App Engine not allowing the new versions. All you can do is stick with the older versions that are allowed. – Rose Davidson Feb 11 '19 at 16:43