Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-6462

Quay operator doesn't upgrade schema on managed psql 13

XMLWordPrintable

    • False
    • None
    • False
    • 0

      It has happened a couple of times where the quay operator migrates the database from psql 10 to psql 13 but doesn't upgrade the database schema on psql 13. In the logs we get errors like

      gunicorn-registry stdout | 2023-11-07 19:12:01,946 [219] [DEBUG] [auth.credentials] Successfully validated credentials for user quayadmin
      gunicorn-registry stdout | 2023-11-07 19:12:01,947 [219] [DEBUG] [auth.decorators] Found valid auth result: (<AuthKind.basic: 'basic'>, False, None, [<User: 1>, None, None, None, None, None, None])
      gunicorn-registry stdout | 2023-11-07 19:12:01,947 [219] [DEBUG] [auth.permissions] Identity loaded: <QuayDeferredPermissionUser id="11ac7545-db0d-48c9-81f8-376fc55cc468" auth_type="user_uuid" provides=set()>
      gunicorn-registry stdout | 2023-11-07 19:12:01,947 [219] [DEBUG] [auth.permissions] Deferring permissions for user with uuid: 11ac7545-db0d-48c9-81f8-376fc55cc468
      gunicorn-registry stdout | 2023-11-07 19:12:01,947 [219] [DEBUG] [endpoints.v2.v2auth] Request audience: quay.apps.ocp.classroom.example.com
      gunicorn-registry stdout | 2023-11-07 19:12:01,947 [219] [DEBUG] [endpoints.v2.v2auth] Scope request: []
      gunicorn-registry stdout | 2023-11-07 19:12:01,948 [219] [DEBUG] [peewee] ('SELECT "t1"."id", "t1"."uuid", "t1"."username", "t1"."password_hash", "t1"."email", "t1"."verified", "t1"."stripe_id", "t1"."organization", "t1"."robot", "t1"."invoice_email", "t1"."invalid_login_attempts", "t1"."last_invalid_login", "t1"."removed_tag_expiration_s", "t1"."enabled", "t1"."invoice_email_address", "t1"."given_name", "t1"."family_name", "t1"."company", "t1"."location", "t1"."maximum_queued_builds_count", "t1"."creation_date", "t1"."last_accessed" FROM "user" AS "t1" WHERE ("t1"."username" = %s) LIMIT %s OFFSET %s', ['quayadmin', 1, 0])
      gunicorn-registry stdout | 2023-11-07 19:12:01,951 [219] [DEBUG] [data.database] Disconnecting from database.
      gunicorn-registry stdout | 2023-11-07 19:12:01,951 [219] [DEBUG] [peewee.pool] Returning 139834932261568 to pool.
      gunicorn-registry stdout | 2023-11-07 19:12:01,951 [219] [ERROR] [gunicorn.error] Error handling request /v2/auth?service=quay.apps.ocp.classroom.example.com
      gunicorn-registry stdout | Traceback (most recent call last):
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 55, in handle
      gunicorn-registry stdout |     self.handle_request(listener_name, req, client, addr)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/gunicorn/workers/ggevent.py", line 127, in handle_request
      gunicorn-registry stdout |     super().handle_request(listener_name, req, sock, addr)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 108, in handle_request
      gunicorn-registry stdout |     respiter = self.wsgi(environ, resp.start_response)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 2463, in __call__
      gunicorn-registry stdout |     return self.wsgi_app(environ, start_response)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/werkzeug/middleware/proxy_fix.py", line 169, in __call__
      gunicorn-registry stdout |     return self.app(environ, start_response)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 2449, in wsgi_app
      gunicorn-registry stdout |     response = self.handle_exception(e)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 1866, in handle_exception
      gunicorn-registry stdout |     reraise(exc_type, exc_value, tb)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
      gunicorn-registry stdout |     raise value
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 2446, in wsgi_app
      gunicorn-registry stdout |     response = self.full_dispatch_request()
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 1951, in full_dispatch_request
      gunicorn-registry stdout |     rv = self.handle_user_exception(e)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 1820, in handle_user_exception
      gunicorn-registry stdout |     reraise(exc_type, exc_value, tb)
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
      gunicorn-registry stdout |     raise value
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 1949, in full_dispatch_request
      gunicorn-registry stdout |     rv = self.dispatch_request()
      gunicorn-registry stdout |   File "/app/lib/python3.9/site-packages/flask/app.py", line 1935, in dispatch_request
      gunicorn-registry stdout |     return self.view_functions[rule.endpoint](**req.view_args)
      gunicorn-registry stdout |   File "/quay-registry/auth/decorators.py", line 70, in wrapper
      gunicorn-registry stdout |     return func(*args, **kwargs)
      gunicorn-registry stdout |   File "/quay-registry/util/cache.py", line 36, in add_no_cache
      gunicorn-registry stdout |     response = f(*args, **kwargs)
      gunicorn-registry stdout |   File "/quay-registry/endpoints/decorators.py", line 164, in wrapper
      gunicorn-registry stdout |     return func(*args, **kwargs)
      gunicorn-registry stdout |   File "/quay-registry/endpoints/v2/v2auth.py", line 156, in generate_registry_jwt
      gunicorn-registry stdout |     log_action(
      gunicorn-registry stdout |   File "/quay-registry/endpoints/api/__init__.py", line 528, in log_action
      gunicorn-registry stdout |     logs_model.log_action(
      gunicorn-registry stdout |   File "/quay-registry/data/logs_model/table_logs_model.py", line 231, in log_action
      gunicorn-registry stdout |     model.log.log_action(
      gunicorn-registry stdout |   File "/quay-registry/data/model/log.py", line 255, in log_action
      gunicorn-registry stdout |     kind = _get_log_entry_kind(kind_name)
      gunicorn-registry stdout |   File "/quay-registry/data/model/log.py", line 123, in _get_log_entry_kind
      gunicorn-registry stdout |     return kinds[name]
      gunicorn-registry stdout | KeyError: 'login_success'
      gunicorn-registry stdout | 2023-11-07 19:12:01,951 [219] [INFO] [gunicorn.access]  - - [07/Nov/2023:19:12:01 +0000] "GET /v2/auth?service=quay.apps.ocp.classroom.example.com HTTP/1.1" 500 0 "-" "-"
      

            Unassigned Unassigned
            dshoemak@redhat.com Daniel Shoemaker
            Ivan Bazulic
            Ivan Bazulic
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: