github / gh-gei

Migration CLI for GitHub to GitHub migrations
MIT License
310 stars 83 forks source link

403 Forbidden Error unrelated to PATs/Permissions #1245

Open martleung opened 4 months ago

martleung commented 4 months ago

Description

We are facing the below error when using the GitHub GEI to migrate repositories between GHEC to GHEMU.   Git source migration failed. Error message: the server responded with status 403 Error class: Faraday::ForbiddenError.

We have validated the PAT for both the source org in GHEC and the target org in GHEMU. This included checking the scope and that it's been SSO authorised - even tested these PATs by performing GH CLI commands against the respective orgs.   We are quite certain the issue is in relation to GEI service connecting to the source GHEC/org as the blank repository is being created in the target GHEMU. We have checked IP Allowlist is not enabled within GHEC.

Can further details be provided on the below error?

Reproduction Steps

Run the command gh gei migrate-repo --github-source-org SOURCE_ORG --source-repo SOURCE_REPO --github-target-org TARGET_ORG --verbose

martleung commented 4 months ago

Quick update on the above. The issue was found to be due to a newly introduced requirement for the source PAT to require admin:org (as opposed to read:org which was working 2-3 weeks ago).

I noticed that the GitHub documentation just got updated to indicate the need to use admin:org against the source PAT - so no further action required.