Skip to content

Intermittent db error - "server closed the connection unexpectedly" #571

@carrollsa

Description

@carrollsa

There is an intermittent error being thrown on the call to api/get_last_runs.

paws-compose-server  |   File "/app/./api/admin_api.py", line 241, in get_run_logs
paws-compose-server  |     result = connection.execute(q)
...
paws-compose-server  | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpected
paws-compose-server  |  This probably means the server terminated abnormally
paws-compose-server  |  before or while processing the request.
paws-compose-server  |
paws-compose-server  | [SQL: select keycol,valcol from kv_unique where keycol like '%%_update'; ]
paws-compose-server  | (Background on this error at: http://sqlalche.me/e/14/e3q8)
  • It seems to only happen when the container has been recently started
  • Most likely due to something not having finished spinning up with the database, as I can't think of another reason a valid SQL query with no params or anything would fail like this.
  • Manually testing a few times, the only way I could reproduce the error is to start the container and quickly go to the page where this endpoint is being hit, and the call has consistently succeeded when I've waited a minute or so after the container starts.
  • A page refresh has fixed the issue in every instance I've encountered

@c-simpson Does the above sound plausible? If so, I don't think this is much of an issue, but I wanted to track it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions