After upgrading a HP system to Windows 11 24H2, Windows State Repository service was killing the CPU, I took a large number of steps which had no affect but I finally discovered what was causing my problem, See below for solution (I will make assumptions you are technical enough to not need every step explaining.
1) Check Systemdrive/Users
Step one is to show Hidden system / files and check the /users directory for any weird profiles, mine had around 50 Defaultuser10000/.XXX folders, I deleted all of these folders as none are useful.
2) Event Viewer DB Corruption check
Search your event viewer logs for something to this nature:
DllHost (9020,D,50,0) WebPlatStorage: Database 'C:\Users\XXXXX\AppData\Local\Packages\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\AppData\CacheStorage\CacheStorage.edb': The primary index 'Primary' of table 'DatabaseProperties' for locale 'en-US' is out of date with sorting libraries, index sort version: (SortId=00000001-57ee-1e5c-00b4-d0000bb1e11e, Version=0006040300060403), current sort version: (SortId=00000001-57ee-1e5c-00b4-d0000bb1e11e, Version=0006050200060502). If used in this state (i.e. not rebuilt), it may appear corrupt or get further corrupted. If there is no later event showing the index being rebuilt, then please defragment the database to rebuild the index.
Now open CMD/Powershell and execute this line filling in the path as per your error above
esentutl /d "C:\Users\XXXX\AppData\Local\Packages\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\AppData\CacheStorage\CacheStorage.edb"
Reboot the PC, Now login and give it 10 minutes to finish rebuilding the database and hopefully this will solve the problem for you. I would also recommend running Windows Repair ALL in one and repairing everything + rebuilding rephrase / env variables.
Clear Event Viewer
After this I normally Clear event viewer logs and reboot and then repeat the above with any new paths / errors that display.
Previous things which did not seem to fix the problem:
- Repairing Windows Store
- Clear cache
- Repair edge
- Remove/reinstall all Appx (win store apps)
- Disable win search service
- Create another user
- System cleanup (inc sys files)