Skip to content Skip to sidebar Skip to footer

No Api Proxy Found For Service "app_identity_service" When Running Gae Script

I'm trying to run a custom stript to upload static files to a bucket. import os import sys sys.path.append('/tools/google_appengine') from google.appengine.ext import vendor from g

Solution 1:

The No api proxy found for service <blah> error messages typically indicate attempts to use GAE standard env infrastructure (packages under google.appengine in your case) inside standalone scripts, which is not OK. See GAE: AssertionError: No api proxy found for service "datastore_v3".

You have 2 options:

  • keep the code but make it execute inside a GAE app (as a request handler, for example), not as a standalone script
  • drop GAE libraries and switch to libraries designed to be used from standalone scrips. In your case you're looking for Cloud Storage Client Libraries. You may also need to adjust access control to the respective GAE app bucket.

Solution 2:

I'm not familiar with dev_appserver.SetupStubs(), but I received this same error message while running unit tests in a testbed. In that environment, you have to explicitly enable stubs for any services you wish to test (see the docs).

In particular, initializing the app identity stub solved my problem:

from google.appengine.ext importtestbedt= testbed.Testbed()
t.init_app_identity_stub()

Post a Comment for "No Api Proxy Found For Service "app_identity_service" When Running Gae Script"