Repository navigation
Description
Before continuing...
- I agree to follow Atlas' Code of Conduct
- I have searched our issue tracker to verify that the issue hasn't been reported already
- I have searched the Atlas documentation beforehand for a solution
Description
I traced the 0x80073CF9 / 0x80070490 install failures from #1556, #1612, #1605 and #1675 to a concrete cause on my PC: rows in the AppX deployment database that belong to packages which are no longer registered.
Windows keeps two AppX databases in C:\ProgramData\Microsoft\Windows\AppRepository:
StateRepository-Machine.srd: the registered packages (Package._PackageID)StateRepository-Deployment.srd: each package's files with their SHA-256 (File), plusAppxManifestandPackageSourceUri, keyed by that package id
On my install, StateRepository-Deployment.srd had 10,618 File rows, 84 AppxManifest rows and 73 PackageSourceUri rows for 68 package ids that StateRepository-Machine.srd no longer has. Every one of them is an app on Atlas' removal list: Clipchamp, BingNews, BingSearch, BingWeather, GetHelp, OfficeHub, Solitaire, StickyNotes, PowerAutomateDesktop, Todos, DevHome, Alarms, Camera, FeedbackHub, SoundRecorder, Copilot, MSTeams, OutlookForWindows and ScreenSketch, including their language and scale resource packages.
Why installs fail
During staging, the deployment service hashes the new package's files and looks for identical files in File.Digest so it can hardlink them (the SISOptimization task inside EvaluateStateHandler). When a match belongs to one of the missing packages, the package lookup fails and the whole deployment ends with:
605 Failure in the Evaluated state handler: 0x80070490
401 ... failed with error 0x80070490
404 ... 0x80073CF9
The ETW trace (AppXDeployment-Server) shows EvaluateStateHandler start, then SISOptimization start with no stop, then EvaluateStateHandler stop and event 605, all within about 75 ms and before any file is copied. Process Monitor shows the service reading only StateRepository-Deployment.srd in that window.
The new Teams MSIX has 54 files whose SHA-256 matches a row of the removed Teams package. Any package that shares a file with a removed app fails the same way, including Store updates, Gaming Services and sideloaded MSIX, which matches the spread of reports in #1556.
Which installs are affected
The removed apps are exactly the ones Atlas 0.4.x and 0.5.0 remove with AME's !appx action (src/playbook/Configuration/atlas/appx.yml). The current playbook removes them with Remove-AppxPackage -AllUsers. I could not check AME's implementation, so "the !appx action left the rows" is an inference from the package list, not something I've proven. Installs that came from 0.4 or 0.5 keep the rows after updating, because nothing removes them.
Fix verified on my PC
- I backed up both databases and stopped
StateRepository. - I deleted only the rows whose
Packageis not inStateRepository-Machine.srd'sPackagetable.PRAGMA integrity_checkreturnedok, and all 279 registered packages stayedOk. - I started the services again. The same Teams MSIX that failed every time installed immediately, with no new 605, 401 or 404 events.
The current Fix MS Store Issues (StoreFixer) fixes the same thing by deleting the whole StateRepository-Deployment.srd from Safe Mode. Removing only the orphaned rows needs no Safe Mode and keeps the other packages' data. I'll open a PR that adds this as the first step of Fix MS Store Issues and keeps StoreFixer as the fallback.
Steps to reproduce
- Install Atlas 0.4.x or 0.5.0, then update.
- Install any MSIX that shares files with a removed app (for example the new Teams), or update a Store app.
- The install fails with
0x80073CF9, and the AppXDeploymentServer log shows 6050x80070490.
A read-only check, run elevated against a copy of the two .srd files:
ATTACH 'StateRepository-Machine.srd' AS m;
SELECT count(*) FROM File WHERE Package NOT IN (SELECT _PackageID FROM m.Package);Expected behavior
Packages install and update normally.
Actual behavior
Installs fail with 0x80073CF9 (0x80070490 in the Evaluated state handler).
Atlas Version
Installed with Atlas 0.4.x, since updated. Windows 11 24H2 (26100).
Activity
fix(store): remove orphaned AppX deployment rows before StoreFixer
fix(store): remove orphaned AppX deployment rows before StoreFixer