Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

make compose-test - error: CREATE DATABASE "backstage_plugin_app" - permission denied to create database #74

@mathieu-benoit

Description

@mathieu-benoit

To continue with #73, we need to fix the issue below:

When running the Backstage container (make compose-test), permission denied to create the backstage_plugin_app:

...
[+] Running 5/5
 ✔ Container backstage-pg-HFeITA-1            Healthy                                                                                                                                                                                                                                             1.3s 
 ✔ Container backstage-routing-UghS7c-1       Running                                                                                                                                                                                                                                             0.0s 
 ✔ Container backstage-pg-HFeITA-init-1       Exited                                                                                                                                                                                                                                              1.3s 
 ✔ Container backstage-wait-for-resources-1   Exited                                                                                                                                                                                                                                              2.0s 
 ✔ Container backstage-backstage-backstage-1  Started

But the Backstage container will fail at runtime with this error as it needs to create a database:

Loading config from MergedConfigSource{FileConfigSource{path="/app/app-config.yaml"}, FileConfigSource{path="/app/app-config.production.yaml"}, EnvConfigSource{count=3}}
{"level":"info","message":"Found 1 new secrets in config that will be redacted","service":"backstage"}
{"level":"info","message":"Listening on :7007","service":"rootHttpRouter"}
{"level":"info","message":"Plugin initialization started: 'app', 'proxy', 'techdocs', 'auth', 'catalog', 'permission', 'search', 'scaffolder', 'humanitec'","service":"backstage","type":"initialization"}
{"level":"error","message":"Plugin 'app' thew an error during startup, waiting for 8 other plugins to finish before shutting down the process","service":"backstage","type":"initialization"}
/app/node_modules/@backstage/backend-defaults/dist/entrypoints/database/connectors/postgres.cjs.js:143
        throw new Error(
              ^

Error: Failed to connect to the database to make sure that 'backstage_plugin_app' exists, error: CREATE DATABASE "backstage_plugin_app" - permission denied to create database
    at PgConnector.getClient (/app/node_modules/@backstage/backend-defaults/dist/entrypoints/database/connectors/postgres.cjs.js:143:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.18.1

Need to implement this score-spec/score-compose#219.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions