Postgres initialization fails, schema not found

I’m trying to use the gitea helm chart to install gitea using an external postgres DB, but the install seems to fail about a schema not found.

My helm values.yaml
gitea:
config:
APP_NAME: “Gitea: git.foo.dev”
database:
DB_TYPE: postgres
HOST: db1.foo.dev:5432
NAME: gitea
USER: gitea
PASSWD: myrandompassword
SCHEMA: gitea
database:
builtIn:
postgresql:
enabled: false

But when I try to install the chart, the gitea container fails:

  • gitea migrate
    2021/04/17 13:24:57 …dules/setting/git.go:91:newGit() [I] Git Version: 2.26.3, Wire Protocol Version 2 Enabled
    2021/04/17 13:24:57 cmd/migrate.go:31:runMigrate() [T] AppPath: /usr/local/bin/gitea
    2021/04/17 13:24:57 cmd/migrate.go:32:runMigrate() [T] AppWorkPath: /usr/local/bin
    2021/04/17 13:24:57 cmd/migrate.go:33:runMigrate() [T] Custom path: /data/gitea
    2021/04/17 13:24:57 cmd/migrate.go:34:runMigrate() [T] Log path: /usr/local/bin/log
    2021/04/17 13:24:57 …rm/session_schema.go:25:Ping() [I] PING DATABASE postgresschema
    2021/04/17 13:24:57 …m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT tablename FROM pg_tables WHERE schemaname = $1 AND tablename = $2 [gitea version] - 3.120479ms
    2021/04/17 13:24:57 …m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] CREATE TABLE IF NOT EXISTS “gitea”.“version” (“id” BIGSERIAL PRIMARY KEY NOT NULL, “version” BIGINT NULL) [] - 1.290791ms
    2021/04/17 13:24:57 cmd/migrate.go:38:runMigrate() [F] Failed to initialize ORM engine: migrate: sync: pq: schema “gitea” does not exist
  • gitea admin create-user --username gitea_admin --password ‘r8sA8CPHD9!bt6d’ --email gitea@local.domain --admin --must-change-password=false
    2021/04/17 13:24:57 …dules/setting/git.go:91:newGit() [I] Git Version: 2.26.3, Wire Protocol Version 2 Enabled

Am I missing something?

The schema definitely exists:
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------±-----------------±---------±--------±--------±----------------------
gitea | gitea | UTF8 | C.UTF-8 | C.UTF-8 | =Tc/gitea +
| | | | | gitea=CTc/gitea

and I’ve verified I can connect to it on that user.