checkout icon indicating copy to clipboard operation
checkout copied to clipboard

actions/checkout@v4 fails with "Duplicate header: Authorization" and throws "The requested URL returned error: 400"

Open gauravpk26 opened this issue 6 months ago • 8 comments

I'm using actions/checkout@v4 with a Personal access tokens (classic) (TOKEN_GITHUB) that has full repository and workflow permissions, and SSO is enabled for the organization.

My workflow snippet:

- name: Checkout
  uses: actions/checkout@v4
  with:
    token: ${{ secrets.TOKEN_GITHUB }}
    fetch-depth: 0

On some runs, the checkout step fails with:

Run actions/checkout@v4
Syncing repository: <org>/<repo>
Getting Git version info
Copying '/.../.gitconfig' to '/.../_temp/.../.gitconfig'
Temporarily overriding HOME='/.../_temp/...'
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /.../aftersales365-consumer/aftersales365-consumer
Deleting the contents of '/.../aftersales365-consumer/aftersales365-consumer'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/*
remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/<org>/<repo>/': The requested URL returned error: 400
The process '/usr/bin/git' failed with exit code 128

This happens intermittently and sometimes resolves on re-run. Would appreciate guidance or a fix to avoid this intermittent failure.

gauravpk26 avatar Jul 08 '25 09:07 gauravpk26

did you figure anything out for this? recently started happening to us too

callum-mcgregor-NW avatar Sep 05 '25 10:09 callum-mcgregor-NW

we also observe the same issue in github-enterprise

pkruk avatar Sep 09 '25 07:09 pkruk

Intermittently occurring for us too

AlexaDeWit avatar Sep 23 '25 14:09 AlexaDeWit

Happened to me just now, five times in a row ... and on the sixth try it worked again.

podfeet avatar Nov 06 '25 00:11 podfeet

In my case the root issue was OOM. We had a process in workflow which caused OOM and kernel killed the whole runnner process, which impacted later on checkout action.

pkruk avatar Nov 06 '25 08:11 pkruk

This same error started happening to me with actions/checkout@v6 - was caused by using v6 with peter-evans/[email protected]. The issue is fixed by updating to https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.9.

davidjb avatar Nov 24 '25 00:11 davidjb