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

Windows: Invalid configuration provided for url #3737

Closed
guicaulada opened this issue Jan 24, 2024 · 12 comments
Closed

Windows: Invalid configuration provided for url #3737

guicaulada opened this issue Jan 24, 2024 · 12 comments

Comments

@guicaulada
Copy link

guicaulada commented Jan 24, 2024

On version 5.6.2, when using Windows runners with the default user data and start runner script the runner is not running any jobs, when investigating I noticed the UserData.log shows:

Configure GH Runner as user ec2-user
.\config.cmd : Invalid configuration provided for url. Terminating unattended configuration.
At line:1 char:1
+ .\config.cmd --unattended --name windows-x64_i-0c96a1237c96979a5 --wo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Invalid configu... configuration.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

The runner shows up on GitHub, but it says it's offline.

@guicaulada
Copy link
Author

Apparently Windows doesn't support JIT config?

Setting enable_jit_config: false solved the issue for me.

@npalm
Copy link
Member

npalm commented Feb 12, 2024

Windows should support JIT as well. But I am not sure if the open source start script support this. @GuptaNavdeep1983 Can you make a comment?

@guicaulada
Copy link
Author

I believer either the start script is not sending the correct arguments to config.cmd or the issue is on config.cmd itself and this could be moved to https://github.com/actions/runner

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Mar 14, 2024
@GuptaNavdeep1983
Copy link
Contributor

@guicaulada, JIT is supported on Windows as well. Can you please create a PR to update the default start script to support this?

@guicaulada
Copy link
Author

@GuptaNavdeep1983 sorry, but I'm not sure what needs to be changed on the default start script for JIT to work correctly, it seems the arguments are passed correctly the same way it would on Linux but results in: .\config.cmd : Invalid configuration provided for url. Terminating unattended configuration.

@github-actions github-actions bot removed the Stale label Mar 15, 2024
@shubhamsinha-sf
Copy link

facing the same issue here. The url seems to be empty in our case:


[2024-03-21 15:06:59Z INFO CommandSettings] Arg 'url': ''

@rfsmart-bcleary
Copy link

rfsmart-bcleary commented Mar 22, 2024

Here's the help I found on the config.cmd:

.\config.cmd --help

Commands:
 .\config.cmd         Configures the runner
 .\config.cmd remove  Unconfigures the runner
 .\run.cmd            Runs the runner interactively. Does not require any options.

Options:
 --help     Prints the help for each command
 --version  Prints the runner version
 --commit   Prints the runner commit
 --check    Check the runner's network connectivity with GitHub server

Config Options:
 --unattended           Disable interactive prompts for missing arguments. Defaults will be used for missing options
 --url string           Repository to add the runner to. Required if unattended
 --token string         Registration token. Required if unattended
 --name string          Name of the runner to configure (default )
 --runnergroup string   Name of the runner group to add this runner to (defaults to the default runner group)
 --labels string        Custom labels that will be added to the runner. This option is mandatory if --no-default-labels is used.
 --no-default-labels    Disables adding the default labels: 'self-hosted,Windows,X64'
 --local                Removes the runner config files from your local machine. Used as an option to the remove command
 --work string          Relative runner work directory (default _work)
 --replace              Replace any existing runner with the same name (default false)
 --pat                  GitHub personal access token with repo scope. Used for checking network connectivity when executing `.\run.cmd --check`
 --disableupdate        Disable self-hosted runner automatic update to the latest released version`
 --ephemeral            Configure the runner to only take one job and then let the service un-configure the runner after the job finishes (default false)
 --runasservice   Run the runner as a service
 --windowslogonaccount string   Account to run the service as. Requires runasservice
 --windowslogonpassword string  Password for the service account. Requires runasservice

Examples:
 Check GitHub server network connectivity:
  .\run.cmd --check --url <url> --pat <pat>
 Configure a runner non-interactively:
  .\config.cmd --unattended --url <url> --token <token>
 Configure a runner non-interactively, replacing any existing runner with the same name:
  .\config.cmd --unattended --url <url> --token <token> --replace [--name <name>]
 Configure a runner non-interactively with three extra labels:
  .\config.cmd --unattended --url <url> --token <token> --labels L1,L2,L3
 Configure a runner to run as a service:
  .\config.cmd --url <url> --token <token> --runasservice

It would seem that here

$configCmd = ".\config.cmd --unattended --name $runner_name_prefix$InstanceId --work `"_work`" $config"
there is no --url arg on the command that might be the cause of this error. I believe we need another ssm parameter containing the github URL for our repo/org, read that in, and point the .\config.cmd at it.

@rfsmart-bcleary
Copy link

@GuptaNavdeep1983 or @npalm any thoughts on this issue? I forked this, made the changes and our forked version is working. We'd love to see this make it back upstream.

@npalm
Copy link
Member

npalm commented Apr 9, 2024

Can you make a PR based on your fork?

@rfsmart-bcleary
Copy link

@npalm I've created a PR, my fork is a little behind main, do you prefer I commit merge, or rebase?

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label May 11, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants