1

Trying to use Google App Engine's remote_api so that we can do line-by-line debugging through the IDE.

The remote api works great at first. The application is able to successfully retrieve information from the database. The error occurs when wepapp responds to the client browser.

The Code:

It is very similar to the example given in app engine's documentation:

from model import My_Entity
from google.appengine.ext.remote_api import remote_api_stub

# Test database calls
def get(w_self):
    remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func, 'myapp.appspot.com')

    t_entity = My_Entity.get_by_key_name('the_key')

    w_self.response.set_status(200)

    # The error occurs AFTER this code executes, when webapp actually responds to the browser

Error Traceback:

The error seems to be related to the blobstore.

Is the remote api initialized too late into the code?

...After webapp has done something with the blobstore through the localhost server? Then the remote api might be re-directing requests to the blobstore in the server instead of the localhost debug server where webapp is expecting it to be?

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2795, in _HandleRequest
    login_url)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3622, in CreateImplicitMatcher
    get_blob_storage)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_blobstore.py", line 420, in CreateUploadDispatcher
    return UploadDispatcher()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_blobstore.py", line 307, in __init__
    get_blob_storage())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_blobstore.py", line 79, in GetBlobStorage
    return apiproxy_stub_map.apiproxy.GetStub('blobstore').storage
AttributeError: 'RemoteStub' object has no attribute 'storage'

Should the remote api be initialized somewhere else in the code?

Or does this problem have to do with something else?

Thanks so much!

Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258

1 Answers1

0

To get this working you can use the help of the testbed to start the stubs that are missing:

ADDRESS=....
remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func, ADDRESS)

# First, create an instance of the Testbed class.
myTestBed = testbed.Testbed()

# Then activate the testbed, which prepares the service stubs for use.
myTestBed.activate()

# Next, declare which service stubs you want to use.
myTestBed.init_blobstore_stub()
myTestBed.init_logservice_stub()
fmatheis
  • 241
  • 3
  • 8