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

Error in plugin-events-backend-module-github after upgrade to 1.28.2 #25350

Open
2 tasks done
xyzmurali opened this issue Jun 21, 2024 · 3 comments
Open
2 tasks done

Error in plugin-events-backend-module-github after upgrade to 1.28.2 #25350

xyzmurali opened this issue Jun 21, 2024 · 3 comments
Labels
area:events Related to the Events Project Area bug Something isn't working

Comments

@xyzmurali
Copy link

📜 Description

I submitted bug #24652 which was closed mentioned the fix will be available in version1.28.0 release. After updating to 1.28.2 release I am getting below error when starting the application using 'yarn dev'

👍 Expected behavior

Application Should start without any issues. But error occured during startup

👎 Actual Behavior with Screenshots

[1] Backend failed to start up TypeError: Cannot read properties of undefined (reading 'events')
[1] at new GithubEventRouter (/root/dell-software-studio/node_modules/@backstage/plugin-events-backend-module-github/dist/cjs/GithubEventRouter-DynNUSpO.cjs.js:22:23)
[1] at createPlugin (webpack-internal:///./src/plugins/events.ts:16:31)
[1] at main (webpack-internal:///./src/index.ts:159:96)
image

👟 Reproduction steps

Upgrade backstage to 1.28.2

📃 Provide the context for the Bug.

#24652

🖥️ Your Environment

$ backstage-cli info
OS: Linux 5.14.21-150400.24.100-default - linux/x64
node: v18.18.2
yarn: 1.22.21
cli: 0.26.9 (installed)
backstage: 1.28.2

Dependencies:
@backstage/app-defaults 1.5.6
@backstage/backend-app-api 0.7.8
@backstage/backend-common 0.21.7, 0.23.1
@backstage/backend-defaults 0.3.2
@backstage/backend-dev-utils 0.1.4
@backstage/backend-openapi-utils 0.1.13
@backstage/backend-plugin-api 0.6.20
@backstage/backend-tasks 0.5.25
@backstage/catalog-client 1.6.5
@backstage/catalog-model 1.5.0
@backstage/cli-common 0.1.14
@backstage/cli-node 0.2.6
@backstage/cli 0.26.9
@backstage/config-loader 1.8.1
@backstage/config 1.2.0
@backstage/core-app-api 1.12.6
@backstage/core-compat-api 0.2.6
@backstage/core-components 0.14.8
@backstage/core-plugin-api 1.9.3
@backstage/dev-utils 1.0.33
@backstage/e2e-test-utils 0.1.1
@backstage/errors 1.2.4
@backstage/eslint-plugin 0.1.8
@backstage/frontend-plugin-api 0.6.6
@backstage/integration-aws-node 0.1.12
@backstage/integration-react 1.1.28
@backstage/integration 1.12.0
@backstage/plugin-api-docs 0.11.6
@backstage/plugin-app-backend 0.3.69
@backstage/plugin-app-node 0.1.20
@backstage/plugin-auth-backend-module-atlassian-provider 0.2.1
@backstage/plugin-auth-backend-module-aws-alb-provider 0.1.12
@backstage/plugin-auth-backend-module-azure-easyauth-provider 0.1.3
@backstage/plugin-auth-backend-module-bitbucket-provider 0.1.3
@backstage/plugin-auth-backend-module-cloudflare-access-provider 0.1.3
@backstage/plugin-auth-backend-module-gcp-iap-provider 0.2.15
@backstage/plugin-auth-backend-module-github-provider 0.1.17
@backstage/plugin-auth-backend-module-gitlab-provider 0.1.17
@backstage/plugin-auth-backend-module-google-provider 0.1.17
@backstage/plugin-auth-backend-module-guest-provider 0.1.6
@backstage/plugin-auth-backend-module-microsoft-provider 0.1.15
@backstage/plugin-auth-backend-module-oauth2-provider 0.2.1
@backstage/plugin-auth-backend-module-oauth2-proxy-provider 0.1.13
@backstage/plugin-auth-backend-module-oidc-provider 0.2.1
@backstage/plugin-auth-backend-module-okta-provider 0.0.13
@backstage/plugin-auth-backend-module-onelogin-provider 0.1.1
@backstage/plugin-auth-backend 0.22.7
@backstage/plugin-auth-node 0.4.15
@backstage/plugin-auth-react 0.1.3
@backstage/plugin-catalog-backend-module-github 0.6.3
@backstage/plugin-catalog-backend-module-incremental-ingestion 0.4.25
@backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.1.18
@backstage/plugin-catalog-backend 1.23.1
@backstage/plugin-catalog-common 1.0.24
@backstage/plugin-catalog-graph 0.4.6
@backstage/plugin-catalog-import 0.12.0
@backstage/plugin-catalog-node 1.12.2
@backstage/plugin-catalog-react 1.12.1
@backstage/plugin-catalog 1.21.0
@backstage/plugin-events-backend-module-github 0.2.6
@backstage/plugin-events-backend 0.3.7
@backstage/plugin-events-node 0.3.6
@backstage/plugin-home-react 0.1.14
@backstage/plugin-home 0.7.5
@backstage/plugin-kubernetes-backend 0.18.1
@backstage/plugin-kubernetes-common 0.7.6, 0.8.0
@backstage/plugin-kubernetes-node 0.1.14
@backstage/plugin-kubernetes-react 0.4.0
@backstage/plugin-kubernetes 0.11.11
@backstage/plugin-org 0.6.26
@backstage/plugin-permission-backend 0.5.44
@backstage/plugin-permission-common 0.7.14
@backstage/plugin-permission-node 0.7.31
@backstage/plugin-permission-react 0.4.23
@backstage/plugin-proxy-backend 0.5.1
@backstage/plugin-scaffolder-backend-module-azure 0.1.12
@backstage/plugin-scaffolder-backend-module-bitbucket-cloud 0.1.10
@backstage/plugin-scaffolder-backend-module-bitbucket-server 0.1.10
@backstage/plugin-scaffolder-backend-module-bitbucket 0.2.10
@backstage/plugin-scaffolder-backend-module-gerrit 0.1.12
@backstage/plugin-scaffolder-backend-module-gitea 0.1.10
@backstage/plugin-scaffolder-backend-module-github 0.3.1
@backstage/plugin-scaffolder-backend-module-gitlab 0.4.2
@backstage/plugin-scaffolder-backend 1.22.10
@backstage/plugin-scaffolder-common 1.5.3
@backstage/plugin-scaffolder-node 0.4.6
@backstage/plugin-scaffolder-react 1.9.0
@backstage/plugin-scaffolder 1.21.0
@backstage/plugin-search-backend-module-catalog 0.1.26
@backstage/plugin-search-backend-module-pg 0.5.30
@backstage/plugin-search-backend-module-techdocs 0.1.25
@backstage/plugin-search-backend-node 1.2.25
@backstage/plugin-search-backend 1.5.12
@backstage/plugin-search-common 1.2.12
@backstage/plugin-search-react 1.7.12
@backstage/plugin-search 1.4.12
@backstage/plugin-signals-react 0.0.4
@backstage/plugin-techdocs-backend 1.10.7
@backstage/plugin-techdocs-module-addons-contrib 1.1.11
@backstage/plugin-techdocs-node 1.12.6
@backstage/plugin-techdocs-react 1.2.5
@backstage/plugin-techdocs 1.10.6
@backstage/plugin-user-settings-common 0.0.1
@backstage/plugin-user-settings 0.8.7
@backstage/release-manifests 0.0.11
@backstage/test-utils 1.5.6
@backstage/theme 0.5.6
@backstage/types 1.1.1
@backstage/version-bridge 1.0.8
Done in 1.07s.

👀 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?

No, but I'm happy to collaborate on a PR with someone else

@xyzmurali xyzmurali added the bug Something isn't working label Jun 21, 2024
@github-actions github-actions bot added the area:events Related to the Events Project Area label Jun 21, 2024
@freben
Copy link
Member

freben commented Jun 24, 2024

Can you run yarn tsc:full and see that you do not have any typescript errors in your code? That class expects you to pass in the events service and it seems that did not happen.

If you are on the new backend system this will happen automatically. If you are on the old backend system you may need to do this by hand.

@xyzmurali
Copy link
Author

We are using the old backend system and we did not change anything for the upgrade.
This has been working before the upgrade and no change was done except for running the "yarn backstage-cli versions:bump" and "yarn install".

Could you please let know how to pass the events service by hand. did not really understand this

@xyzmurali xyzmurali reopened this Jun 25, 2024
@xyzmurali
Copy link
Author

xyzmurali commented Jun 25, 2024

The backstage upgrade has updated this class GithubEventRouter. It has to do something with the upgrade

before backstage upgrade the class was

class GithubEventRouter extends pluginEventsNode.SubTopicEventRouter {
  constructor() {
    super("github");
  }
  determineSubTopic(params) {
    var _a;
    return (_a = params.metadata) == null ? void 0 : _a["x-github-event"];
  }
}

after upgrade it has been changed to

class GithubEventRouter extends pluginEventsNode.SubTopicEventRouter {
  constructor(options) {
    super({
      events: options.events,
      topic: "github"
    });
  }
  getSubscriberId() {
    return "GithubEventRouter";
  }
  determineSubTopic(params) {
    return params.metadata?.["x-github-event"];
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:events Related to the Events Project Area bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants