douping4436 2015-10-13 13:08
浏览 109

在代理后面使用Go App Engine时出现问题

I'm trying to run the example application hosted at: https://github.com/googlesamples/cloud-polymer-go, but when running it behind a proxy, I get the following errors:

$ goapp serve dispatch.yaml frontend/app.yaml backend/app.yaml
INFO     2015-10-13 13:04:19,461 devappserver2.py:763] Skipping SDK update check.
INFO     2015-10-13 13:04:19,526 api_server.py:205] Starting API server at: http://localhost:59441
INFO     2015-10-13 13:04:19,527 dispatcher.py:185] Starting dispatcher running at: http://localhost:8080
INFO     2015-10-13 13:04:19,529 dispatcher.py:197] Starting module "frontend" running at: http://localhost:8081
INFO     2015-10-13 13:04:19,534 dispatcher.py:197] Starting module "default" running at: http://localhost:8082
INFO     2015-10-13 13:04:19,534 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO     2015-10-13 13:04:23,859 module.py:786] frontend: "GET / HTTP/1.1" 304 -
INFO     2015-10-13 13:04:23,870 module.py:786] frontend: "GET /elements/post-list.html HTTP/1.1" 304 -
INFO     2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-service.html HTTP/1.1" 304 -
INFO     2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-form.html HTTP/1.1" 304 -
INFO     2015-10-13 13:04:24,377 module.py:786] frontend: "GET /elements/post-card.html HTTP/1.1" 304 -
WARNING  2015-10-13 13:04:26,344 dispatcher.py:762] Skipping dispatch.yaml rules because /_ah/api/static/proxy.html is not a dispatchable path.
socket.error 101
Traceback (most recent call last):
  File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
    self.server.gateway(self).respond()
  File "/home/robert/applib/appEngine/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2117, in respond
    for chunk in response:
  File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 121, in __call__
    yield self.dispatch(request, start_response)
  File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 138, in dispatch
    start_response)
  File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 172, in dispatch_non_api_requests
    return dispatch_function(request, start_response)
  File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 212, in handle_api_static_request
    response, body = discovery_api.get_static_file(request.relative_url)
  File "/home/robert/applib/appEngine/go_appengine/google/appengine/tools/devappserver2/endpoints/discovery_api_proxy.py", line 113, in get_static_file
    connection.request('GET', path, None, {})
  File "/usr/lib/python2.7/httplib.py", line 979, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 797, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1178, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 101] Network is unreachable

The variables:

$ echo $http_proxy 
http://asusis-isa2.personal.com.py:8080/
$ echo $https_proxy 
http://asusis-isa2.personal.com.py:8080/

Are correctly set.

I works with a direct Internet connection.

I'm under Ubuntu 14.04.

  • 写回答

1条回答 默认 最新

  • drvlf9739 2015-10-13 13:14
    关注

    EDIT Looks like there is a defect in the SDK around using a proxy with URLFetch.

    https://code.google.com/p/googleappengine/issues/detail?id=544

    Try setting the uppercase versions of those environment variables, HTTP_PROXY and HTTPS_PROXY. The gcloud launcher requires them that way so I assume goapp does as well.

    Using an HTTP proxy

    If you are running gcloud preview app behind an HTTP proxy, you must tell gcloud preview app the name of the proxy. To set an HTTP proxy for gcloud preview app, set the http_proxy and https_proxy environment variables. Note that you must specify the full path for the app.yaml file.

    Using Windows (in Command Prompt):

    $ set HTTP_PROXY=http://cache.mycompany.com:3128
    $ set HTTPS_PROXY=http://cache.mycompany.com:3128
    $ gcloud preview app deploy DIRECTORY/app.yaml
    

    Using the command line in Mac OS X (in Terminal) or Linux:

    $ export HTTP_PROXY="http://cache.mycompany.com:3128"
    $ export HTTPS_PROXY="http://cache.mycompany.com:3128"
    $ gcloud preview app deploy DIRECTORY/app.yaml
    
    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真