1

Chapter 1

Hello, I'm attempting to move the development process of a GAE/Py backend service to my local machine (so I don't annoy people [a crazy bunch of designers] using the service under the development environment while I'm implementing new features or whatever evil stuff I might be doing)

The actual state is that I have the local server up and running. I went through a first stupid issue (that you can discover in the link above). So when I request my local server I step into what looks like a failure to Auth with google API or the google datastore it self, I cannot decipher the logs more than that so I offer you the joy :

INFO     2018-07-20 13:06:31,168 main.py:40] running on local server
INFO     2018-07-20 13:06:31,288 client.py:515] Attempting refresh to obtain initial access_token
INFO     2018-07-20 13:06:31,484 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:31,648 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:31,805 client.py:536] Refreshing due to a 401
INFO     2018-07-20 13:06:31,966 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:31,966 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:32,128 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:32,289 util.py:126] new_request() takes at most 1 positional argument (6 given)
WARNING  2018-07-20 13:06:32,289 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:32,450 client.py:536] Refreshing due to a 401
INFO     2018-07-20 13:06:32,618 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:32,618 util.py:126] new_request() takes at most 1 positional argument (6 given)
.
.
repeats a lot of times
.
.
Then:
ERROR    2018-07-20 13:06:36,180 webapp2.py:1528] HTTP Error 401: Unauthorized Too many auth attempts.
Traceback (most recent call last):
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1077, in __call__
return handler.dispatch()
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "PROJECT_PATH\main.py", line 130, in post
configure_remote_api_dev_safe ('pvpsquad-dev.appspot.com')
File "PROJECT_PATH\main.py", line 43, in configure_remote_api_dev_safe
'/_ah/remote_api')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1052, in ConfigureRemoteApiForOAuth
rpc_server_factory=rpc_server_factory)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1137, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 842, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 259, in Send
NeedAuth()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 235, in NeedAuth
RaiseHttpError(url, response_info, response, 'Too many auth attempts.')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 85, in RaiseHttpError
raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
HTTPError: HTTP Error 401: Unauthorized Too many auth attempts.
ERROR    2018-07-20 13:06:36,184 wsgi.py:279]
Traceback (most recent call last):
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\runtime\wsgi.py", line 267, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1108, in add_context_wrapper
return synctaskletfunc(*args, **kwds)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1087, in synctasklet_wrapper
return taskletfunc(*args, **kwds).get_result()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1057, in tasklet_wrapper
result = func(*args, **kwds)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1519, in __call__
response = self._internal_error(e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1077, in __call__
return handler.dispatch()
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "PROJECT_PATH\main.py", line 130, in post
configure_remote_api_dev_safe ('pvpsquad-dev.appspot.com')
File "PROJECT_PATH\main.py", line 43, in configure_remote_api_dev_safe
'/_ah/remote_api')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1052, in ConfigureRemoteApiForOAuth
rpc_server_factory=rpc_server_factory)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1137, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 842, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 259, in Send
NeedAuth()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 235, in NeedAuth
RaiseHttpError(url, response_info, response, 'Too many auth attempts.')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 85, in RaiseHttpError
raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
HTTPError: HTTP Error 401: Unauthorized Too many auth attempts.
INFO     2018-07-20 15:06:36,226 module.py:880] default: "POST / HTTP/1.1" 500 -

After finishing writing this I m more and more thinking about the solution to be a sort of a Google cloud Console IAM service/account authorization thing, I m going to keep looking for this but I'm totally blind.

I would appreciate any kind of help so thanks in advance.

Solution : (thanks to @snakecharmerb and this answer

just run

gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email

RebH
  • 43
  • 6
  • WaW ! I was super far away from that kind of solution ! You definitely saved my day @snakecharmerb thank you for all your help ! Yeah I mean it was that ! totally works just run in shell : "gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email" – RebH Jul 20 '18 at 14:00

0 Answers0