Webservice currently unavailable Error:
500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

An unexpected condition was encountered.
Our service team has been dispatched to bring it back online.

Details

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2979, in execute_sql
    cursor = self.cursor(commit)
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2966, in cursor
    return self._state.conn.cursor()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.InterfaceError: connection already closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/orcidhub/orcid_hub/authcontroller.py", line 186, in index
    return render_template("index.html")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/templating.py", line 147, in render_template
    return _render(app, template, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/templating.py", line 130, in _render
    rv = template.render(context)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/var/www/orcidhub/orcid_hub/templates/index.html", line 1, in top-level template code
    {% extends "layout.html" %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/orcidhub/orcid_hub/templates/layout.html", line 45, in top-level template code
    {% block content %}{% endblock %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/orcidhub/orcid_hub/templates/index.html", line 3, in block 'content'
    {% cache 36000, "index" %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask_caching/jinja2ext.py", line 100, in _cache
    rv = caller()
         ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/orcidhub/orcid_hub/templates/index.html", line 35, in template
    {% if onboarded_organisations() %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/www/orcidhub/orcid_hub/authcontroller.py", line 105, in onboarded_organisations
    rv = list(
         ^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 6609, in __iter__
    self.execute()
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 1796, in inner
    return method(self, database, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 1867, in execute
    return self._execute(database)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2038, in _execute
    cursor = database.execute(self)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2994, in execute
    return self.execute_sql(sql, params, commit=commit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2978, in execute_sql
    with __exception_wrapper__:
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2759, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2979, in execute_sql
    cursor = self.cursor(commit)
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2966, in cursor
    return self._state.conn.cursor()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
peewee.InterfaceError: connection already closed