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

🐛 Bug Report: Scaffolder actions required for demo template is not installed by create-app #27564

Open
2 tasks done
ajay-shenoy opened this issue Nov 8, 2024 · 8 comments · May be fixed by #27983
Open
2 tasks done
Labels
area:scaffolder Everything and all things related to the scaffolder project area bug Something isn't working help wanted Help/Contributions wanted from community members

Comments

@ajay-shenoy
Copy link

📜 Description

Trying to run the default Node.js template.

Getting Error as Error as:

NotFoundError
Message: Template action with ID 'publish:github' is not registered.

OS: Linux 6.8.0-48-generic - linux/x64
node: v20.18.0
yarn: 4.4.1
cli: 0.28.2 (installed)
backstage: 1.32.0

Dependencies:
@backstage/app-defaults 1.5.12
@backstage/backend-app-api 1.0.1
@backstage/backend-common 0.25.0
@backstage/backend-defaults 0.5.2
@backstage/backend-dev-utils 0.1.5
@backstage/backend-openapi-utils 0.2.0
@backstage/backend-plugin-api 1.0.1
@backstage/catalog-client 1.7.1
@backstage/catalog-model 1.7.0
@backstage/cli-common 0.1.14
@backstage/cli-node 0.2.9
@backstage/cli 0.28.2
@backstage/config-loader 1.9.1
@backstage/config 1.2.0
@backstage/core-app-api 1.15.1
@backstage/core-compat-api 0.3.1
@backstage/core-components 0.15.1
@backstage/core-plugin-api 1.10.0
@backstage/e2e-test-utils 0.1.1
@backstage/errors 1.2.4
@backstage/eslint-plugin 0.1.10
@backstage/frontend-app-api 0.10.0
@backstage/frontend-defaults 0.1.1
@backstage/frontend-plugin-api 0.9.0
@backstage/frontend-test-utils 0.2.1
@backstage/integration-aws-node 0.1.12
@backstage/integration-react 1.2.0
@backstage/integration 1.15.1
@backstage/plugin-api-docs 0.11.11
@backstage/plugin-app-backend 0.3.76
@backstage/plugin-app-node 0.1.26
@backstage/plugin-app 0.1.1
@backstage/plugin-auth-backend-module-atlassian-provider 0.3.1
@backstage/plugin-auth-backend-module-auth0-provider 0.1.1
@backstage/plugin-auth-backend-module-aws-alb-provider 0.2.1
@backstage/plugin-auth-backend-module-azure-easyauth-provider 0.2.1
@backstage/plugin-auth-backend-module-bitbucket-provider 0.2.1
@backstage/plugin-auth-backend-module-bitbucket-server-provider 0.1.1
@backstage/plugin-auth-backend-module-cloudflare-access-provider 0.3.1
@backstage/plugin-auth-backend-module-gcp-iap-provider 0.3.1
@backstage/plugin-auth-backend-module-github-provider 0.2.1
@backstage/plugin-auth-backend-module-gitlab-provider 0.2.1
@backstage/plugin-auth-backend-module-google-provider 0.2.1
@backstage/plugin-auth-backend-module-guest-provider 0.2.1
@backstage/plugin-auth-backend-module-microsoft-provider 0.2.1
@backstage/plugin-auth-backend-module-oauth2-provider 0.3.1
@backstage/plugin-auth-backend-module-oauth2-proxy-provider 0.2.1
@backstage/plugin-auth-backend-module-oidc-provider 0.3.1
@backstage/plugin-auth-backend-module-okta-provider 0.1.1
@backstage/plugin-auth-backend-module-onelogin-provider 0.2.1
@backstage/plugin-auth-backend 0.23.1
@backstage/plugin-auth-node 0.5.3
@backstage/plugin-auth-react 0.1.7
@backstage/plugin-bitbucket-cloud-common 0.2.24
@backstage/plugin-catalog-backend-module-logs 0.1.3
@backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.2.1
@backstage/plugin-catalog-backend 1.27.1
@backstage/plugin-catalog-common 1.1.0
@backstage/plugin-catalog-graph 0.4.11
@backstage/plugin-catalog-import 0.12.5
@backstage/plugin-catalog-node 1.13.1
@backstage/plugin-catalog-react 1.14.0
@backstage/plugin-catalog 1.24.0
@backstage/plugin-events-node 0.4.4
@backstage/plugin-kubernetes-backend 0.18.7
@backstage/plugin-kubernetes-common 0.8.3
@backstage/plugin-kubernetes-node 0.1.20
@backstage/plugin-kubernetes-react 0.4.4
@backstage/plugin-kubernetes 0.11.16
@backstage/plugin-org 0.6.31
@backstage/plugin-permission-backend-module-allow-all-policy 0.2.1
@backstage/plugin-permission-backend 0.5.50
@backstage/plugin-permission-common 0.8.1
@backstage/plugin-permission-node 0.8.4
@backstage/plugin-permission-react 0.4.27
@backstage/plugin-proxy-backend 0.5.7
@backstage/plugin-scaffolder-backend-module-azure 0.2.1
@backstage/plugin-scaffolder-backend-module-bitbucket-cloud 0.2.1
@backstage/plugin-scaffolder-backend-module-bitbucket-server 0.2.1
@backstage/plugin-scaffolder-backend-module-bitbucket 0.3.1
@backstage/plugin-scaffolder-backend-module-gerrit 0.2.1
@backstage/plugin-scaffolder-backend-module-gitea 0.2.1
@backstage/plugin-scaffolder-backend-module-github 0.5.1
@backstage/plugin-scaffolder-backend-module-gitlab 0.6.0
@backstage/plugin-scaffolder-backend 1.26.2
@backstage/plugin-scaffolder-common 1.5.6
@backstage/plugin-scaffolder-node 0.5.0
@backstage/plugin-scaffolder-react 1.13.2
@backstage/plugin-scaffolder 1.26.2
@backstage/plugin-search-backend-module-catalog 0.2.4
@backstage/plugin-search-backend-module-pg 0.5.37
@backstage/plugin-search-backend-module-techdocs 0.3.1
@backstage/plugin-search-backend-node 1.3.4
@backstage/plugin-search-backend 1.6.1
@backstage/plugin-search-common 1.2.14
@backstage/plugin-search-react 1.8.1
@backstage/plugin-search 1.4.18
@backstage/plugin-signals-react 0.0.6
@backstage/plugin-techdocs-backend 1.11.1
@backstage/plugin-techdocs-common 0.1.0
@backstage/plugin-techdocs-module-addons-contrib 1.1.16
@backstage/plugin-techdocs-node 1.12.12
@backstage/plugin-techdocs-react 1.2.9
@backstage/plugin-techdocs 1.11.0
@backstage/plugin-user-settings-common 0.0.1
@backstage/plugin-user-settings 0.8.14
@backstage/release-manifests 0.0.11
@backstage/test-utils 1.7.0
@backstage/theme 0.6.0
@backstage/types 1.1.1
@backstage/version-bridge 1.0.10

