Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-4714

KokuTenantSchemaExistsMiddleware prevents valid 5xx errors from surfacing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • March 2024, 2024Q1
    • None
    • None
    • None
    • 5
    • False
    • None
    • False

      Requests to all cost-mgmt API endpoints from users that do not have a corresponding Tenant will raise a ProgrammingError complaining about some table not existing. This is fine to handle and return an empty response to the user because that user does not technically exist for our application.

      However, our implementation of this logic is capturing ALL ProgrammingErrors for all endpoints. So if there is a real problem querying a db table in a given tenant (or even the public tenant), we just return a 200 status. We should update our middleware such that it verifies the ProgrammingError is caused by a missing Tenant, rather than assuming it is.

      An added benefit of doing this is that we will start seeing app-sre-alerts for real 5xx responses which we were never seeing previously.

              mskarbek Michael Skarbek
              mskarbek Michael Skarbek
              Eva Šebestová Eva Šebestová
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: