Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin rbac-backend Fails to Initialize after upgrading to version > 5.0.0 #2461

Closed
rodwill opened this issue Oct 30, 2024 · 2 comments
Closed
Labels

Comments

@rodwill
Copy link

rodwill commented Oct 30, 2024

Issue: Plugin rbac-backend Fails to Initialize after upgrading to version > 5.0.0

Description:
When attempting to initialize the rbac-backend plugin in Backstage, an error is encountered, preventing the plugin from starting properly. This issue occurs consistently, but only after the second execution of the Backstage.

Steps to Reproduce:

  1. Set up a fresh instance of Backstage with a local PostgreSQL database.
  2. Install the rbac-backend plugin following the official installation guidelines.
  3. Start Backstage backend for the first time (no errors occur).
  4. Stop the Backstage backend service.
  5. Start Backstage backend for the second time.

Expected Behavior:
The rbac-backend plugin should initialize without errors in all executions, allowing it to function as intended within Backstage.

Actual Behavior:
An error is thrown during the initialization process, preventing the rbac-backend plugin from starting. The following error message is displayed:

backstage error Plugin 'permission' thew an error during startup type=initialization
.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:334
              throw new ForwardedError(
                    ^


ForwardedError: Plugin 'permission' startup failed; caused by Error: Failed to store policies [[role:default/rbac_admin, policy-entity, read, allow],[role:default/rbac_admin, policy-entity, create, allow],[role:default/rbac_admin, policy-entity, delete, allow],[role:default/rbac_admin, policy-entity, update, allow],[role:default/rbac_admin, catalog-entity, read, allow]]
    at <anonymous> (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:334:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async <anonymous> (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:333:13)
    ... 3 lines matching cause stack trace ...
    at async BackstageBackend.start (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackstageBackend.ts:38:11) {
  cause: Error: Failed to store policies [[role:default/rbac_admin, policy-entity, read, allow],[role:default/rbac_admin, policy-entity, create, allow],[role:default/rbac_admin, policy-entity, delete, allow],[role:default/rbac_admin, policy-entity, update, allow],[role:default/rbac_admin, catalog-entity, read, allow]]
      at EnforcerDelegate.addPolicies (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\service\enforcer-delegate.ts:109:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async addAdminPermissions (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\admin-permissions\admin-creation.ts:125:9)
      at async setAdminPermissions (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\admin-permissions\admin-creation.ts:149:9)
      at async Function.build (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\policies\permission-policy.ts:108:11)
      at async Function.build (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\service\policy-builder.ts:152:16)
      at async Object.init (.\backstage\node_modules\@janus-idp\backstage-plugin-rbac-backend\src\plugin.ts:71:11)
      at async <anonymous> (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:333:13)
      at async Promise.allSettled (index 6)
      at async BackendInitializer.#doStart (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:278:21)
      at async BackendInitializer.start (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackendInitializer.ts:187:5)
      at async BackstageBackend.start (.\backstage\node_modules\@backstage\backend-app-api\src\wiring\BackstageBackend.ts:38:11)
}

Versions of software used and environment
Backstage v1.32.4
Node v20.18.0
@janus-idp/backstage-plugin-rbac-backend: "^5.1.2",

@github-actions github-actions bot added the jira label Oct 30, 2024
@luccasmtxr
Copy link

I am having the exact same problem. Same versions as well.

@rodwill rodwill closed this as completed Nov 1, 2024
@rodwill
Copy link
Author

rodwill commented Nov 1, 2024

Good news: version released with fix: v5.2.1 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants