Runner service on Windows fails to start with the default user
See original GitHub issueRunner Version and Platform
actions-runner-win-x64-2.160.2
Windows Server 2019 Standard (1809)
What’s not working?
If a user runs a powershell in a Windows user directory, and tries to use the default suggested user for running installing a service (NT AUTHORITY\NETWORK SERVICE
), the config script completes successfully and says the service is running, but the service never actually successfully starts.
@thboop has identified that this is due to NT AUTHORITY\NETWORK SERVICE
not having permissions to the user directory to start the service.
I have suggested that we add this extra paragraph to the ‘Add runner’ modal for adding a runner:
Note: If you want to install the runner application as a service, you must open a shell with administrator privileges. We also recommend that you use
C:\actions-runner
as the directory for the runner application so that Windows system accounts can access the runner directory.
The above note has been added to the docs, but IMO, it should also be in the modal UI.
Failing powershell run below:
PS C:\Users\Lucas Costi\actions-runner> ./config.cmd --url https://github.com/lucascosti/actions-private-playground --token ABB2TGV5QRUAQRVT4DONCU25YXSSO
--------------------------------------------------------------------------------
| ____ _ _ _ _ _ _ _ _ |
| / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ |
| | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ \| '_ \/ __| |
| | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | \__ \ |
| \____|_|\__|_| |_|\__,_|_.__/ /_/ \_\___|\__|_|\___/|_| |_|___/ |
| |
| Self-hosted runner registration |
| |
--------------------------------------------------------------------------------
# Authentication
√ Connected to GitHub
# Runner Registration
Enter the name of runner: [press Enter for WIN-9L5VTRV5F51] win
√ Runner successfully added
√ Runner connection is good
# Runner settings
Enter name of work folder: [press Enter for _work]
√ Settings Saved.
Would you like to run the runner as service? (Y/N) [press Enter for N] y
User account to use for the service [press Enter for NT AUTHORITY\NETWORK SERVICE]
Granting file permissions to 'NT AUTHORITY\NETWORK SERVICE'.
Service actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win successfully installed
Service actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win successfully set recovery option
Service actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win successfully set to delayed auto start
Service actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win successfully configured
Service actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win started successfully
PS C:\Users\Lucas Costi\actions-runner> Get-Service "actionsrunner.*"
Status Name DisplayName
------ ---- -----------
Stopped actionsrunner.c... GitHub Actions Runner (cT09lfQ8MbjR...
PS C:\Users\Lucas Costi\actions-runner> Start-Service "actionsrunner.*"
Start-Service : Failed to start service 'GitHub Actions Runner
(cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win)
(actionsrunner.cT09lfQ8MbjRkaUM211SBR82j32Te65GnVI5TvwNaRzz0HCzOU.Default.win)'.
At line:1 char:1
+ Start-Service "actionsrunner.*"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6
Top GitHub Comments
Yep we should guide people away from installing under user profile on Windows. Not just because of permissions, but also because of long-path issues (total path > 160 or segment > 148 irrc). We should setup users for success.
We might want to add a warning during configure if the working directory is under %USERPROFILE%. Something like:
Warning: We recommend configuring the runner under "<DRIVE>:\runner" instead. This will help avoid issues related to service identity folder permissions and long file path restrictions.
It looks like the setup instructions in the web UI might be contributing also.
Excerpt:
Should probably be something like
Same here, Also did the same thing. This issue was opened in 2019. This is 4 years old and nothing has changed.