#Issue with configuring GitHub Org Discovery in Backstage 1.25.0

21 messages · Page 1 of 1 (latest)

lone tapir
#

Hello, I'm setting up the GitHub org discovery in Backstage version 1.25.0 following the migration guide but I'm encountering errors related to the GithubOrgReaderProcessor.

Error:
ForwardedError: Plugin 'catalog' startup failed; caused by Error: Your config contains a "catalog.locations" entry of type github-org, but does not have the corresponding catalog processor GithubOrgReaderProcessor installed. This processor used to be built into the catalog itself, but is now moved to an external module that has to be installed manually.

Despite following the instructions and installing the necessary plugins as shown below, I still get the error.

Installation steps I followed:

yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-github-org yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-github

Relevant part of the app-config.yaml:

catalog: import: entityFilename: catalog-info.yaml pullRequestBranchName: backstage-integration rules: - allow: [Component, System, API, Resource, Location] locations: - type: github-org target: https://github.com/<our-org-name>

And in index.ts:

backend.add(import('@backstage/plugin-catalog-backend-module-github-org'));
backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha'));```

Has anyone faced similar issues, or can spot what might be missing or misconfigured in my setup?
round wadi
#

I'm on mobile now but this has been reported a couple of times and there's some issue for it on github

#

It sure is unfortunate and needs a fix one way or the other

cobalt cargo
#

Ugh, they double posted: #1227601713633034250 message

#

@round wadi, isn't it due to the fact they have the locations config? I could be wrong though. The issue I've seen a bunch is where the org is or isn't in the namespace.

round wadi
#

Ah I posted the wrong thing myself! Was going for a discussion about the org provider namespace problem

lone tapir
#

Hey @cobalt cargo and @round wadi ,
I'm sorry for the inconvenience. Let's continue in this thread so someone will be able to find it in the future if needed.
I've removed the following lines from the app-config, as you mentioned:

    - type: github-org
      target: https://github.com/<our-org-name>
      rules:
        - allow: [User, Group]```
My integrations config now looks like this:

integrations:
github:
- host: github.com
token: <GH_TOKEN>

Authentication is configured through the GH OAuth app.
Is it enough to ingest Users and Groups from GH?
#

The token is created for the machine user that is already in our GitHub organization. The scope of the token includes:
backstage-token — read:org, read:user, repo, user:email, workflow

lone tapir
#

bump

lone tapir
#

bump @round wadi @cobalt cargo would you be able to help me here?

lone tapir
#

I did some changes in the app-config

  providers:
    github:
      providerMain:
        organization: 'XXX' 
        catalogPath: '/catalog-info.yaml'
        filters:
          branch: 'main' 
          repository: '.*'
        schedule: 
          frequency: { minutes: 30 }
          timeout: { minutes: 3 }```
Still doesn't work ```Login failed; caused by Error: Failed to sign-in, unable to resolve user identity```
mystic egret
#

hi all! I'm also facing the same issue with Github Org discovery

cobalt cargo
#

Hi @lone tapir, I've returned to using office hours (see my profile for details) but what is your end goal? The GitHub provider will only craw your repos looking for catalog-info.yaml files, it's not what drives sign-in. The config you shared for the provider looks good to me though. The permissions for the token seem right, I've always used a GitHub App myself but the list of needed permissions would be the same - https://backstage.io/docs/integrations/github/github-apps#app-permissions - but I would note that "Commit statuses: Read-only" is needed by more then just Software Templates, that should be moved up on this list.

lone tapir
#

Hey @cobalt cargo, thanks for letting me know.
My end goal is to import Users and Groups from an external source like GitHub Org Data, rather than relying on a static YAML file with manually imported usernames.

cobalt cargo
#

Ok, then my comments should help to that end. Are you still having errors logging in?

lone tapir
#

yes, still the same - "Login failed; caused by Error: Failed to sign-in, unable to resolve user identity"

cobalt cargo
#

Can you share your auth section? Could be you have no Users in your catalog and/or you don't have the resolvers in your config.

lone tapir
#
  environment: development
  providers:
    google:
      development:
        clientId: xxxx-yyy.apps.googleusercontent.com
        clientSecret: GOCSPX-xxxyyy
        signIn:
          resolvers:
            - resolver: emailMatchingUserEntityAnnotation
            - resolver: emailMatchingUserEntityProfileEmail
            - resolver: emailLocalPartMatchingUserEntityName
    github:
      development:
        clientId: yyyy
        clientSecret: xxxx
        signIn:
          resolvers:
            - resolver: usernameMatchingUserEntityName```
#

current work-around not efficient

catalog:
   locations:
    - type: url
      target: https://github.com/xxx/xxx-backstage-org/blob/main/org_members.yaml
      rules:
        - allow: [User, Group]```
org_members.yaml
```---
apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
  name: users
spec:
  type: team
  children: []
---
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
  name: xyz
spec:
  memberOf: [users]```
above works and I am able to log in
lone tapir
#

@cobalt cargo I would appreciate if you could take a look

cobalt cargo
#

Hi @lone tapir, you can use the GitHub Org provider - https://backstage.io/docs/integrations/github/org. Backend install steps are here for now: https://backstage.io/docs/backend-system/building-backends/migrating#the-catalog-plugin:~:text=GithubOrgEntityProvider. If you have issues with setting this up let me know, still the case that the docs are not as good as they should be

How to migrate existing backends to the new backend system