👍 Expected behavior

The Template should have pushed a Nodejs bolierplate to Github

👎 Actual Behavior with Screenshots

Screenshot from 2024-11-09 02-24-48

👟 Reproduction steps

  1. Go to Create
  2. Use the default Nodejs template

📃 Provide the context for the Bug.

No response

🖥️ Your Environment

No response

👀 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

@ajay-shenoy ajay-shenoy added the bug Something isn't working label Nov 8, 2024
@jhaals
Copy link
Member

jhaals commented Nov 11, 2024

You can see your installed actions if you go to /create/actions but I'm assuming that @backstage/plugin-scaffolder-backend-module-github is not added to your index.ts for the backend and that's why you don't have that action installed. This should really be part of the create-app template that you ran.

Add it to your package.json and the following line to your backend index.ts

backend.add(import('@backstage/plugin-scaffolder-backend-module-github'));

@jhaals jhaals changed the title 🐛 Bug Report:Template action with ID 'publish:github' is not registered. 🐛 Bug Report: Scaffolder actions required for demo template is not installed by create-app Nov 11, 2024
@jhaals jhaals added area:scaffolder Everything and all things related to the scaffolder project area help wanted Help/Contributions wanted from community members labels Nov 11, 2024
@jescalada
Copy link
Contributor

@jhaals I had this same problem when using the demo template out of the box (and was quite confusing to deal with as a new user). Is there a reason why @backstage/plugin-scaffolder-backend-module-github is not available by default? Other than perhaps the credentials having to be set up.

Alternatively, it might be helpful to display a link to the relevant doc (GitHub provider setup) instead of the current error which could lead to more issues like these being opened in the future :)

@benjdlambert
Copy link
Member

This has been broken for while. Unfortunately because of the new backend system not coming pre-installed with the deps, although the package is installed for legacy reasons using the scaffolder-backend package.

@jescalada @ajay-shenoy would either of you like to go and add this to the create-app template? 🙏

@jescalada
Copy link
Contributor

jescalada commented Nov 30, 2024

Hi @benjdlambert, thank you for the response! :)

I'm happy to make a PR for it. Though, I'm unsure if simply adding the GitHub module import to the create-app is enough to get everything to work out of the box. When I first played around with it, I got the GitHub publish to work by installing it to the backend module, and then adding these two lines to the /backend/src/index.ts:

backend.add(import('@backstage/plugin-scaffolder-backend-module-github'));
backend.add(import('@backstage/plugin-auth-backend-module-github-provider'));

Then, I added the GitHub provider to the SignInPage to actually log in.

    SignInPage: props => (
      <SignInPage
        {...props}
        auto
        provider={{
          id: 'github-auth-provider',
          title: 'GitHub',
          message: 'Sign in using GitHub',
          apiRef: githubAuthApiRef,
        }}
      />
    ),

From the perspective of a brand new user who gets started through create-app, it was a bit confusing to get that "Message: Template action with ID 'publish:github' is not registered." error (although digging into the docs helped me fix it).

Is there a simple way to get it working out of the box? We might need the GitHub signup available by default and improve the error message to spell things out for new users in a hurry 🙂

@acierto
Copy link
Contributor

acierto commented Nov 30, 2024

Indeed. It’s always nice to include into the error message whenever it possible how to solve it. This is a perfect example where the actionable message can help.

@benjdlambert
Copy link
Member

Think that just adding the module and adding it to the backend typescript should be enough. The GitHub auth shouldn't be needed if it's configured in integrations config, which I believe there's a message for when it can't find a token.

@acierto
Copy link
Contributor

acierto commented Dec 2, 2024

What can be beneficial when the plugin is not registered, on top of stating the problem
Template action with ID '${actionId}' is not registered.

Also include the recipe how to fix it.
It might be something like
Template action with ID '${actionId}' is not registered. Make sure that you have added plugin "backend.add(import('@backstage/plugin-${XXX}-backend'));" in your backend/index.ts.
And/or pointing to the doc page: https://backstage.io/docs/features/software-templates/builtin-actions

It will reduce the troubleshooting time for new joiners. And it's quite common practice in other frameworks too, like eslint, react, etc.

@jescalada jescalada linked a pull request Dec 4, 2024 that will close this issue
5 tasks
@jescalada
Copy link
Contributor

Thank you very much for all the advice! 😃

I got a PR out based on your suggestions, let me know your thoughts!

I did some manual testing with create-app to see what exactly new users would see when reproducing the steps above. They would still need to set up their GitHub credentials, so I pointed them to the docs in that case too.

Also, had a few issues with the CI/tests as the module needed to get the updated versioning from somewhere, but fortunately, it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area bug Something isn't working help wanted Help/Contributions wanted from community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants