Blobstore API failing to init blobs in local dev environment

37 views
Skip to first unread message

Shaun Budhram

unread,
May 10, 2020, 1:35:11 AM5/10/20
to Google App Engine
Hi all,

I'm trying to resurrect an older app that is using Python 2.7 and the older Blobstore API to read/write blob data.

I have some code that looks like this (not exactly, but should get the point across):

from google.appengine.api import files

fileName
= files.blobstore.create(mime_type='application/octet-stream')

I get this error when running this code locally:
  fileName = files.blobstore.create(mime_type='application/octet-stream')
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/files/blobstore.py", line 76, in create
   
return files._create(_BLOBSTORE_FILESYSTEM, params=params)
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/files/file.py", line 651, in _create
    _make_call
('Create', request, response)
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/files/file.py", line 250, in _make_call
    rpc
= _create_rpc(deadline=deadline)
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/files/file.py", line 233, in _create_rpc
   
return apiproxy_stub_map.UserRPC('file', deadline)
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 416, in __init__
   
self.__rpc = CreateRPC(service, stubmap)
 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 70, in CreateRPC
   
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "file"


I know this API has been deprecated, but I feel it should still be available to use since the Python 2.7 libraries should still be around, even if they won't be updated.  Also I know it works on the Google servers, because my old app is still able to run this code.  Does anyone know why I'd get this error now?  Is there a local workaround?

David (Cloud Platform Support)

unread,
May 11, 2020, 3:25:52 PM5/11/20
to Google App Engine

You probably need to import apiproxy_stub_map and register the file service stub:


from google.appengine.api import apiproxy_stub_map

from google.appengine.api.files import file_service_stub


See This Document for more information about how you could register the file service stub.


Please note that this question is better suited for Stack Overflow since Google Groups is meant for conceptual discussions about GCP products and not for programming issues.


Reply all
Reply to author
Forward
0 new messages