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.

Runner service on Windows fails to start with the default user

See original GitHub issue

Runner 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

10reactions
ericsciplecommented, Nov 11, 2019

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:

// Create a folder
mkdir actions-runner; cd actions-runner

Should probably be something like

# Create a folder under the drive root
mkdir \runner ; cd \runner
1reaction
TheOnion7commented, Apr 27, 2023

Same here, Also did the same thing. This issue was opened in 2019. This is 4 years old and nothing has changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab-runner service failing on Windows boot
On machine startup, that service launcher fails, with this error in the Windows Event Viewer: The gitlab-runner service failed to start due to ......
Read more >
Troubleshoot service startup permissions - Windows Server
Click Start, point to Administrative Tools, and then click Active Directory Users and Computers. In the console tree, right-click the ...
Read more >
Windows service fails to start with custom user until ...
The service uses a custom user. If I change the logon setting to use the local system account, the service starts fine. Then...
Read more >
Gitlab-Runner service not working in windows
I found the solution, The service was launched by the Local System user, which does not add the Windows\system32 in the PATH.
Read more >
How to fix “The User Profile Service service failed the sign- ...
First, you need to rename (or delete) the current default profile, which is causing the problem. Next, download the media creation tool for...
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