nelsonlaptop has two runner instances; pwsh missing on the legacy one #165

Closed
opened 2026-04-29 09:29:47 -07:00 by romaine-life-app[bot] · 2 comments
romaine-life-app[bot] commented 2026-04-29 09:29:47 -07:00 (Migrated from github.com)

Symptom

Issue-agent runs that route to nelsonlaptop fail intermittently at Refresh checkout to latest main (or any pwsh-shelled step) with:

##[error]pwsh: command not found

Reproducing runs:

In both runs, test-plan succeeded on one runner instance and implementation failed on the other in parallel.

Root cause

The laptop has two registered Actions runner services, both labeled the same (self-hosted, windows, issue-agent-worker, issue-agent-runner-nelsonlaptop). GitHub round-robins between them. Pwsh is installed for one, missing from the other.

Workspace paths from the failing runs identify the bad instance:

C:\actions-runner-card-utility-stats\_work\spirelens\spirelens\...

That card-utility-stats directory name is leftover from before #69 renamed CardUtilityStats → SpireLens. The runner survived the GitHub rename via redirect (git fetch nelsong6/spirelens works fine in the log) but its environment wasn't re-baked when whatever installed pwsh on the new runner ran.

The healthy instance lives at D:\actions-runner-user\… (user Nelson).

Fix — pick one (or both)

(1) Install pwsh system-wide on the laptop. Easiest, durable, immune to drift. Both runners pick it up on the next process spawn.

# From an elevated PowerShell prompt on the laptop:
winget install --id Microsoft.PowerShell --source winget
# Or download PowerShell-7.x.x-win-x64.msi and: msiexec /i <msi> /qn
# Verify:
pwsh --version

After install, no service restart needed — the next workflow step that asks for pwsh will find it on PATH.

(2) Decommission the legacy card-utility-stats runner. Good hygiene regardless. Cleans up the rename leftover.

# RDP to nelsonlaptop, then:
Get-Service 'actions.runner.*' | Format-Table Name, DisplayName, Status
# Identify the one tied to C:\actions-runner-card-utility-stats\
cd C:\actions-runner-card-utility-stats
.\svc.cmd uninstall   # stops + removes the Windows service
.\config.cmd remove --token <pat-with-repo-scope>   # deregisters from GitHub's runner list
# Then verify on https://github.com/nelsong6/spirelens/settings/actions/runners
# only the D:\actions-runner-user\... instance remains.

Recommendation: do (1) first — fastest path to working. Do (2) after, since the legacy directory is just clutter that'll bite again if anyone re-bakes pwsh on one runner but not the other.

Verification after fix

Re-trigger #142 by adding the issue-agent label. Watch for the implementation job to land on either runner without the pwsh-not-found error. If it succeeds through verify, that also empirically validates two pending fixes that haven't been exercised yet:

Both were merged but never tripped because earlier failures short-circuited.

## Symptom Issue-agent runs that route to `nelsonlaptop` fail intermittently at `Refresh checkout to latest main` (or any pwsh-shelled step) with: ``` ##[error]pwsh: command not found ``` Reproducing runs: - [25118186812](https://github.com/nelsong6/spirelens/actions/runs/25118186812) — implementation job - [25120044128](https://github.com/nelsong6/spirelens/actions/runs/25120044128) — implementation job In both runs, test-plan succeeded on one runner instance and implementation failed on the other in parallel. ## Root cause The laptop has **two registered Actions runner services**, both labeled the same (`self-hosted`, `windows`, `issue-agent-worker`, `issue-agent-runner-nelsonlaptop`). GitHub round-robins between them. Pwsh is installed for one, missing from the other. Workspace paths from the failing runs identify the bad instance: ``` C:\actions-runner-card-utility-stats\_work\spirelens\spirelens\... ``` That `card-utility-stats` directory name is leftover from before [#69](https://github.com/nelsong6/spirelens/pull/69) renamed CardUtilityStats → SpireLens. The runner survived the GitHub rename via redirect (`git fetch nelsong6/spirelens` works fine in the log) but its environment wasn't re-baked when whatever installed pwsh on the new runner ran. The healthy instance lives at `D:\actions-runner-user\…` (user `Nelson`). ## Fix — pick one (or both) **(1) Install pwsh system-wide on the laptop.** Easiest, durable, immune to drift. Both runners pick it up on the next process spawn. ```powershell # From an elevated PowerShell prompt on the laptop: winget install --id Microsoft.PowerShell --source winget # Or download PowerShell-7.x.x-win-x64.msi and: msiexec /i <msi> /qn # Verify: pwsh --version ``` After install, no service restart needed — the next workflow step that asks for `pwsh` will find it on PATH. **(2) Decommission the legacy `card-utility-stats` runner.** Good hygiene regardless. Cleans up the rename leftover. ```powershell # RDP to nelsonlaptop, then: Get-Service 'actions.runner.*' | Format-Table Name, DisplayName, Status # Identify the one tied to C:\actions-runner-card-utility-stats\ cd C:\actions-runner-card-utility-stats .\svc.cmd uninstall # stops + removes the Windows service .\config.cmd remove --token <pat-with-repo-scope> # deregisters from GitHub's runner list # Then verify on https://github.com/nelsong6/spirelens/settings/actions/runners # only the D:\actions-runner-user\... instance remains. ``` Recommendation: do (1) first — fastest path to working. Do (2) after, since the legacy directory is just clutter that'll bite again if anyone re-bakes pwsh on one runner but not the other. ## Verification after fix Re-trigger #142 by adding the `issue-agent` label. Watch for the implementation job to land on either runner without the pwsh-not-found error. If it succeeds through verify, that also empirically validates two pending fixes that haven't been exercised yet: - [spirelens#163](https://github.com/nelsong6/spirelens/pull/163) — Stop-Process WaitForExit hardening - [spire-lens-mcp#6](https://github.com/nelsong6/spire-lens-mcp/pull/6) — bundled base saves fallback Both were merged but never tripped because earlier failures short-circuited.
nelsong6 commented 2026-04-29 09:35:34 -07:00 (Migrated from github.com)

Local follow-up from nelsonlaptop:

The failure is confirmed, but the root-cause wording above is a bit off.

Actual state on this laptop:

  • GitHub has two registered laptop runners: issue-agent-nelsonlaptop-a and issue-agent-nelsonlaptop-b.
  • Runner A root: C:\actions-runner-card-utility-stats.
  • Runner B root: C:\actions-runner-card-utility-stats-implementation.
  • There is a disabled old Windows service, but runner A is currently launched by the scheduled task \SpireLens Issue Agent Interactive Runner.
  • Runner A had a root .env file that explicitly set Path=... and omitted C:\Users\nelsonlaptopuser\AppData\Local\Microsoft\WindowsApps, which is where pwsh.exe resolves on this machine.

I updated C:\actions-runner-card-utility-stats\.env to prepend C:\Users\nelsonlaptopuser\AppData\Local\Microsoft\WindowsApps, then restarted the scheduled task. Both laptop runners are now online and idle. This still needs to be validated by the next job that lands on runner A; I did not requeue anything from this issue.

Local follow-up from nelsonlaptop: The failure is confirmed, but the root-cause wording above is a bit off. Actual state on this laptop: - GitHub has two registered laptop runners: `issue-agent-nelsonlaptop-a` and `issue-agent-nelsonlaptop-b`. - Runner A root: `C:\actions-runner-card-utility-stats`. - Runner B root: `C:\actions-runner-card-utility-stats-implementation`. - There is a disabled old Windows service, but runner A is currently launched by the scheduled task `\SpireLens Issue Agent Interactive Runner`. - Runner A had a root `.env` file that explicitly set `Path=...` and omitted `C:\Users\nelsonlaptopuser\AppData\Local\Microsoft\WindowsApps`, which is where `pwsh.exe` resolves on this machine. I updated `C:\actions-runner-card-utility-stats\.env` to prepend `C:\Users\nelsonlaptopuser\AppData\Local\Microsoft\WindowsApps`, then restarted the scheduled task. Both laptop runners are now online and idle. This still needs to be validated by the next job that lands on runner A; I did not requeue anything from this issue.
nelsong6 commented 2026-07-05 15:45:24 -07:00 (Migrated from github.com)

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens#165
No description provided.