NixOS / NixOS/hydra

hydra-init fails because: permission denied to create extension "pg_trgm"

Open
#660 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PLpgSQL
Stars
1.6k
Forks
358
Avg merge
20h 30m
Merged PRs (30d)
27

Description

@nlewo after upgrading hydra to the latest master (c85bf668e6868148c9a1adc4f9fe2b0f43ea66bc) I get the following error when starting hydra:

Jun 25 11:57:16 hydra systemd[1]: Starting hydra-init.service...
Jun 25 11:57:17 hydra hydra-init[19351]: upgrading Hydra schema from version 56 to 57
Jun 25 11:57:17 hydra hydra-init[19351]: executing SQL statement: CREATE EXTENSION pg_trgm
Jun 25 11:57:17 hydra hydra-init[19351]: schema upgrade failed: main::run_(): DBI Exception: DBD::Pg::db do failed: ERROR:  permission denied to create extension "pg_trgm"
Jun 25 11:57:17 hydra hydra-init[19351]: HINT:  Must be superuser to create this extension. at /nix/store/0mgikix3jzg1971yndzsjqqgzfjwbv75-hydra-0.1.2544.c85bf6/bin/.hydra-init-wrapped line 59
Jun 25 11:57:17 hydra systemd[1]: hydra-init.service: Main process exited, code=exited, status=255/n/a
Jun 25 11:57:17 hydra systemd[1]: hydra-init.service: Failed with result 'exit-code'.
Jun 25 11:57:17 hydra systemd[1]: Failed to start hydra-init.service.

I see the pg_trgm PostgreSQL extension was added in: https://github.com/NixOS/hydra/commit/7935cffd6b14a0861489c32ba091cff7f75d818a.

Does the hydra NixOS module need to be updated to make this work?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Hydra NixOS module and the schema upgrade associated with version 56 to 57, focusing on the CREATE EXTENSION pg_trgm statement shown in the report. Check how the module provisions PostgreSQL permissions and verify the upgrade path for a non-superuser; done means hydra-init completes without the permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.