In the last few years I've been syncing (as a backup) my start menu folder on onedrive.
The Start Menu folder is kept inside the onedrive sync tree and C:\ProgramData\Microsoft\Windows, C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu are ntfs junctions to that location.

To this day, I'm not exactly sure of how ACLs are supposed to behave when symlinks/junctions are involved in windows, doc in a bit scarce, so as a reasonable measure I set to the target the union of the permissions of the links.
The proprietary onedrive client doesn't seem to support links very well so it's a quite common practice to put links to onedrive like in this case.

In the last couple of months I've been having troubles with certain windows updates, and more generally with the "Optional features" in the system settings. After some debugging and log digging, I've discovered that whenever the install/uninstall process requires writing to the start menu folder, the ntfs transaction fails along with the installation process.
Reading doesn't seem to be an issue as I'm able to inspect on the CBS log what the installer is attempting to add/remove on the start menu folder, and do it manually so that the next attempt results in a no-op. (for example, sometimes windows updates remove files from the start menu folder; if i remove them preemptively and then run the update process, the installation succeeds).
Generally, when an installation of this kind fails, it is scheduled for the next system restart. It fails in that case too.

From what the explorer gui says, permissions are compatible. I'm at a loss of what can I do to circumvent this problem. The entire component servicing system is kept quite obscure to non-enterprise users. For what I know it might even be an issue with ntfs transactions and link. But why did it start erroring just so recently..?

Here a CBS log snippet, here I'm attempting to install "RSAT active directory domain services" from the "optional features" section. (it attempts to install the shortcut Server Manager.lnk):


2024-02-27 11:29:21, Info CSI 00000056@2024/2/27:10:29:21.563 Primitive installers committed
2024-02-27 11:29:21, Info CSI 00000057 ICSITransaction::Commit calling IStorePendingTransaction::Apply - applyflags=13
2024-02-27 11:29:21, Info CSI 00000058 Creating NT transaction (seq 1)
2024-02-27 11:29:21, Info CSI 00000059 Created NT transaction (seq 1) result 0x00000000, handle @0x1348
2024-02-27 11:29:21, Info CSI 0000005a Transaction UoW: {e5907b5e-d557-11ee-863f-c0b6f9fbdb86} for BeginTransaction
2024-02-27 11:29:21, Info CBS FLOW: Enter Installation Stage: Commit Primitive, Current Operation Stage: Installing
2024-02-27 11:29:21, Error CSI 0000005b@2024/2/27:10:29:21.792 (F) onecore\base\wcp\sil\ntsystem.cpp(4185): Error c019005a [Error,Facility=FACILITY_TRANSACTION,Code=90 (0x005a)] originated in function Windows::Rtl::SystemImplementation::DirectFileSystemProvider::SysSetInformationFile expression: (null)
[gle=0x80004005]
2024-02-27 11:29:21, Info CBS Added C:\WINDOWS\Logs\CBS\CBS.log to WER report.
2024-02-27 11:29:21, Info CBS Added C:\WINDOWS\Logs\CBS\CbsPersist_20240219210923.cab to WER report.
2024-02-27 11:29:21, Info CBS Not able to add pending.xml to Windows Error Report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Info CBS Not able to add pending.xml.bad to Windows Error Report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Info CBS Not able to add SCM.EVM to Windows Error Report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Info CBS Succesfully flushed NtfsLog.etl
2024-02-27 11:29:21, Info CBS Not able to add NtfsLog.etl to Windows Error Report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Error CSI 0000005c (F) c019005a [Error,Facility=FACILITY_TRANSACTION,Code=90 (0x005a)] #141312# from Windows::Rtl::SystemImplementation::DirectFileSystemProvider::SysSetInformationFile(flags = (AllowInvalidDeviceRequest|AllowNotSupported|AllowTypeMismatch|AllowNotSameDevice|AllowSharingViolation|AllowAccessDenied|0x00001c00), h = 7dc ('\Device\HarddiskVolume4\Windows\WinSxS\amd64_microsoft-windows-s..rogramsmenushortcut_31bf3856ad364e35_10.0.19041.1_none_f5ebc6e57eae8dde\Server Manager.lnk'), iosb = @0x28b2efbb20, b[gle=0xd019005a]
2024-02-27 11:29:21, Error CSI uff = @0x1846809b170, bufflen = 174, ic = 11, disp = Invalid)
[gle=0xd019005a]
2024-02-27 11:29:21, Error CSI 0000005d (F) c019005a [Error,Facility=FACILITY_TRANSACTION,Code=90 (0x005a)] #141307# from Windows::Rtl::SystemImplementation::CSystemIsolationLayer_IRtlSystemIsolationLayerTearoff::TransferFileEx(flags = (ReplaceIfExists|OpenForBackupIntent|SharingViolationIsOk|TransactionalConflictIsOk|CannotDeleteIsOk|DeletePendingIsOk|0x00008000), op = 'HardLinkWithCopyFallback', odir = NULL, oname = [l:136]'\SystemRoot\WinSxS\amd64_microsoft-windows-s..rogramsmenushortcut_31bf3856ad364e35_10.0.19041.1_none_f5ebc6e57ea[gle=0xd019005a]
2024-02-27 11:29:21, Error CSI e8dde\Server Manager.lnk, ndir = NULL, nname = [l:75]'\??\C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Server Manager.lnk', disp = Unmapped disposition: 0)
[gle=0xd019005a]
2024-02-27 11:29:21, Info CSI 0000005e Error c019005a [Error,Facility=FACILITY_TRANSACTION,Code=90 (0x005a)] while executing operation HardLinkFile on [l:213]'\SystemRoot\WinSxS\amd64_microsoft-windows-s..rogramsmenushortcut_31bf3856ad364e35_10.0.19041.1_none_f5ebc6e57eae8dde\Server Manager.lnk, \??\C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Server Manager.lnk'

2024-02-27 11:29:21, Info CSI 0000005f Creating NT transaction (seq 2)
2024-02-27 11:29:21, Info CSI 00000060 Created NT transaction (seq 2) result 0x00000000, handle @0x1348
2024-02-27 11:29:21, Info CSI 00000061 Transaction UoW: {e5907b73-d557-11ee-863f-c0b6f9fbdb86} for BeginTransaction
2024-02-27 11:29:21, Info CSI 00000062@2024/2/27:10:29:21.962 Beginning NT transaction commit...
2024-02-27 11:29:21, Info CSI 00000063 Transaction UoW: {e5907b73-d557-11ee-863f-c0b6f9fbdb86} for CommitTransaction
2024-02-27 11:29:21, Info CSI 00000064@2024/2/27:10:29:21.963 CSI perf trace:
CSIPERF:TXCOMMIT;42
2024-02-27 11:29:21, Info CBS Setting ExecuteState key to: ExecuteStateNone
2024-02-27 11:29:21, Info CBS Clearing HangDetect value
2024-02-27 11:29:21, Info CBS Saved last global progress. Current: 0, Limit: 1, ExecuteState: ExecuteStateNone
2024-02-27 11:29:21, Info CBS Cancelling: no transactions
2024-02-27 11:29:21, Info CBS Exec: Cancelled pending transactions after rollback. [HRESULT = 0x00000000 - S_OK]
2024-02-27 11:29:21, Error CBS Exec: An error occurred while committing the transaction, the transaction has been rolled back. [HRESULT = 0x800f0922 - CBS_E_INSTALLERS_FAILED]
2024-02-27 11:29:21, Info CBS Perf: InstallUninstallChain complete.
2024-02-27 11:29:21, Info CSI 00000065@2024/2/27:10:29:21.965 CSI Transaction @0x18468278980 destroyed
2024-02-27 11:29:21, Info CBS Failed to execute execution chain. [HRESULT = 0x800f0922 - CBS_E_INSTALLERS_FAILED]
2024-02-27 11:29:21, Error CBS Failed to process single phase execution. [HRESULT = 0x800f0922 - CBS_E_INSTALLERS_FAILED]
2024-02-27 11:29:21, Info CBS WER: Generating failure report for package: Microsoft-Windows-ActiveDirectory-DS-LDS-Tools-FoD-Package~31bf3856ad364e35~amd64~~10.0.19041.1, status: 0x800f0922, failure source: Execute, start state: Staged, target state: Staged, client id: SystemSettings
2024-02-27 11:29:21, Info CBS Not able to query DisableWerReporting flag. Assuming not set... [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Info CBS Added C:\WINDOWS\Logs\CBS\CBS.log to WER report.
2024-02-27 11:29:21, Info CBS Added C:\WINDOWS\Logs\CBS\CbsPersist_20240219210923.cab to WER report.
2024-02-27 11:29:21, Info CBS Not able to add %windir%\winsxs\pending.xml to WER report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:21, Info CBS Not able to add %windir%\winsxs\pending.xml.bad to WER report. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:22, Info CBS Reboot mark cleared
2024-02-27 11:29:22, Info CBS Winlogon: Simplifying Winlogon CreateSession notifications
2024-02-27 11:29:22, Info CBS Winlogon: Deregistering for CreateSession notifications
2024-02-27 11:29:22, Info CBS FinalCommitPackagesState: Started persisting state of packages
2024-02-27 11:29:22, Info CBS Reporting package change for package: Microsoft-Windows-ActiveDirectory-DS-LDS-Tools-FoD-Package~31bf3856ad364e35~amd64~~10.0.19041.1, current: Staged, pending: Default, start: Staged, applicable: Installed, target: Installed, limit: Installed, status: 0x0, failure source: Execute, reboot required: False, client id: SystemSettings, initiated offline: False, execution sequence: 93, first merged sequence: 93, reboot reason: REBOOT_NOT_REQUIRED, RM App session: -1, RM App name: N/A, FileName in use: N/A, release type: OnDemand Pack, OC operation: False, download source: 0, download time (secs): 4294967295, download status: 0x0 (S_OK), Express download: False, Download Size: 0
2024-02-27 11:29:23, Info CBS Reporting package change completion for package: Microsoft-Windows-ActiveDirectory-DS-LDS-Tools-FoD-Package~31bf3856ad364e35~amd64~~10.0.19041.1, current: Staged, original: Staged, target: Installed, status: 0x800f0922, failure source: Execute, failure details: "(null)", client id: SystemSettings, initiated offline: False, execution sequence: 93, first merged sequence: 93, pending decision: InteractiveInstallFailed, primitive execution context: Interactive
2024-02-27 11:29:23, Info CBS The store corruption status report is incomplete. [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
2024-02-27 11:29:23, Info CBS Execute time performance datapoint is invalid. [HRESULT = 0x80070490 - ERROR_NOT_FOUND]
2024-02-27 11:29:23, Info CBS FinalCommitPackagesState: Completed persisting state of packages
2024-02-27 11:29:23, Info CBS Enabling LKG boot option
2024-02-27 11:29:23, Info CBS Exec: Will not run corruption repair because no store corruption found.
2024-02-27 11:29:23, Info CBS Exec: Processing complete. Session: 31091047_3529074295, Package: Microsoft-Windows-ActiveDirectory-DS-LDS-Tools-FoD-Package~31bf3856ad364e35~amd64~~10.0.19041.1, Identifier: KB777778 [HRESULT = 0x800f0922 - CBS_E_INSTALLERS_FAILED]
...