Skip to content

Malformed auth header in global git config causing HTTP 400 #838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ericsciple opened this issue Jun 24, 2022 · 1 comment
Open

Malformed auth header in global git config causing HTTP 400 #838

ericsciple opened this issue Jun 24, 2022 · 1 comment

Comments

@ericsciple
Copy link
Contributor

Yesterday when troubleshooting failing checkout (server returned 400), we discovered a malformed auth header in the global git config to be the root cause.

Simple repro steps (uses local git config steps for simplicity):

$ git clone https://github.com/actions/checkout.git

$ cd checkout

$ git config http.extraheader "AUTHORIZATION: Basic abcdef_abcdefabcdefabcdefabcdefabcdef"

$ git fetch
fatal: unable to access 'https://github.com/actions/checkout.git/': The requested URL returned error: 400

$ echo $?
128

It would be nice to handle this more gracefully in the checkout step. Perhaps something like:

  • Warn if we detect any http.extraheader="AUTHORIZATION..." in the global/system git config
    • Drawback: warnings often go unseen
  • When an authenticated git command fails (and stdout/stderr contains 400 error?), and we detect an auth header in the global/system git config, print an actionable error message.
@ericsciple
Copy link
Contributor Author

related: actions/runner#1970 and actions/runner#1971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant