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.

Configuration tries to use the registration endpoint even when passed `--token <token>`

See original GitHub issue

Describe the bug When running the configuration of the runner unattended, some means of authenticating is required. The documentation at https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization claims that a token from that endpoint can be used with the --token <token> option. Instead, the runner attempts to obtain a new one with a PAT that may or may not be passed to it (See ConfigurationManager.cs#L111) In the case that it isn’t, the configuration fails with a 404.

To Reproduce Steps to reproduce the behavior:

  1. Obtain a registration token from https://api.github.com/orgs/ORG/actions/runners/registration-token, where ORG is a valid organization. Call this registration token TOKEN.
  2. Run ./config --unattended --url https://github.com/ORG --token TOKEN
  3. An error is printed out and the runner exits

Expected behavior What is described to be possible in https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization

Runner Version and Platform

Version 2.291.1, Commit 496ec0df97891bd8e50f4431d01874ac3ab75a93

OS of the machine running the runner? OSX/Windows/Linux/… Linux, Ubuntu 20.04.4 LTS

What’s not working?

Http response code: NotFound from 'POST https://api.github.com/actions/runner-registration'
{"message":"Not Found","documentation_url":"https://docs.github.com/rest"}
Response status code does not indicate success: 404 (Not Found).

Job Log Output

N/A

Runner and Worker’s Diagnostic Logs

N/A

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:38
  • Comments:35

github_iconTop GitHub Comments

24reactions
ruvceskistefancommented, May 12, 2022

I tried to reproduce the issue you reported, but I had no problem with org runner configuration. Are you sure that your token just didn’t expire, since the token generated this way expires after an hour?

13reactions
noozocommented, Oct 18, 2022

+1. Seems like Github really wants you paying for their own runners.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authenticating to the REST API
Access tokens created by apps are automatically authorized for SAML SSO. Using basic authentication. Some REST API endpoints for GitHub Apps and ...
Read more >
ID Token and Access Token: What's the Difference?
Learn what ID and access tokens are and how to correctly use them in the OpenID Connect and OAuth context.
Read more >
What Are Refresh Tokens and How to Use Them Securely
This post will explore the concept of refresh tokens as defined by OAuth 2.0. We will learn how they compare to other token...
Read more >
REST Security With JWT Using Java and Spring Security
In this article, Toptal engineer Dejan Milosevic guides us on how to implement a JWT token-based REST API using Java and Spring Security....
Read more >
How to get an access token with Authorization Code Grant
This topic demonstrates how to generate an access token manually using Authorization Code Grant authentication or with a refresh token. In the Authorization ......
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