You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Windows t3 service install fails over SSH, and status says repair when USERNAME case differs #35149
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
On Windows 11 (workgroup PC, local account User), sign in at the desktop.
From another machine, ssh user@pc (OpenSSH Server, login name typed in lowercase).
Run t3 service install on 0.1.10-nightly.20261112.4564.
Set $env:USERDOMAIN = $env:COMPUTERNAME in the SSH session and run t3 service install again. It succeeds.
In a PowerShell window in the desktop session, run t3 service status.
Expected behavior
Install works over SSH, as the background-service docs describe. t3 service status reads the same from the desktop session and from SSH, since it is the same account and the same task.
Actual behavior
Step 3 fails: schtasks /Create reports "No mapping between account names and security IDs was done." In an OpenSSH session, USERDOMAIN is WORKGROUP, so the task XML gets <UserId>WORKGROUP\user</UserId>.
After step 4, the task is t3code-PC-user with <UserId>PC\user</UserId>, and it runs fine. But in the desktop session USERNAME is User, and t3 service status reads Status: needs an update or repair. Setting $env:USERNAME='user' in that same window makes it read installed.
Cause: apps/server/src/cloud/bootService.ts:846 builds userId and the task name from USERDOMAIN and USERNAME of the calling process. status then requires normalizeUnit(unit) === normalizeUnit(manager.render(planForUnit(unit))) (around line 1547), a case-sensitive string compare against that render. serviceLauncher.ts (lines 128 and 1361) derives the task name the same way. Windows account names are case-insensitive, and both variables depend on the logon type.
A fix could resolve the account from the process token, such as whoami /user or [Security.Principal.WindowsIdentity]::GetCurrent() (SID or DOMAIN\Name with the canonical case), and compare UserId case-insensitively.
Impact
Minor bug or occasional failure
Version or commit
0.1.10-nightly.20261112.4564 (bc647ed). The code is unchanged on main at 26433ac.
Environment
Windows 11 Pro 23H2, workgroup (no domain), local account. OpenSSH Server with PowerShell 7 as the default shell. Service installed through the native Windows backend from #34524.
Logs or stack traces
SSH: USERDOMAIN=WORKGROUP USERNAME=user
Desktop: USERDOMAIN=PC USERNAME=User
t3 service install (SSH): No mapping between account names and security IDs was done.
t3 service status (desktop): Status: needs an update or repair
t3 service status (desktop, USERNAME=user): Status: installed · [email protected]
A second failure from the same SSH install: the task gets registered from the elevated SSH session, and the desktop user then cannot manage it.
Windows OpenSSH gives an administrator key an elevated token. A task that t3 service install registers from there cannot be disabled by the same user's normal desktop session:
> schtasks /Change /TN t3code-PC-user /DISABLE # desktop session, not elevated
ERROR: Access is denied.
So t3 service install (repair) and anything else that disables the task from the desktop fails with BootServiceCommandError: Background setup failed while disabling the scheduled task (exit code 1). /ENABLE on the already-enabled task still succeeds, which hides the problem until a stop or repair.
Workaround that worked: run t3 service uninstall elevated, then run t3 service install non-elevated in the desktop session. After that, status reads installed, and a non-elevated t3 service restart exits 0 with a new server PID.
A fix could register the task with RunLevelLeastPrivilege and an explicit security descriptor that grants the account full control. Or install could refuse or warn when it runs elevated.
I tried to reproduce this on the current build and could not.
No Windows host is available (the VM is Linux), so neither the OpenSSH install nor the desktop-session status could be run for real. On origin/main b2e86d7 I added a case to the existing Windows test in apps/server/src/cloud/bootService.test.ts ('stops a Windows launcher by ending its task, and restarts one left disabled'). It installs with USERDOMAIN=PC and USERNAME=theo, holds the fake launcher lock and checks that status reads { problems: [], current: true }. It passes. It then builds a second BootService for the same home with USERNAME=Theo and reads status: current is false with problems [], which is the false 'needs an update or repair' the reporter saw from their desktop session. vp test run src/cloud/bootService.test.ts -t "stops a Windows launcher" fails at that assertion on main. The SSH install half ('No mapping between account names and security IDs was done' for WORKGROUP\user) is an error from Windows' own schtasks, so the fake command runner cannot express it. The cause is confirmed in code: the UserId and task name come from the process's USERDOMAIN and USERNAME at bootService.ts:846-850 and serviceLauncher.ts:128/1361.
Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
Your comment reproduces it: the test you added on b2e86d7 fails on main at the current assertion once USERNAME changes case, and you confirm the cause at bootService.ts:846-850 and serviceLauncher.ts:128/1361. That failing test is the bug, not a missing repro, so please reopen.
The exact steps and version are in the issue body: 0.1.10-nightly.20261112.4564 (bc647ed), Windows 11 Pro, local account, install over OpenSSH, then t3 service status from the desktop session. It still happens on that build. Your test also covers the same-account case-difference half without a Windows host. The comment above covers a second failure, from installing in an elevated SSH session.
Hey @t3dotgg, confirming this on a real Windows host. We moved a laptop from a homemade Task Scheduler supervisor to the new Windows t3 service from #34524 today (thanks for shipping it, it replaced a pile of PowerShell).
Windows 11, workgroup PC, local account Jeremy, OpenSSH Server, 0.1.10-nightly.20261112.4606. Over SSH:
USERDOMAIN=WORKGROUP USERNAME=jeremy
t3 service install -> Background setup failed while registering the scheduled task (exit code 1)
schtasks /Create /XML <generated task> -> ERROR: No mapping between account names and security IDs was done.
(7,34):UserId:WORKGROUP\jeremy
With $env:USERDOMAIN = $env:COMPUTERNAME the install goes through, and t3 service restart over SSH fails the same way without it ("stopping the installed service"). The task ends up registered as JEREMYSLAPTOP\jeremy while the account is Jeremy, which is the case mismatch @AkiVonAkira described above.
So it reproduces with the steps in the issue body. Could this be reopened? Resolving the account from the process token, as suggested above, looks like it would cover both halves.
Still present on 0.1.11-nightly.20261118.4877 and on main at e6265a9: bootService.ts:879-882 and serviceLauncher.ts:168/1605 still build the account and task name from USERDOMAIN/USERNAME. Reproduced today on a second real host (Windows 11, workgroup, local admin account, OpenSSH with PowerShell 7). One consequence isn't in this thread yet: a service installed over SSH can't be updated from the app, which is what #34524 was for.
Steps:
Over SSH: $env:USERDOMAIN = $env:COMPUTERNAME; t3 service install. This works around the WORKGROUP half. The server runs, and the app shows the host with serverSelfUpdate: boot-service.
The task's security descriptor is O:BA … (A;;FR;;;<user SID>). Administrators own it; the user can only read it.
From the same user's desktop session (Medium integrity), as the in-app update's handoff runs it:
So the app's Update, which re-registers with /Create … /F from inside the service, is refused on any Windows host whose service was installed over SSH. Re-registering later with /F keeps the existing security descriptor, so a later install from the desktop doesn't fix it either.
Workaround that needs no restart: from an elevated shell, add the user to the task's DACL. After that, the desktop session's /Create /F, /DISABLE and /ENABLE all succeed.
Suggested fix, matching the earlier comments: take DOMAIN\user from the process token (WindowsIdentity.GetCurrent(), or the SID) instead of the environment, and compare UserId case-insensitively. When install runs elevated, either register the task with a descriptor that gives the user full control, or refuse with a message to run it from the desktop session.
Same thing on another real host, on 0.1.10-nightly.20261116.4761. Can this be reopened?
Setup: Windows 11 Pro, workgroup PC, local admin account, OpenSSH Server, desktop app install (no service yet).
How I got here: Windows Update rebooted the PC overnight, nobody signed in afterwards, so the desktop app never came back and T3 Connect reported the host tunnel as offline (HTTP 530, tunnel_down). SSH was the only way in, and t3 service install failed there:
USERDOMAIN=WORKGROUP COMPUTERNAME=WINDOWS-MINIPC
t3 service install -> BootServiceCommandError: Background setup failed while registering the scheduled task (exit code 1).
schtasks /Create /XML %LOCALAPPDATA%\t3code\t3code-task.xml
-> ERROR: No mapping between account names and security IDs was done.
(7,32):UserId:WORKGROUP\<user>
set USERDOMAIN=%COMPUTERNAME% before t3 service install makes it register. But the task uses InteractiveToken, so it still does not start until someone signs in at the desktop. For the reboot case above, the service as generated cannot recover a headless box.
What got the host back without a sign-in: a second task with the same action, LogonType S4U and an AtStartup trigger (no stored password). The server and tunnel came up under it, and a second launcher started next to it stays idle instead of starting another server.
Two related things I noticed:
When run over SSH while the S4U server is up and the tunnel is registered, t3 connect status still prints Exposure: disabled and Authorization: missing. That sent me in the wrong direction for a while.
The docs say an SSH install "can fail at the final start step" when nobody is signed in. Here it fails earlier, at registration, because of the account name.
Suggested fix, same as above: resolve the account from the process token ([Security.Principal.WindowsIdentity]::GetCurrent().Name or the SID) instead of USERDOMAIN/USERNAME, and consider an S4U or startup option so a Windows host can come back after a reboot without a sign-in.
This still happens on 0.1.13 (stable). Exact steps and output below.
Steps
Windows 11 Pro, workgroup PC (PartOfDomain: False), local administrator account Owner. Windows OpenSSH Server.
From another machine: ssh owner@pc. In that session, USERDOMAIN=WORKGROUP and USERNAME=owner. (HKCU:\Volatile Environment has USERDOMAIN=PC, which is what a desktop logon gets.)
Run t3 service install.
Actual
ERROR (#2): BootServiceCommandError: Background setup failed while registering the scheduled task (exit code 1).
at cloud.boot_service.run_step ...
at cloud.boot_service.install ...
at cli.service.reconcile ...
boot-service.log says only Background setup failed while registering the scheduled task (exit code 1). Running the same command by hand shows the real error:
> schtasks /Create /XML $env:LOCALAPPDATA\t3code\t3code-task.xml /TN t3code /F
ERROR: No mapping between account names and security IDs was done.
(7,33):UserId:WORKGROUP\owner
The generated XML has <UserId>WORKGROUP\owner</UserId> in both the LogonTrigger and the Principal.
Workaround
$env:USERDOMAIN=$env:COMPUTERNAME; t3 service install
This works. The task t3code-PC-owner registers and runs. But in the same SSH session without the override, t3 service status then reports:
Status: needs an update or repair
[service-disabled] The service is not enabled to start automatically. Run `t3 service install` to repair it.
That is because the task name is also built from USERDOMAIN (t3code-WORKGROUP-owner is not found). If you follow that "Next" hint, the install fails again with the same error.
Suggested fix
Resolve the account from the process token (WindowsIdentity.GetCurrent() / whoami /user), not from USERDOMAIN/USERNAME. Use the SID in <UserId>, and make the task name stable (for example, from the SID or the canonical NTAccount name).
Separately: include schtasks' stderr in the BootServiceCommandError message and in boot-service.log. "exit code 1" alone made this hard to diagnose.
Version
t3 0.1.13 (C:\Users\Owner\.t3\runtime\versions\0.1.13\t3.exe)
Activity
AkiVonAkira commentedon Nov 12, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Kayzel
A second failure from the same SSH install: the task gets registered from the elevated SSH session, and the desktop user then cannot manage it.
Windows OpenSSH gives an administrator key an elevated token. A task that
t3 service installregisters from there cannot be disabled by the same user's normal desktop session:So
t3 service install(repair) and anything else that disables the task from the desktop fails withBootServiceCommandError: Background setup failed while disabling the scheduled task (exit code 1)./ENABLEon the already-enabled task still succeeds, which hides the problem until a stop or repair.Workaround that worked: run
t3 service uninstallelevated, then runt3 service installnon-elevated in the desktop session. After that, status readsinstalled, and a non-elevatedt3 service restartexits 0 with a new server PID.A fix could register the task with
RunLevelLeastPrivilegeand an explicit security descriptor that grants the account full control. Orinstallcould refuse or warn when it runs elevated.juliusmarminge commentedon Nov 12, 2026
I tried to reproduce this on the current build and could not.
No Windows host is available (the VM is Linux), so neither the OpenSSH install nor the desktop-session status could be run for real. On origin/main b2e86d7 I added a case to the existing Windows test in apps/server/src/cloud/bootService.test.ts ('stops a Windows launcher by ending its task, and restarts one left disabled'). It installs with USERDOMAIN=PC and USERNAME=theo, holds the fake launcher lock and checks that status reads { problems: [], current: true }. It passes. It then builds a second BootService for the same home with USERNAME=Theo and reads status: current is false with problems [], which is the false 'needs an update or repair' the reporter saw from their desktop session.
vp test run src/cloud/bootService.test.ts -t "stops a Windows launcher"fails at that assertion on main. The SSH install half ('No mapping between account names and security IDs was done' for WORKGROUP\user) is an error from Windows' own schtasks, so the fake command runner cannot express it. The cause is confirmed in code: the UserId and task name come from the process's USERDOMAIN and USERNAME at bootService.ts:846-850 and serviceLauncher.ts:128/1361.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
AkiVonAkira commentedon Nov 12, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Kayzel
Your comment reproduces it: the test you added on b2e86d7 fails on main at the
currentassertion onceUSERNAMEchanges case, and you confirm the cause atbootService.ts:846-850andserviceLauncher.ts:128/1361. That failing test is the bug, not a missing repro, so please reopen.The exact steps and version are in the issue body: 0.1.10-nightly.20261112.4564 (bc647ed), Windows 11 Pro, local account, install over OpenSSH, then
t3 service statusfrom the desktop session. It still happens on that build. Your test also covers the same-account case-difference half without a Windows host. The comment above covers a second failure, from installing in an elevated SSH session.GollyJer commentedon Nov 12, 2026
Hey @t3dotgg, confirming this on a real Windows host. We moved a laptop from a homemade Task Scheduler supervisor to the new Windows
t3 servicefrom #34524 today (thanks for shipping it, it replaced a pile of PowerShell).Windows 11, workgroup PC, local account
Jeremy, OpenSSH Server,0.1.10-nightly.20261112.4606. Over SSH:With
$env:USERDOMAIN = $env:COMPUTERNAMEthe install goes through, andt3 service restartover SSH fails the same way without it ("stopping the installed service"). The task ends up registered asJEREMYSLAPTOP\jeremywhile the account isJeremy, which is the case mismatch @AkiVonAkira described above.So it reproduces with the steps in the issue body. Could this be reopened? Resolving the account from the process token, as suggested above, looks like it would cover both halves.
Imacx-maria commentedon Nov 18, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Maria
Still present on
0.1.11-nightly.20261118.4877and on main at e6265a9:bootService.ts:879-882andserviceLauncher.ts:168/1605still build the account and task name fromUSERDOMAIN/USERNAME. Reproduced today on a second real host (Windows 11, workgroup, local admin account, OpenSSH with PowerShell 7). One consequence isn't in this thread yet: a service installed over SSH can't be updated from the app, which is what #34524 was for.Steps:
$env:USERDOMAIN = $env:COMPUTERNAME; t3 service install. This works around the WORKGROUP half. The server runs, and the app shows the host withserverSelfUpdate: boot-service.O:BA … (A;;FR;;;<user SID>). Administrators own it; the user can only read it.So the app's Update, which re-registers with
/Create … /Ffrom inside the service, is refused on any Windows host whose service was installed over SSH. Re-registering later with/Fkeeps the existing security descriptor, so a later install from the desktop doesn't fix it either.Workaround that needs no restart: from an elevated shell, add the user to the task's DACL. After that, the desktop session's
/Create /F,/DISABLEand/ENABLEall succeed.Suggested fix, matching the earlier comments: take
DOMAIN\userfrom the process token (WindowsIdentity.GetCurrent(), or the SID) instead of the environment, and compareUserIdcase-insensitively. Wheninstallruns elevated, either register the task with a descriptor that gives the user full control, or refuse with a message to run it from the desktop session.ugurkocde commentedon Nov 19, 2026
Same thing on another real host, on
0.1.10-nightly.20261116.4761. Can this be reopened?Setup: Windows 11 Pro, workgroup PC, local admin account, OpenSSH Server, desktop app install (no service yet).
How I got here: Windows Update rebooted the PC overnight, nobody signed in afterwards, so the desktop app never came back and T3 Connect reported the host tunnel as offline (HTTP 530,
tunnel_down). SSH was the only way in, andt3 service installfailed there:set USERDOMAIN=%COMPUTERNAME%beforet3 service installmakes it register. But the task usesInteractiveToken, so it still does not start until someone signs in at the desktop. For the reboot case above, the service as generated cannot recover a headless box.What got the host back without a sign-in: a second task with the same action,
LogonType S4Uand anAtStartuptrigger (no stored password). The server and tunnel came up under it, and a second launcher started next to it stays idle instead of starting another server.Two related things I noticed:
t3 connect statusstill printsExposure: disabledandAuthorization: missing. That sent me in the wrong direction for a while.Suggested fix, same as above: resolve the account from the process token (
[Security.Principal.WindowsIdentity]::GetCurrent().Nameor the SID) instead ofUSERDOMAIN/USERNAME, and consider an S4U or startup option so a Windows host can come back after a reboot without a sign-in.RVZO6 commentedon Nov 28, 2026
This still happens on 0.1.13 (stable). Exact steps and output below.
Steps
PartOfDomain: False), local administrator accountOwner. Windows OpenSSH Server.ssh owner@pc. In that session,USERDOMAIN=WORKGROUPandUSERNAME=owner. (HKCU:\Volatile EnvironmenthasUSERDOMAIN=PC, which is what a desktop logon gets.)t3 service install.Actual
boot-service.logsays onlyBackground setup failed while registering the scheduled task (exit code 1).Running the same command by hand shows the real error:The generated XML has
<UserId>WORKGROUP\owner</UserId>in both theLogonTriggerand thePrincipal.Workaround
This works. The task
t3code-PC-ownerregisters and runs. But in the same SSH session without the override,t3 service statusthen reports:That is because the task name is also built from
USERDOMAIN(t3code-WORKGROUP-owneris not found). If you follow that "Next" hint, the install fails again with the same error.Suggested fix
WindowsIdentity.GetCurrent()/whoami /user), not fromUSERDOMAIN/USERNAME. Use the SID in<UserId>, and make the task name stable (for example, from the SID or the canonicalNTAccountname).BootServiceCommandErrormessage and inboot-service.log. "exit code 1" alone made this hard to diagnose.Version
t3 0.1.13 (
C:\Users\Owner\.t3\runtime\versions\0.1.13\t3.exe)Reported with Claude Opus 5.5 in T3 Code.