python - App engine URLError download error in dev_appserver.py. "Cannot assign requested address" -


i trying download large remote file, , getting new error.. i've never seen before , url trying works when put browser.

i request url with:

    startdownloadtime = datetime.datetime.now()     logging.info("download start time: "+startdownloadtime.strftime("%h:%m.%s"))     url = [my url]     logging.info("starting download")     r = requests.get(url)     logging.info("download complete")  

here full trace:

urlerror: <urlopen error [errno 99] cannot assign requested address> traceback (most recent call last):   file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate req.respond()   file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond self.server.gateway(self).respond()   file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond response = self.req.server.wsgi_app(self.env, self.start_response)   file "/home/username/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 269, in __call__ return app(environ, start_response)   file "/home/username/google_appengine/google/appengine/tools/devappserver2/request_rewriter.py", line 311, in _rewriter_middleware response_body = iter(application(environ, wrapped_start_response))   file "/home/username/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 149, in __call__ self._flush_logs(response.get('logs', []))   file "/home/username/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 264, in _flush_logs apiproxy_stub_map.makesynccall('logservice', 'flush', request, response)   file "/home/username/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 94, in makesynccall return stubmap.makesynccall(service, call, request, response)   file "/home/username/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 328, in makesynccall rpc.checksuccess()   file "/home/username/google_appengine/google/appengine/api/apiproxy_rpc.py", line 156, in _waitimpl self.request, self.response)   file "/home/username/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 200, in makesynccall self._makerealsynccall(service, call, request, response)   file "/home/username/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 226, in _makerealsynccall encoded_response = self._server.send(self._path, encoded_request)   file "/home/username/google_appengine/google/appengine/tools/appengine_rpc.py", line 409, in send f = self.opener.open(req)   file "/usr/lib/python2.7/urllib2.py", line 400, in open response = self._open(req, data)   file "/usr/lib/python2.7/urllib2.py", line 418, in _open '_open', req)   file "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain result = func(*args)   file "/usr/lib/python2.7/urllib2.py", line 1207, in http_open return self.do_open(httplib.httpconnection, req)   file "/usr/lib/python2.7/urllib2.py", line 1177, in do_open raise urlerror(err) urlerror: <urlopen error [errno 99] cannot assign requested address> 

it large file found myself having use sockets in order download it, app.yaml file has:

env_variables:    gae_use_sockets_httplib : 'anyvalue' 

in it. ideas?

edit: wanted add specific local development server , works in production code.

edit 2: add -- script works few minutes before crashing out seems trying download file..

i fixed -- running out of ports , increased port range with:

$ sudo sysctl -w net.ipv4.ip_local_port_range="15000 61000" 

and started working.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -