Windows runner loses identity after self-update
See original GitHub issueDescribe the bug
If the runner starts using impersonation (e.g. a scheduled task run under a logged out user) and the runner self-updates, the resulting process does not keep the full user profile loaded. Workflows using certain Windows cryptographic APIs will fail until the runner process is restarted.
To Reproduce
- Create a local user account (e.g. runneruser)
- Make sure that user is not logged in (so that their profile is not already loaded)
- Install a version of the Actions Runner that is at least one version older than the latest
- Configure the runner with GitHub.com using the
config.cmd
file - Launch the runner with impersonation (for example using a Scheduled Task, passing in the user’s credentials)
- Run a workflow, which will cause the runner to self-update before execution
- Any workflows run after this point will fail if they need access to certain Windows cryptographic APIs
- Stop the currently executing runner process and launch it again using a scheduled task
- Run the same workflow again. Note that the workflow now runs fine.
Expected behavior
Workflows should not fail or exhibit different behavior after the runner updates
Runner Version and Platform
Windows runner 2.277.1 (updating to 2.278.0)
What’s not working?
The update completes successfully, but workflows using certain Windows cryptographic APIs will fail when run by the new runner process. For example, this line of PowerShell:
New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("key.pfx", "")
Will fail with:
Exception calling ".ctor" with "2" argument(s): "The specified network password is not correct."
This example workflow is a good demonstration of the issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
WSUS Messages and Troubleshooting Tips
This article contains information about the following WSUS messages: Computer hasn't reported status. Message ID 6703 - WSUS Synchronization ...
Read more >Windows 10 broken updates almost made me lose my job...
Seriously, I have tried and tried again and again but I simply cannot stop windows 10 updates from going through, It would have...
Read more >ADSelfService Plus product startup issues
If ADSelfService Plus is not accessible after rebooting the server, it could be because the product is running as an application and not...
Read more >Newly-built replica WSUS server's clients can't find updates ...
I had a similar issue not to long ago when migrating to WSUS 3.0 SP2 on Windows Server 2008 R2. After quite a...
Read more >Windows 7 SP1 not being offered on Windows Update
I installed it and after rebooting and searching for updates again SP1 was offered as it should. OP Update: This turns out to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @MatisseHack, thank you for your patience on this one. I was hoping to get a response from the .NET team first, rather than a fix, but they’ve got their hands full just triaging issues. I merged your PR into the feature branch for now.
🎉 we found a Windows bug.😂