question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad tokens being passed to runners, resulting in 401 errors

See original GitHub issue

Describe the bug We see 401 errors in the setup portions of our actions, especially when trying to download action tarball URLs like https://api.github.com/repos/actions/checkout/tarball/a81bbbf8298c0fa03ea29cdc473d45769f953675, and especially in workflows with a number of jobs (~20). It doesn’t happen every build, but happens frequently enough to be annoying.

Examples can also be seen around the web of this happening to others:

Runner Version and Platform

Version of your runner? 2.273.5

OS of the machine running the runner? Linux

Job Log Output

Current runner version: '2.273.5'
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/a81bbbf8298c0fa03ea29cdc473d45769f953675'. Error: Response status code does not indicate success: 401 (Unauthorized).
Warning: Back off 18.746 seconds before retry.
Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/a81bbbf8298c0fa03ea29cdc473d45769f953675'. Error: Response status code does not indicate success: 401 (Unauthorized).
Warning: Back off 18.006 seconds before retry.
Error: Response status code does not indicate success: 401 (Unauthorized).

Suggestions

EDIT: a previous version of this description had presumed it was due to rate-limiting, but subsequent debugging has shown it’s actually bad tokens being passed to the runners and the 401s are actually Bad credentials errors.

So I’m not sure what to suggest here beyond:

  • Don’t pass bad/expired tokens to runners (still unclear why this is happening – why aren’t the tokens valid?)
  • Provide better debugging of errors (include response bodies)
  • Provide a way to debug tokens, and why api.github.com would be returning Bad credentials for them.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
mhartcommented, Nov 2, 2020

I can actually replicate this just by doing this from my actions:

run: curl https://x-access-token:${{ secrets.GITHUB_TOKEN }}@api.github.com

About 1 in 100 jobs will fail with a 401 Bad credentials message – so it seems that every now and then an invalid token is being issued?

Is there any way I can debug this any further?

0reactions
pathclcommented, Feb 8, 2022

@thboop just curious what changed in between? we’re experiencing similar issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

401 Unauthorized Error: What It Is and How to Fix It
The 401 Unauthorized Error is an HTTP response status code indicating that the client could not authenticate a request.
Read more >
What Is the 401 Unauthorized Error | How Do You Fix It?
You're likely to encounter it with an “Unauthorized” message or string, which essentially means you lack some level of authorization to proceed.
Read more >
How to resolve error 401 Unauthorized - Just getting started
Your token is either invalid or you are not authorized to access this URL. Kindly take dev help. 401 is valid response for...
Read more >
Getting 401 Unauthorized error when threads in JMeter ...
I am running a JMeter script, where I get the Access Token which I use it for my HTTP Request Samplers (By using...
Read more >
401 Unauthorized
Typing errors in requests often cause a 401. Ensure that the access token is passed correctly. The merchant ID required for our REST...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found