Ok, I think I figured out the issue.

ConfigureRemoteApiForOAuth replaces the stub for ALL services. 

This includes the "urlfetch" service.

The problem is the httplib2 library uses "urlfetch" when it detects google 
appengine.

So using urlfetch in your app, results in a call to rpc.check_success() 
which results in another call to "urlfetch" and so on ad infinitum.

One workaround I have is to replace the 'urlfetch' stub with it's original 
value after configuring the the remote api for oauth.

from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.api import apiproxy_stub_map


local_stub = apiproxy_stub_map.apiproxy.GetStub('urlfetch')
remote_api_stub.ConfigureRemoteApiForOAuth('myapp.appspot.com',
'/_ah/remote_api')
apiproxy_stub_map.apiproxy.ReplaceStub('urlfetch', local_stub)


This prevented the infinite recursion.

I'm curious if there is a way to disable urlfetch from using google 
appengine built in that I am missing.  Either way, the documentation on 
making an app use the remote api does not mention anything about the 
urlfetch service recursion issue.

Hope this helps someone.


On Thursday, March 10, 2016 at 10:32:32 AM UTC-6, Danny Tran wrote:
>
> I'm attempting to make my appengine application running locally use a 
> remote datastore.
>
> In appengine_config.py I'm adding the following lines.
>
> from google.appengine.ext.remote_api import remote_api_stub
> remote_api_stub.ConfigureRemoteApiForOAuth('MyApp.appspot.com','/_ah/remote_api')
>  
> # name removed
>
> Per the instructions here:
> https://cloud.google.com/appengine/docs/python/tools/remoteapi
>
> However, when I try to send a basic HTTP request to my local app, it 
> results in an infinite recursion loop between a url fetcher and a logger.
>
> Am I missing something?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/6facdab5-aef4-4f9a-b697-1d2dcca7e952%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to