Skip to content
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

Running ./config.sh with Expired Token results in Null Reference starting with 2.288.0 #1748

Closed
caleblloyd opened this issue Mar 11, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@caleblloyd
Copy link

Describe the bug

Running ./config.sh with Expired Token results in Null Reference starting with 2.288.0.

To Reproduce

Null Reference in 2.288.0 and 2.288.1

./config.sh --url https://github.com/made-up-org --token EXPIREDAABBCC

...

# Authentication

Object reference not set to an instance of an object.

Expected behavior

This printed the correct error in version 2.287.1

./config.sh --url https://github.com/made-up-org --token EXPIREDAABBCC

...

# Authentication

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).

Runner Version and Platform

  • Versions: 2.288.0 and 2.288.1
  • Arch: linux-x64
@caleblloyd caleblloyd added the bug Something isn't working label Mar 11, 2022
@ruvceskistefan
Copy link
Contributor

Hi @caleblloyd,
This bug has already been noticed and reported in this issue. A PR that will close this issue is also created, we are just waiting for verification and merge with the main branch. Since this is a duplicate of an existing issue, I'm going to close it, and you can see when the PR is merged and shipped to the production.

@caleblloyd
Copy link
Author

Awesome, thank you!

@Licho1
Copy link

Licho1 commented May 11, 2022

Hello, we are still having same issue with latest runner. If we try to register on organization level it fails:

[2022-05-03 19:28:14Z INFO Terminal] WRITE: Self-hosted runner registration
[2022-05-03 19:28:14Z INFO Terminal] WRITE LINE: |
[2022-05-03 19:28:14Z INFO Terminal] WRITE LINE: | |
[2022-05-03 19:28:14Z INFO Terminal] WRITE LINE: --------------------------------------------------------------------------------
[2022-05-03 19:28:14Z INFO ConfigurationManager] ConfigureAsync
[2022-05-03 19:28:14Z INFO ConfigurationStore] IsConfigured()
[2022-05-03 19:28:14Z INFO ConfigurationStore] IsConfigured: False
[2022-05-03 19:28:14Z INFO ConfigurationManager] Is configured: False
[2022-05-03 19:28:14Z INFO CommandSettings] Arg 'url': 'https://github.com/ZeroK-RTS'
[2022-05-03 19:28:14Z INFO CommandSettings] Remove url from Arg dictionary.
[2022-05-03 19:28:14Z INFO CommandSettings] Arg 'token': '***'
[2022-05-03 19:28:14Z INFO CommandSettings] Remove token from Arg dictionary.
[2022-05-03 19:28:14Z ERR Terminal] WRITE ERROR: Http response code: NotFound from 'POST https://api.github.com/actions/runner-registration'
[2022-05-03 19:28:14Z ERR Terminal] WRITE ERROR: {"message":"Not Found","documentation_url":"[https://docs.github.com/rest"}](https://docs.github.com/rest%22%7D)
[2022-05-03 19:28:14Z ERR Runner] System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at GitHub.Runner.Listener.Configuration.ConfigurationManager.GetTenantCredential(String githubUrl, String githubToken, String runnerEvent)
at GitHub.Runner.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
at GitHub.Runner.Listener.Runner.ExecuteCommand(CommandSettings command)
[2022-05-03 19:28:14Z ERR Terminal] WRITE ERROR: Response status code does not indicate success: 404 (Not Found).
[2022-05-03 19:28:14Z INFO Listener] Runner execution has finished with return code 1

If we register on repo level, it works fine.
Registration of self hosted runner fails for URL https://github.com/ZeroK-RTS
However it works for repos held by this organization for example for https://github.com/ZeroK-RTS/Zero-K-Infrastructure

@ruvceskistefan
Copy link
Contributor

Hi @Licho1,
As far as I can see this is the expected behavior , you don't get a null ref exception, but the runner exits with an 404 (Not Found).

@Licho1
Copy link

Licho1 commented May 14, 2022

But it fails the registration. Organization in question is https://github.com/ZeroK-RTS
Instructions to register new windows runner:

# Create a folder under the drive root
$ mkdir actions-runner; cd actions-runner# Download the latest runner package
$ Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.291.1/actions-runner-win-x64-2.291.1.zip -OutFile actions-runner-win-x64-2.291.1.zip# Optional: Validate the hash
$ if((Get-FileHash -Path actions-runner-win-x64-2.291.1.zip -Algorithm SHA256).Hash.ToUpper() -ne '2a504f852b0ab0362d08a36a84984753c2ac159ef17e5d1cd93f661ecd367cbd'.ToUpper()){ throw 'Computed checksum did not match' }# Extract the installer
$ Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-2.291.1.zip", "$PWD")
# Create the runner and start the configuration experience
$ ./config.cmd --url https://github.com/ZeroK-RTS --token AAYJY53UAVB7R6LDUXYB3EDCP545Q# Run it!
$ ./run.cmd

Yet if you do this, it fails the registration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants