Error with backstage with single postgres database and schemas
See original GitHub issueHello, we are having an issue.
We have a database named “backstage_db” without access to “postgres” database in GCP.
And we also need to use pluginDivisionMode: schema and not create new databases.
Our app-config.yaml is following:
database:
# config options: https://node-postgres.com/api/client
client: pg
connection:
host: db
port: 5432
user: backstage_user
password: backstage_password
database: backstage_db
ensureExists: false
pluginDivisionMode: schema
plugin:
catalog:
connection:
database: backstage_db
auth:
connection:
database: backstage_db
app:
connection:
database: backstage_db
scaffolder:
connection:
database: backstage_db
Backstage seems to connect to the database but is probably not creating schemas in our database and we are getting the error:
Backend failed to start up, Error: Failed to connect to the database to make sure that schema for plugin ‘scaffolder’ exists, KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
Thanks for any help.
Expected Behavior
Backstage should create schemas in our DB
Steps to Reproduce
It works locally, in a docker container, but in the GCP cluster it seems to have a problem.
Context
We tried different versions of backstage, currenlty on "version": "1.2.0-next.2".
The app is running in a docker container.
Even the local instance of backstage is running without the “postgres” database.
Your Environment
- Local output of
yarn backstage-cli info:
OS: Linux 5.14.18-100.fc33.x86_64 - linux/x64
node: v16.14.0
yarn: 1.22.17
cli: 0.17.1-next.2 (installed)
Dependencies:
@backstage/app-defaults 1.0.2-next.0
@backstage/backend-common 0.13.3-next.2
@backstage/backend-tasks 0.3.1-next.1
@backstage/catalog-client 1.0.2-next.0
@backstage/catalog-model 1.0.2-next.0
@backstage/cli-common 0.1.9-next.0
@backstage/cli 0.17.1-next.2
@backstage/config-loader 1.1.1-next.1
@backstage/config 1.0.1-next.0
@backstage/core-app-api 1.0.2-next.1
@backstage/core-components 0.9.4-next.1
@backstage/core-plugin-api 1.0.2-next.1
@backstage/errors 1.0.0
@backstage/integration-react 1.1.0-next.2
@backstage/integration 1.2.0-next.1
@backstage/plugin-api-docs 0.8.5-next.2
@backstage/plugin-app-backend 0.3.32-next.1
@backstage/plugin-auth-backend 0.13.1-next.2
@backstage/plugin-auth-node 0.2.1-next.1
@backstage/plugin-catalog-backend 1.1.2-next.2
@backstage/plugin-catalog-common 1.0.2-next.0
@backstage/plugin-catalog-graph 0.2.17-next.2
@backstage/plugin-catalog-import 0.8.8-next.2
@backstage/plugin-catalog-react 1.1.0-next.2
@backstage/plugin-catalog 1.2.0-next.2
@backstage/plugin-github-actions 0.5.5-next.2
@backstage/plugin-org 0.5.5-next.2
@backstage/plugin-permission-common 0.6.1-next.0
@backstage/plugin-permission-node 0.6.1-next.1
@backstage/plugin-permission-react 0.4.1-next.1
@backstage/plugin-proxy-backend 0.2.26-next.1
@backstage/plugin-scaffolder-backend 1.2.0-next.1
@backstage/plugin-scaffolder-common 1.1.0-next.0
@backstage/plugin-scaffolder 1.2.0-next.2
@backstage/plugin-search-backend-module-pg 0.3.3-next.1
@backstage/plugin-search-backend-node 0.6.1-next.1
@backstage/plugin-search-backend 0.5.2-next.1
@backstage/plugin-search-common 0.3.4-next.0
@backstage/plugin-search-react 0.2.0-next.2
@backstage/plugin-search 0.8.1-next.2
@backstage/plugin-tech-radar 0.5.12-next.0
@backstage/plugin-techdocs-backend 1.1.1-next.1
@backstage/plugin-techdocs-node 1.1.1-next.1
@backstage/plugin-techdocs-react 0.1.1-next.2
@backstage/plugin-techdocs 1.1.1-next.2
@backstage/plugin-user-settings 0.4.4-next.0
@backstage/release-manifests 0.0.3-next.0
@backstage/search-common 0.3.4-next.0
@backstage/test-utils 1.1.0-next.2
@backstage/theme 0.2.15
@backstage/types 1.0.0
@backstage/version-bridge 1.0.1
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Related StackOverflow Question
@Hanyman8 Hey, I’m having the same issue as you. Can you by any chance give more info about how you changed the connection pool from session to transaction? Thanks
Hello, we changed our connection pool (switched from session to transaction and updated connection pool) and it is working now, thanks