'IOError: [Errno 11] Resource temporarily unavailable' with Peewee sample blog app
See original GitHub issueI get the error shown below when I run the Peewee sample blog app from here: https://github.com/coleifer/peewee/tree/master/examples/blog
Specifically this happens when Micawber tries to display a post with links that need converting to embeds (e.g. a YouTube video link).
I’ve been able to reproduce this reliably with different links (e.g. Vimeo links instead of YouTube) and different browsers. It doesn’t always happen immediately, but if you click around to view the posts with embeds, then return to the index page, then view posts again, the error appears and the page is either unavailable or shows the page with no CSS. Errors in the console show that files failed to load: Failed to load resource: net::ERR_SOCKET_NOT_CONNECTED
This is in a Python 2.7.10 virtualenv on Ubuntu 15.10 running the Flask dev server.
Interestingly, running it in a Python 3.4 virtualenv works without issues. But it would be great to have a fix for Python 2.
Exception happened during processing of request from ('127.0.0.1', 33044)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
self.handle()
File "/home/tom/.virtualenvs/peewee-blog/local/lib/python2.7/site-packages/werkzeug/serving.py", line 216, in handle
rv = BaseHTTPRequestHandler.handle(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/home/tom/.virtualenvs/peewee-blog/local/lib/python2.7/site-packages/werkzeug/serving.py", line 247, in handle_one_request
self.raw_requestline = self.rfile.readline()
IOError: [Errno 11] Resource temporarily unavailable
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
I know that I’m doing some necroposting, but this was the only other mention on the internet of the problem we were having, so I felt I had to : )
We were seeing the same exception in our project, despite not using
micawber
anywhere, and @mihaibivol finally found the culprit: the call tosocket.setdefaulttimeout
here interferes with the way Flask handles sockets.Here’s a reduced example: https://github.com/jacquerie/isbnlib-flask-error-demo/blob/cf9114853bbc4c52d99098f16c007510d1e0320e/app.py
If you run
app.py
as it is and accesshttp://localhost:5000
you’ll see the error in OP; if you comment those lines out it will be gone.Thanks for this 😃