解决windows 使用google app engine (urlopen error 10060)

来源:互联网 发布:ff14蒂法捏脸数据 编辑:程序博客网 时间:2024/04/29 09:19
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Google App Engine Launcher takes forever to start when launched behind a proxy server

up vote9down votefavorite
6

I've been tinkering with the GAE and I enjoy the ease of use of the GAE Launcher that is available with the Windows SDK.

My problem is that when I start the application, it takes it a long time to become responsive. I assume that this is because the program first checks for updates before starting the app. This causes it to hang, while it's waiting for a response. This is a problem because my primary dev machine is behind a proxy server.

Is there a way that I can disable the check for updates to the GAE when I start the launcher? Maybe a command that I can pass to the underlying executable through my shortcut?

Thanks in advance.

share|improve this question
 
 
Try clearing your development datastore (if that's feasible in your case). –  Kevin P Jun 24 '11 at 15:53 
 
My datastore is clear. To be sure, the hanging takes place when I double-click on the launcher application icon-- not when I try to start a project. –  RLH Jun 24 '11 at 17:03

2 Answers

activeoldestvotes
up vote11down voteaccepted
+50

Google App Engine (GAE) use the python urllib2 library to check for updates. This library gets the proxy settings from *_proxy environment variables, instead of the windows registry.

By default, ProxyHandler uses the environment variables named <scheme>_proxy, where <scheme> is the URL scheme involved. For example, the http_proxy environment variable is read to obtain the HTTP proxy’s URL.

If you need to use a proxy and don't have this variable properly defined, your GAE Launcher will lock until a connection timeout, delaying the start of the program.

If you create a new environment variable called http_proxy with host_or_ip:port, GAE Launcher will start in a blink of an eye.

To define an environment variable, go to: Control Panel -> System and Security -> System -> Advanced system settings -> Advanced Tab -> Environment Variables...

share|improve this answer
 
 
Aha, Brilliant! This worked exactly as you stated. This has been annoying me for years. –  RLH Mar 30 '12 at 14:13
 
Haha, i'm glad i helped :D, actually surlac's solution worked for me, but i didn't like changing the source code, besides, my solution will fix other python applications and self-written code. –  KurzedMetal Mar 30 '12 at 14:21
up vote5down vote

Make sure all your GAE-java/python processes are shutted down before you fork new ones. It's very often that they stuck and consume processor time and memory after you hit CTRL+C.


[EDIT]

To disable updates run the server with

--disable_update_check

option.

Usage: <dev-appserver> [options] <war directory>


[EDIT]

Open dev_appserver.cmd script from GAE SDK with your favorite text processor and manually add --disable_update_check option right after DevAppServerMain definition.

java -cp "%~dp0\..\lib\appengine-tools-api.jar" ^com.google.appengine.tools.KickStart ^   com.google.appengine.tools.development.DevAppServerMain --disable_update_check %*

Next time you'll run an application from the GAE Launcher, it will start with "--disable_update_check" option automatically.


[EDIT]

For Python:

open python source code at

[GAE_SDK_PY]/google/appengine/tools/dev_appserver_main.py

with your favorite text processor, find a 227-th line, it looks like

ARG_SKIP_SDK_UPDATE_CHECK: False,

and overwrite it with following:

  ARG_SKIP_SDK_UPDATE_CHECK: True, 

Hope this helps.

share|improve this answer
 
 
That would work if I was running the server from a console window. Passing the --disable_update_check option to the App Engine Launcher does not help. There may not be a way to fix this problem. I can accept that, however, this issue is a bit annoying. –  RLH Jun 27 '11 at 12:28
 
To work around this issue you need to manually edit "dev_appserver.cmd" script as described in the answer. – Ruslan Sharifullin Jun 27 '11 at 16:15
 
Ah, I see. Is there a python equivalent? –  RLH Jun 27 '11 at 16:29
 
You need to update dev_appserver_main.py according to my answer. –  Ruslan Sharifullin Jun 27 '11 at 20:10
 
Thanks for your response. That has fixed the dev server, but the launcher still hangs when I start it. I'm marking this response as the answer because I'm assuming that the real problem must come from another issue. Thanks for your help. –  RLH Jun 27 '11 at 20:52
0 0