Skip to content

Conversation

@rm3l
Copy link
Member

@rm3l rm3l commented Jan 10, 2026

Description

This extracts the catalog entities from the index image to a temporary directory instead by default, unless CATALOG_ENTITIES_EXTRACT_DIR is set.

This is an addendum to #3970.

Which issue(s) does this PR fix

Otherwise, RHDH fails to start because it tries to load this folder as a dynamic-plugin:

2026-01-10T13:05:04.084Z backstage error Plugin 'catalog' threw an error during startup, waiting for 15 other plugins to finish before shutting down the process. Failed to instantiate service 'core.httpRouter' for 'catalog' because the factory function threw an error, Error: Failed to instantiate service 'core.auth' for 'catalog' because the factory function threw an error, error: create table "backstage_backend_public_keys__knex_migrations_lock" ("index" serial primary key, "is_locked" integer) - relation "backstage_backend_public_keys__knex_migrations_lock" already exists type="initialization" stack="Error: Failed to instantiate service 'core.httpRouter' for 'catalog' because the factory function threw an error, Error: Failed to instantiate service 'core.auth' for 'catalog' because the factory function threw an error, error: create table \"backstage_backend_public_keys__knex_migrations_lock\" (\"index\" serial primary key, \"is_locked\" integer) - relation \"
failed to load dynamic plugin manifest from '/opt/app-root/src/dynamic-plugins-root/extensions' Error: ENOENT: no such file or directory, open '/opt/app-root/src/dynamic-plugins-root/extensions/package.json'
    at async open (node:internal/fs/promises:641:25)
    at async Object.readFile (node:internal/fs/promises:1245:14)
    at async PluginScanner.scanDir (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/scanner/plugin-scanner.cjs.js:170:21)
    at async PluginScanner.scanRoot (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/scanner/plugin-scanner.cjs.js:146:25)
    at async Object.addDynamicPluginsSchemas (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/schemas/schemas.cjs.js:63:32)
    at async Object.init [as func] (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/schemas/frontend.cjs.js:23:14)
    at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:284:19
    at async processNode (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:181:22)
    at async Promise.all (index 0)
    at async processMoreNodes (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:176:7)
    at async DependencyGraph.parallelTopologicalTraversal (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:195:5)
    at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:271:13
    at async Promise.allSettled (index 1)
    at async #doStart (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:242:21)
    at async BackendInitializer.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:160:5)
    at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackstageBackend.cjs.js:19:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/opt/app-root/src/dynamic-plugins-root/extensions/package.json'
}

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

…amic-plugins-root` by default

Extract to temporary directory instead, unless
`CATALOG_ENTITIES_EXTRACT_DIR` is set.
Otherwise, this causes issues when starting RHDH, which tries to load
this folder as a dynamic-plugin:

```
2026-01-10T13:05:04.084Z backstage error Plugin 'catalog' threw an error during startup, waiting for 15 other plugins to finish before shutting down the process. Failed to instantiate service 'core.httpRouter' for 'catalog' because the factory function threw an error, Error: Failed to instantiate service 'core.auth' for 'catalog' because the factory function threw an error, error: create table "backstage_backend_public_keys__knex_migrations_lock" ("index" serial primary key, "is_locked" integer) - relation "backstage_backend_public_keys__knex_migrations_lock" already exists type="initialization" stack="Error: Failed to instantiate service 'core.httpRouter' for 'catalog' because the factory function threw an error, Error: Failed to instantiate service 'core.auth' for 'catalog' because the factory function threw an error, error: create table \"backstage_backend_public_keys__knex_migrations_lock\" (\"index\" serial primary key, \"is_locked\" integer) - relation \"
failed to load dynamic plugin manifest from '/opt/app-root/src/dynamic-plugins-root/extensions' Error: ENOENT: no such file or directory, open '/opt/app-root/src/dynamic-plugins-root/extensions/package.json'
    at async open (node:internal/fs/promises:641:25)
    at async Object.readFile (node:internal/fs/promises:1245:14)
    at async PluginScanner.scanDir (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/scanner/plugin-scanner.cjs.js:170:21)
    at async PluginScanner.scanRoot (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/scanner/plugin-scanner.cjs.js:146:25)
    at async Object.addDynamicPluginsSchemas (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/schemas/schemas.cjs.js:63:32)
    at async Object.init [as func] (/opt/app-root/src/node_modules/@backstage/backend-dynamic-feature-service/dist/schemas/frontend.cjs.js:23:14)
    at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:284:19
    at async processNode (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:181:22)
    at async Promise.all (index 0)
    at async processMoreNodes (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:176:7)
    at async DependencyGraph.parallelTopologicalTraversal (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:195:5)
    at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:271:13
    at async Promise.allSettled (index 1)
    at async #doStart (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:242:21)
    at async BackendInitializer.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:160:5)
    at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/wiring/BackstageBackend.cjs.js:19:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/opt/app-root/src/dynamic-plugins-root/extensions/package.json'
}
```
@rm3l rm3l force-pushed the fix/do_not_extract_catalog_entities_to_dynamic-plugins-root_by_default branch from eb5ecf3 to 3375186 Compare January 10, 2026 14:09
@sonarqubecloud
Copy link

Copy link
Member

@nickboldt nickboldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jan 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nickboldt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Contributor

The image is available at:

/test e2e-ocp-helm

@openshift-merge-bot openshift-merge-bot bot merged commit c8159bc into redhat-developer:main Jan 10, 2026
21 checks passed
@rm3l rm3l deleted the fix/do_not_extract_catalog_entities_to_dynamic-plugins-root_by_default branch January 10, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants