0

I've been able to connect from a local script directly to the Google App Engine (GAE) ndb store on the server as described in this article.

But I'm trying to do the same thing to access my local dev server but am not able to. My dev API server runs at http://localhost:42020 but when I try to connect using the following command:

$ remote_api_shell.py -s http://localhost:42020

I get the following error:

Traceback (most recent call last):
  File "/home/myuser/google_appengine/remote_api_shell.py", line 127, in <module>
    run_file(__file__, globals())
  File "/home/myuser/google_appengine/remote_api_shell.py", line 123, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 150, in <module>
    main(sys.argv)              
  File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 146, in main
    appengine_rpc.HttpRpcServer)
  File "/home/myuser/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
    rpc_server_factory=rpc_server_factory)
  File "/home/myuser/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 874, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/home/myuser/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/home/myuser/google_appengine/google/appengine/tools/appengine_rpc.py", line 424, in Send
    f = self.opener.open(req)   
  File "/usr/lib/python2.7/urllib2.py", line 401, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 419, in _open
    '_open', req)               
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)        
  File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1181, in do_open
    raise URLError(err)         
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

Is it not possible to connect locally?

2
  • Yes it is. I do that all the time. 42020 is not a default port for the dev server to run on. Did you explicifly specify that port number when you started the dev server ? Commented Feb 7, 2015 at 12:28
  • Well, it was the port when I started it. I know I can fix the default port with a command line param, right now I'm just trying to get it to work! Would be great if you could share how you connect to it! Commented Feb 7, 2015 at 13:12

1 Answer 1

1

Looks like I was doing it wrong. This answer solved my problem.

In short, I had to connect to the regular web server for it to work without the leading http. This asks for my email and password and once I enter that, it works!

$ remote_api_shell.py -s localhost:8080
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.