How should I resolve my appspot backup failure?
I'm trying to make a backup but it won't:
2011-10-01 09:22:43.706 /remote_api 302 5ms 0cpu_ms 0kb
213.89.134.0 - - [01/Oct/2011:05:22:43 -0700] "GET /remote_api HTTP/1.1" 302 0 - - "montaoproject.appspot.com" ms=6 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000032
$ python ./appcfg.py download_data --application=montaoproject --url=http:开发者_Python百科//montaoproject.appspot.com/remote_api --filename=montao.data
Downloading data records.
[INFO ] Logging to bulkloader-log-20111001.122234
[INFO ] Throttling transfers:
[INFO ] Bandwidth: 250000 bytes/second
[INFO ] HTTP connections: 8/second
[INFO ] Entities inserted/fetched/modified: 20/second
[INFO ] Batch Size: 10
[INFO ] Opening database: bulkloader-progress-20111001.122234.sql3
[INFO ] Opening database: bulkloader-results-20111001.122234.sql3
[INFO ] Connecting to montaoproject.appspot.com/remote_api
Please enter login credentials for montaoproject.appspot.com
Email: niklasro
Password for niklasro:
[INFO ] Authentication Failed
app.yaml:
- url: /remote_api
script: remote_api.py
remote_api.py:
from google.appengine.ext.remote_api import handler
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import re
MY_SECRET_KEY = 'thetopsecret'
cookie_re = re.compile('^"([^:]+):.*"$')
class ApiCallHandler(handler.ApiCallHandler):
def CheckIsAdmin(self):
login_cookie = self.request.cookies.get('dev_appserver_login', '')
match = cookie_re.search(login_cookie)
if (match and match.group(1) == MY_SECRET_KEY
and 'X-appcfg-api-version' in self.request.headers):
return True
else:
self.redirect('/_ah/login')
return False
application = webapp.WSGIApplication([('.*', ApiCallHandler)])
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()
Update
The server status is 302 and the method in remote_api.py
is not reached:
2011-11-08 09:02:40.214 /remote_api?rtok=935015419683 302 12ms 0kb
213.89.134.0 - - [08/Nov/2011:03:02:40 -0800] "GET /remote_api?rtok=935015419683 HTTP/1.1" 302 0 - - "montaoproject.appspot.com" ms=13 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000026
When using this approach to get remote API to work with open ID (from http://blog.notdot.net/2010/06/Using-remote-api-with-OpenID-authentication), I think you need to specify the secret key (ie 'thetopsecret') as the email when prompted (and then just hit enter when prompted for the password).
Use correct credentials. niklasro is not your email address.
If your app is using the High-replication datastore then your App-ID will be 's~montaoproject' (and probably needs to be in quotes on the command line? It certainly won't hurt to do so...).
[INFO ] Authentication Failed
It is nothing to do with GAE core , Authentication failed => either your login request failed or you are not providing the right credentials .
You are working behind proxy ? https is trouble behind squid proxy .
MY_SECRET_KEY corresponds with your login, not your password. You shouldn't need to actually enter a password (just hit return). So when you authenticate use:
Email: thetopsecret
Password for thetopsecret: (nothing)
精彩评论