Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-2064

CRC prod instance db function permission error

    • False
    • Hide

      None

      Show
      None
    • False

      Description

      A recent migration ran ok on CRC stage but hit error on CRC prod:

      Running migrations:
        Applying ansible.0046_add_fulltext_search_fix...Traceback (most recent call last):
        File "/venv/lib64/python3.8/site-packages/django/db/backends/utils.py", line 82, in _execute
          return self.cursor.execute(sql)
      psycopg2.errors.InsufficientPrivilege: must be owner of function update_collection_ts_vector 

      Stage and prod use the user `postgres`. Running queries against stage and prod found

      Stage:

      proname                     | proowner
      ----------------------------+----------
      update_collection_ts_vector | postgres 

      Prod:

      proname                     | proowner ----------------------------+----------
      update_collection_ts_vector | galaxy_ng 

      Prod also has a mix of `tableowners` between `postgres` and `galaxy_ng`, with owner `galaxy_ng` for models with an older creation date, and `postgres` for models with a newer creation date.

      Solution

      This can likely be resolved by changing the owner of function `update_collection_ts_vector` to `postgres`

              awcrosby5 Andrew Crosby (Inactive)
              awcrosby5 Andrew Crosby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: