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

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

up vote 11 down vote accepted
+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

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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值