Project

General

Profile

Actions

Bug #22840

closed

db:structure:dump protections in services/api/Rakefile stopped working

Added by Tom Clegg 11 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
-
Release relationship:
Auto

Description

In #5677 we started commenting out the "COMMENT ON EXTENSION" bit added by Rails after applying a migration:

--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';

But this seems to have stopped working. 30cd7edac00dce5b683b20f4060448476474a1b5 committed this (uncommented) and this causes test-provision jobs to fail.

test-provision-debian12: #331 /consoleText at 0621f5ee12df1776bc22abcf770b8f6c662394c2

psql:/var/www/arvados-api/current/db/structure.sql:27: ERROR:  must be owner of extension pg_trgm
rake aborted!
failed to execute:
psql --set ON_ERROR_STOP=1 --quiet --no-psqlrc --output /dev/null --file /var/www/arvados-api/current/db/structure.sql dbn12_arvados

Subtasks 1 (0 open1 closed)

Task #22842: Review 22840-structure-sqlResolvedPeter Amstutz05/01/2025Actions

Related issues 1 (0 open1 closed)

Related to Arvados - Bug #5677: [API] Silence harmless message "ERROR: must be owner of extension plpgsql"ResolvedTom CleggActions
Actions #1

Updated by Tom Clegg 11 months ago

  • Related to Bug #5677: [API] Silence harmless message "ERROR: must be owner of extension plpgsql" added
Actions #2

Updated by Peter Amstutz 11 months ago

Oh, interesting. I just committed a fix with a note but actually we had code in place that used to make sure this wouldn't happen but somewhere along the line of Rails upgrades it maybe stopped working?

Actions #3

Updated by Tom Clegg 11 months ago

Our hook stopped working because Rails 6.1 started calling it db:schema:dump instead of db:structure:dump.

https://github.com/rails/rails/pull/39470

Fix:

22840-structure-sql @ f02dd5fb44664d24613a9b8ad845f013b553cb92 -- developer-run-tests: #4757

This also re-orders the tables in structure.sql to lexical order. I don't know why 30cd7edac00dce5b683b20f4060448476474a1b5 moved "groups" to the top, but when I run "migrate" to dump the schema, I still get lexical order...

Actions #4

Updated by Tom Clegg 11 months ago

  • Target version set to Development 2025-05-14
Actions #5

Updated by Tom Clegg 11 months ago

  • Subtask #22842 added
Actions #6

Updated by Peter Amstutz 11 months ago

I don't know either, it kept wanting to move groups to the top so I included it in the commit, but it wasn't necessary for anything.

It was developed using Postgresql 13 on Debian 11 (inside Arvbox). I'm guessing newer Postgresql behaves a bit differently, hopefully better.

Actions #7

Updated by Peter Amstutz 11 months ago

The fix itself looks fine but there's an unfortunate test failure, flaky test?

Actions #8

Updated by Tom Clegg 11 months ago

  • Status changed from In Progress to Resolved
Actions #9

Updated by Brett Smith 6 months ago

  • Release set to 79
Actions #10

Updated by Brett Smith 6 months ago

  • Category set to API
Actions

Also available in: Atom PDF