'NoneType' object has no attribute 'makefile' #1

Open
opened 6 years ago by decentral1se · 0 comments
Owner

I think this is the bug that was mentioned on line 120 of this pad.

Found this by running sudo supervisorctl tail xppl:xppl-flask stderr.

[2018-11-30 19:35:41,866] ERROR in app: Exception on /uploads/9_organizationaftersocialmedia-web.pdf [GET]
Traceback (most recent call last):
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/xppl/xppl/views.py", line 61, in decorated_function
    return func(*args, **kwargs)
  File "/var/xppl/xppl/views.py", line 100, in uploaded_file
    book = Book.query.filter_by(file=filename).first()
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2895, in first
    ret = list(self[0:1])
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2687, in __getitem__
    return list(res)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 98, in instances
    util.raise_from_cause(err)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 249, in reraise
    raise value
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 79, in instances
    rows = [proc(row) for row in fetch]
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 79, in <listcomp>
    rows = [proc(row) for row in fetch]
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 511, in _instance
    loaded_instance, populate_existing, populators)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 622, in _populate_full
    populator(state, dict_, row)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1237, in load_collection_from_subq
    ()
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1174, in get
    self._load()
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1182, in _load
    lambda x: x[1:]
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__
    return self._execute_and_instances(context)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception
    util.reraise(*exc_info)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 249, in reraise
    raise value
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
    cursor.execute(statement, parameters)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/cursors.py", line 161, in execute
    "/db/query?" + _urlencode({'q': operation}))
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/cursors.py", line 72, in _request
    method, uri, body=body, headers=headers)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/connections.py", line 89, in _fetch_response
    response = self._retry_request(method, uri, body=body, headers=headers)
  File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/connections.py", line 78, in _retry_request
    return self._connection.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1194, in getresponse
    response = self.response_class(self.sock, method=self._method)
  File "/usr/lib/python3.5/http/client.py", line 235, in __init__
    self.fp = sock.makefile("rb")
AttributeError: 'NoneType' object has no attribute 'makefile'
I think this is the bug that was mentioned on line 120 of [this pad](https://pad.vvvvvvaria.org/wg.library). Found this by running `sudo supervisorctl tail xppl:xppl-flask stderr`. ``` [2018-11-30 19:35:41,866] ERROR in app: Exception on /uploads/9_organizationaftersocialmedia-web.pdf [GET] Traceback (most recent call last): File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise raise value File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/var/xppl/xppl/views.py", line 61, in decorated_function return func(*args, **kwargs) File "/var/xppl/xppl/views.py", line 100, in uploaded_file book = Book.query.filter_by(file=filename).first() File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2895, in first ret = list(self[0:1]) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2687, in __getitem__ return list(res) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 98, in instances util.raise_from_cause(err) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 249, in reraise raise value File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 79, in instances rows = [proc(row) for row in fetch] File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 79, in <listcomp> rows = [proc(row) for row in fetch] File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 511, in _instance loaded_instance, populate_existing, populators) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/loading.py", line 622, in _populate_full populator(state, dict_, row) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1237, in load_collection_from_subq () File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1174, in get self._load() File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/strategies.py", line 1182, in _load lambda x: x[1:] File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2995, in __iter__ return self._execute_and_instances(context) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 3018, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 948, in execute return meth(self, multiparams, params) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement compiled_sql, distilled_params File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context context) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception util.reraise(*exc_info) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 249, in reraise raise value File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context context) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute cursor.execute(statement, parameters) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/cursors.py", line 161, in execute "/db/query?" + _urlencode({'q': operation})) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/cursors.py", line 72, in _request method, uri, body=body, headers=headers) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/connections.py", line 89, in _fetch_response response = self._retry_request(method, uri, body=body, headers=headers) File "/home/xppl/.local/share/virtualenvs/xppl-UCsE39NU/lib/python3.5/site-packages/pyrqlite/connections.py", line 78, in _retry_request return self._connection.getresponse() File "/usr/lib/python3.5/http/client.py", line 1194, in getresponse response = self.response_class(self.sock, method=self._method) File "/usr/lib/python3.5/http/client.py", line 235, in __init__ self.fp = sock.makefile("rb") AttributeError: 'NoneType' object has no attribute 'makefile' ```
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.