Skip to content

🐛 RBAC: Incompatible with Backstage 1.47 (FetchUrlReader constructor is now private) #7362

@wingleung

Description

@wingleung

Workspace

rbac

📜 Description

The RBAC backend plugin fails to start with Backstage 1.47.x due to a breaking change in @backstage/[email protected] where the FetchUrlReader constructor was made private.

👍 Expected behavior

The RBAC backend plugin should start successfully with Backstage 1.47.x.

👎 Actual Behavior with Screenshots

The backend fails to start with the following error:

TypeError: Cannot read properties of undefined (reading 'predicate')                                                                                                                                             
  at new FetchUrlReader (.../node_modules/@backstage-community/plugin-rbac-backend/node_modules/@backstage/backend-defaults/src/entrypoints/urlReader/lib/FetchUrlReader.ts:135:31)                            
  at permissionFactory (.../node_modules/@backstage-community/plugin-rbac-backend/src/service/plugin-endpoints.ts:125:23)  

👟 Reproduction steps

  1. Upgrade Backstage to 1.47.x using yarn backstage-cli versions:bump
  2. Ensure @backstage-community/plugin-rbac-backend@^7.6.1 is installed
  3. Run yarn start or yarn dev
  4. Backend fails during RBAC plugin initialization

📃 Provide the context for the Bug.

In @backstage/[email protected], the FetchUrlReader constructor was made private. The changelog states:

27f9061: BREAKING: The constructor for FetchUrlReader is now private. If you have to construct an instance of it, please use FetchUrlReader.fromConfig instead.

The RBAC plugin still uses the old pattern in plugin-endpoints.ts:

private static permissionFactory: ReaderFactory = () => {
  return [{ reader: new FetchUrlReader(), predicate: (_url: URL) => true }];
};

Suggested fix: Update to use FetchUrlReader.fromConfig(config) instead of new FetchUrlReader().

Versions

  • Backstage: 1.47.2
  • @backstage-community/plugin-rbac-backend: 7.6.1
  • @backstage/backend-defaults: 0.15.1

Workaround

Downgrade to Backstage 1.46.x which uses @backstage/[email protected].

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions