Skip to content

restarting postgresql causes HTTP 500 on first request #1

@awelzel

Description

@awelzel

Shouldn't that have been handled transparently...?

        before or while processing the request.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/awelzel/tourmap/tourmap/views/index.py", line 13, in index
    user_id=1
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2784, in one_or_none
    ret = list(self)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
    return self._execute_and_instances(context)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/awelzel/tourmap/venv/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) terminating connection due to administrator command
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
 [SQL: 'SELECT tours.id AS tours_id, tours.user_id AS tours_user_id, tours.name AS tours_name, tours.description AS tours_description, tours.start_date AS tours_start_date, tours.end_date AS tours_end_date, tours.tilelayer_provider AS tours_tilelayer_provider, tours.polyline_color AS tours_polyline_color, tours.polyline_weight AS tours_polyline_weight, tours.marker_positioning AS tours_marker_positioning, tours.marker_enable_clusters AS tours_marker_enable_clusters, tours.public AS tours_public \nFROM tours \nWHERE tours.name = %(name_1)s AND tours.user_id = %(user_id_1)s'] [parameters: {'name_1': 'destination uncertain', 'user_id_1': 1}]
INFO    - Thread-3921   - werkzeug: 127.0.0.1 - - [06/Oct/2018 10:51:31] "GET / HTTP/1.0" 500 -

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions