Issue: Blog example: werkzeug error
Author: rubensoleao
State: closed
Created: 2016-01-30 12:37:08

When I run the blog, I randomly get this werkzeug error.

> Exception happened during processing of request from ('127.0.0.1', 38174)
> 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/lubens/Documents/CACIC/Site/blog/local/lib/python2.7/site-packages/werkzeug/serving.py", line 217, in handle
>     rv = BaseHTTPRequestHandler.handle(self)
>   File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
>     self.handle_one_request()
>   File "/home/lubens/Documents/CACIC/Site/blog/local/lib/python2.7/site-packages/werkzeug/serving.py", line 248, in handle_one_request
>     self.raw_requestline = self.rfile.readline()
> IOError: [Errno 11] Resource temporarily unavailable

Does someone know why that could be?

Thank you!


I've noticed that this starts happening when I put youtube videos in my blog entries.

Sometimes I also get this error:

> peewee.IntegrityError
> 
> IntegrityError: UNIQUE constraint failed: entry.slug
> Traceback (most recent call last)
> 
> ```
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
> 
> return self.wsgi_app(environ, start_response)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
> 
> response = self.make_response(self.handle_exception(e))
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
> 
> reraise(exc_type, exc_value, tb)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
> 
> response = self.full_dispatch_request()
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
> 
> rv = self.handle_user_exception(e)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
> 
> reraise(exc_type, exc_value, tb)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
> 
> rv = self.dispatch_request()
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
> 
> return self.view_functions[rule.endpoint](**req.view_args)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/HTML/app.py", line 148, in inner
> 
> return fn(*args, **kwargs)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/HTML/app.py", line 201, in create
> 
> published=request.form.get('published') or False)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 4494, in create
> 
> inst.save(force_insert=True)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/HTML/app.py", line 86, in save
> 
> ret = super(Entry, self).save(*args, **kwargs)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 4680, in save
> 
> pk_from_cursor = self.insert(**field_dict).execute()
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 3213, in execute
> 
> cursor = self._execute()
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 2628, in _execute
> 
> return self.database.execute_sql(sql, params, self.require_commit)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 3461, in execute_sql
> 
> self.commit()
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 3285, in __exit__
> 
> reraise(new_type, new_type(*exc_args), traceback)
> 
> File "/home/lubens/Documents/CACIC/Site/blog/lib/python2.7/site-packages/peewee.py", line 3454, in execute_sql
> 
> cursor.execute(sql, params or ())
> 
> IntegrityError: UNIQUE constraint failed: entry.slug
> ```
> 
> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
> 
> To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.
> 
> You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:
> 
> ```
> dump() shows all variables in the frame
> dump(obj) dumps all that's known about the object
> ```


I have no idea what the problem is, but the application itself is fine.


hi , I have the same problem, using python 2.7 and it happens both using uwsgi or the flask built-in server


For me it happens only when I run app in debug mode. Try to run app without debug. @rubensoleao You're right - youtube videos in entries are related to this issue.