Skip to content

Required PAT scope to reclaim Mannequins listed is incorrect #45071

Description

@rlarno

In the online documentation (as of 7/7/2026) the scope is listed as admin:org only, but in reality I needed the same scope: repo, admin:org, workflow as the other tasks to make this work.

Next, you will need to create a {% data variables.product.pat_v1 %} which the {% data variables.product.prodname_ado2gh_cli %} will use to communicate with {% data variables.product.github %}. {% data reusables.enterprise-migration-tool.github-pat-required-scopes %}

Without the correct scope, I received

[2026-07-07 08:43:30] [INFO] You are running an up-to-date version of the ado2gh CLI [v1.30.2]
[2026-07-07 08:43:30] [INFO] GITHUB ORG: Demo
[2026-07-07 08:43:30] [INFO] OUTPUT: demo-mannequin-test.csv
[2026-07-07 08:43:30] [INFO] Generating CSV...
[2026-07-07 08:43:44] [ERROR] Failed to retrieve the list of mannequins

With a typical 20260707084329-41532.octoshift.verbose.log:

[2026-07-07 08:43:30] [DEBUG] HTTP GET: https://www.githubstatus.com/api/v2/incidents/unresolved.json
[2026-07-07 08:43:30] [DEBUG] RESPONSE (OK): {"page":{"id":"kctbh9vrtdwd","name":"GitHub","url":"https://www.githubstatus.com","time_zone":"Etc/UTC","updated_at":"2026-07-07T05:44:11.362Z"},"incidents":[]}
[2026-07-07 08:43:30] [DEBUG] HTTP GET: https://raw.githubusercontent.com/github/gh-gei/main/LATEST-VERSION.txt
[2026-07-07 08:43:30] [DEBUG] RESPONSE (OK): v1.30.2

[2026-07-07 08:43:30] [INFO] You are running an up-to-date version of the ado2gh CLI [v1.30.2]
[2026-07-07 08:43:30] [INFO] GITHUB ORG: Demo
[2026-07-07 08:43:30] [INFO] OUTPUT: demo-mannequin-test.csv
[2026-07-07 08:43:30] [INFO] Generating CSV...
[2026-07-07 08:43:30] [DEBUG] HTTP POST: https://api.github.com/graphql
[2026-07-07 08:43:30] [DEBUG] HTTP BODY: {"query":"query($login: String!) {organization(login: $login) { login, id, name } }","variables":{"login":"Demo-LNL"}}
[2026-07-07 08:43:31] [DEBUG] GITHUB REQUEST ID: C2DC:29EBC8:1A0B3594:18A26A37:6A4CA013
[2026-07-07 08:43:31] [DEBUG] RESPONSE (OK): {"data":{"organization":{"login":"<removed>","id":"<removed>","name":"<removed>"}}}
[2026-07-07 08:43:31] [DEBUG] HTTP POST: https://api.github.com/graphql
[2026-07-07 08:43:31] [DEBUG] HTTP BODY: {"query":"query($id: ID!, $first: Int, $after: String) { \n                node(id: $id) {\n                    ... on Organization {\n                        mannequins(first: $first, after: $after) {\n                            pageInfo {\n                                endCursor\n                                hasNextPage\n                            }\n                            nodes {\n                                login\n                                id\n                                claimant {\n                                    login\n                                    id\n                                }\n                            }\n                        }\n                    }\n                } }","variables":{"id":"O_kgDOEOdg4w","first":100,"after":null}}
[2026-07-07 08:43:31] [DEBUG] GITHUB REQUEST ID: C2DC:29EBC8:1A0B3856:18A26CBC:6A4CA013
[2026-07-07 08:43:31] [DEBUG] RESPONSE (OK): {"data":{"node":null},"errors":[{"type":"FORBIDDEN","path":["node","mannequins"],"locations":[{"line":4,"column":25}],"message":"<removed> does not have the right permission to retrieve mannequins."}]}
[2026-07-07 08:43:31] [DEBUG] System.InvalidOperationException: Cannot access child value on Newtonsoft.Json.Linq.JValue.
   at Newtonsoft.Json.Linq.JToken.get_Item(Object key)
   at OctoshiftCLI.Services.GithubApi.<>c.<GetMannequins>b__43_1(JObject data)
   at OctoshiftCLI.Services.GithubClient.PostGraphQLWithPaginationAsync(String url, Object body, Func`2 resultCollectionSelector, Func`2 pageInfoSelector, Int32 first, String after, Dictionary`2 customHeaders)+MoveNext()
   at OctoshiftCLI.Services.GithubClient.PostGraphQLWithPaginationAsync(String url, Object body, Func`2 resultCollectionSelector, Func`2 pageInfoSelector, Int32 first, String after, Dictionary`2 customHeaders)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.MoveNextCore() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs:line 221
   at System.Linq.AsyncIteratorBase`1.MoveNextAsync() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncIterator.cs:line 70
   at System.Linq.AsyncIteratorBase`1.MoveNextAsync() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncIterator.cs:line 75
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at OctoshiftCLI.Services.GithubApi.<>c__DisplayClass43_0.<<GetMannequins>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)
[2026-07-07 08:43:31] [DEBUG] Retrying...

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions