# Github App Authorisation fails on a long build chain

**URL:** <https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278>\
**Category:** Builds\
**Created:** [September 15, 2026, 11:06am UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278 "2026-09-15T11:06:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogdan.voiko](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bogdan.voiko](https://discuss.bitrise.io/u/bogdan.voiko)\
**Post date:** [September 15, 2026, 11:06am UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/1 "2026-09-15T11:06:35Z")

</div>

## Description of the issue

_We have recently migrated from using Github OAuth to Github App for Bitrise ↔ Github access management and there appears to be an issue with starting too many builds in parallel._

It appears that auth token is generated when the build is created, even if that build is on hold which leads to the token expiring if hold time is long, which in its turn leads to Git Clone step failing due to invalid credentials.

## Environment:

**Where did the issue happen?**

Ubuntu Noble 24.04 - Bitrise 2025 Edition • Linux AMD Zen4 Medium

**Which build Step causes the issue and which version of the step?**

Git Clone Repository v8.5.1

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : YES
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)_[on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches). : YES
- _Does the issue happen sporadically, or every time?_ : When hold time is large enough, approximately 1h
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : Migrating to Github App integration

## Build log

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

```auto
Input:
- merge_pr: true
- git_http_username: <unset>
- git_http_password: [REDACTED]
- clone_into_dir: /bitrise/src
- clone_depth: 0
- update_submodules: true
- submodule_update_depth: 0
- fetch_tags: false
- sparse_directories: []
- ignore_branch_for_commit_fetch: false
- repository_url: https://github.com/...git
- commit: <unset>
- tag: <unset>
- branch: v4-prod
- branch_dest: <unset>
- pull_request_repository_url: <unset>
- pull_request_merge_branch: <unset>
- pull_request_unverified_merge_branch: <unset>
- pull_request_head_branch: <unset>
- reset_repository: false
- performance_monitoring: false
- build_url: https://app.bitrise.io/app/0d7163b08386e81f/build/6edf1940-16f0-4597-972a-c5bf212f79be
- build_api_token: [REDACTED]
Writing .netrc file...
No .netrc file found at (/root/.netrc), creating new...

$ git "init"
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
hint: to use in all of your new repositories, which will suppress this warning,
hint: call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /bitrise/src/.git/

$ git "remote" "add" "origin" "https://github.com/...git"

$ git "config" "gc.auto" "0"

$ git "fetch" "--jobs=10" "--depth=1" "--no-tags" "origin" "refs/heads/v4-prod"
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'
Attempt 1 failed:
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'
Retrying...

$ git "fetch" "--jobs=10" "--depth=1" "--no-tags" "origin" "refs/heads/v4-prod"
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'
Attempt 2 failed:
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'
Retrying...

$ git "fetch" "--jobs=10" "--depth=1" "--no-tags" "origin" "refs/heads/v4-prod"
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'
Attempt 3 failed:
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/...git/'

$ git "remote" "-v" &> out

$ git "ls-remote" "-b" &> out
Checkout strategy used: gitclone.checkoutBranch

Failed to execute Step:
  fetch branch refs/heads/v4-prod: remote: Invalid username or token. Password authentication is not supported for Git operations.
  fatal: Authentication failed for 'https://github.com/...git/':
    please make sure the branch still exists

```

Despite that scary log simply restarting the build works, as well as all previous builds targeting the same branch.

---

<div class="post-metadata">

**Author:** ![jeremyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jeremyp/32/5490_2.png) [@jeremyp](https://discuss.bitrise.io/u/jeremyp)\
**Post date:** [September 29, 2026, 9:18am UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/2 "2026-09-29T09:18:24Z")

</div>

Hi @bogdan.voiko 👋, thanks for reaching out. I have a couple of clarifying questions:

GitHub App tokens last for 1 hour (this is a GitHub limit) so it appears that you have builds which are on hold for a full hour or more, which obviously isn’t optimal. So I have a couple of clarifying questions:

1. What proportion of your builds (roughly) end up on hold for an hour or more?
2. What’s causing the builds to be on hold for so long?

Thanks!

---

<div class="post-metadata">

**Author:** ![bogdan.voiko](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bogdan.voiko](https://discuss.bitrise.io/u/bogdan.voiko)\
**Post date:** [October 26, 2026, 2:54pm UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/3 "2026-10-26T14:54:10Z")

</div>

Hi @jeremyp

Thanks for coming back to me.

1. There’s no fixed number, but sometimes it can reach ~10 I would say.
2. We run a whiltelabel multi-tenant app that sometimes require building tens of apps in one go, eg after a new deploy and with individual builds taking 10-20 minutes, it’s fairly easy to reach max concurrency more than once.

Let me know if you need more info or there are better/proper ways to address it.

Cheers

---

<div class="post-metadata">

**Author:** ![jeremyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jeremyp/32/5490_2.png) [@jeremyp](https://discuss.bitrise.io/u/jeremyp)\
**Post date:** [October 26, 2026, 3:43pm UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/4 "2026-10-26T15:43:01Z")

</div>

Thanks for the extra context @bogdan.voiko. One further question:

1. What is your workaround atm - rebuilding all the builds which fail with this reason?

Unfortunately there isn’t a better way to address this out of the box atm ☹. This is an important piece of feedback though, particularly for white label builders. Thanks for sharing - it’s on our radar now. If we devise a good solution to this I will let you know.

---

<div class="post-metadata">

**Author:** ![bogdan.voiko](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bogdan.voiko](https://discuss.bitrise.io/u/bogdan.voiko)\
**Post date:** [October 26, 2026, 4:12pm UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/5 "2026-10-26T16:12:32Z")

</div>

1. Since we are currently starting builds manually (via API/Slack) we basically have to pace start commands, ie start 10 builds, wait for all of them to complete, start 10 more, etc. It’s not the end of the world, but does mean that it’s less hands off process.

With the current workaround in mind, it’s “fine” for now, but in ideal world where we do all builds as a part of a single pipeline the issue will return and the only workaround to that, that I can see, is cloning in step one and then sharing the zipped cloned copy between workflows.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![jeremyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jeremyp/32/5490_2.png) [@jeremyp](https://discuss.bitrise.io/u/jeremyp)\
**Post date:** [October 27, 2026, 5:09pm UTC](https://discuss.bitrise.io/t/github-app-authorisation-fails-on-a-long-build-chain/26278/6 "2026-10-27T17:09:02Z")

</div>

Hi again @bogdan.voiko - fyi, some workaround ideas which came up from the team here are:

1. Caching the repo in the first step of a pipeline, as you already suggested
2. Set up a pipeline like on the image - this basically replicates your manual process by starting a batch of apps and then make the rest of the workflows wait for them to finish  
 ![Screenshot 2026-10-27 at 14.06.19](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/b/bbcedfaa723c18a4aaad1c4e04320f2c862c20df.png)
