Closed keybits closed 8 years ago
I have no idea, just looks like some kind of problem deep in werkzeug. Not relevant to micawber.
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 to socket.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 access http://localhost:5000
you'll see the error in OP; if you comment those lines out it will be gone.
Wow, nice find @jacquerie -- I will remove the offending code until I have some more time to investigate. Do you know much about what Flask/werkzeug is doing under-the-hood that isn't compatible with the code in micawber?
@coleifer To our knowledge, when Flask is run with debug it starts two processes (using the fork mechanism). One of them actually serves requests while other listens for changes in files to restart it. The imports are being run in both of the processes and also sockets get inherited. Maybe having a large timeout on sockets on the file change listener process breaks something. We didn't investigate further :)
121c12c5bab534f4c4605423645ae3ccf4d76831
Awesome, thanks again @mihaibivol!
Thanks for this :-)
I 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.