#GitHub Discovery with App Credential Error: This endpoint requires you to be authenticated

2 messages · Page 1 of 1 (latest)

remote oriole
#

Hey all, I'm trying to discover info about a GH org. I followed this guide: https://backstage.io/docs/integrations/github/discovery
And I create a GH app that works as an Authentication Provider, following this guide: https://backstage.io/docs/integrations/github/github-apps

But, I'm running into this error whenever the scheduler tries to pull in new catalog items from GH:

[1] 2023-06-17T21:35:38.196Z catalog error github-provider:SecureIdentity refresh failed This endpoint requires you to be authenticated. type=plugin target=github-provider:SecureIdentity class=GithubEntityProvider taskId=github-provider:SecureIdentity:refresh taskInstanceId=95a525aa-228f-464d-9446-cfc8e1d2226c name=HttpError status=401 response=[object Object] request=[object Object] stack=HttpError: This endpoint requires you to be authenticated.
[1]     at /Users/john.martin/Projects/backstage/node_modules/@octokit/request/dist-node/index.js:78:21
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[1]     at async queryWithPaging (/Users/john.martin/Projects/backstage/node_modules/@backstage/plugin-catalog-backend-module-github/dist/cjs/GithubEntityProvider-41bd0d1e.cjs.js:867:22)
[1]     at async getOrganizationRepositories (/Users/john.martin/Projects/backstage/node_modules/@backstage/plugin-catalog-backend-module-github/dist/cjs/GithubEntityProvider-41bd0d1e.cjs.js:824:24)
[1]     at async GithubEntityProvider.findCatalogFiles (/Users/john.martin/Projects/backstage/node_modules/@backstage/plugin-catalog-backend-module-github/dist/cjs/GithubEntityProvider-41bd0d1e.cjs.js:1138:54)
[1]     at async GithubEntityProvider.refresh (/Users/john.martin/Projects/backstage/node_modules/@backstage/plugin-catalog-backend-module-github/dist/cjs/GithubEntityProvider-41bd0d1e.cjs.js:1109:21)
[1]     at async TaskWorker.fn (/Users/john.martin/Projects/backstage/node_modules/@backstage/plugin-catalog-backend-module-github/dist/cjs/GithubEntityProvider-41bd0d1e.cjs.js:1097:13)
[1]     at async TaskWorker.runOnce (/Users/john.martin/Projects/backstage/node_modules/@backstage/backend-tasks/dist/index.cjs.js:360:7)
[1]     at async /Users/john.martin/Projects/backstage/node_modules/@backstage/backend-tasks/dist/index.cjs.js:308:31

I'm at a bit of a loss. Could someone help me start troubleshooting this problem?

#

I'm guessing that my GH App credential is either not good or isn't getting passed along to the GH API, but I don't really know how to troubleshoot this. I know the app has the default permissions that the backstage-cli program defines for it and I know I can successfully authenticate with the GH App as an Identity Provider in Backstage... That's where my knowledge of debugging JS apps begins to peter-out unfortunately.