Winget fails to update source and install package when agreement flags are provided
Brief description of your issue
We call winget on Windows Server 2022 via Ansible and from time to time it fails to install the package due to failure in accepting the msstore source agreement. The problem is that we always pass --accept-source-agreements --accept-package-agreements flags and for me, it seems that this behavior is unexpected. A temporary fix fill be to call winget source update manually on a node where this error appears. What can be the reason for such behavior?
Steps to reproduce
winget install [any package] --accept-source-agreements --accept-package-agreements --disable-interactivity via ansible.windows.win_shell
Expected behavior
The package should be installed successfully without a manual source agreement
Actual behavior
Environment
Windows Package Manager v1.6.2771
Ansible core 2.15.3
Ansible connection: winrm
Ansible winrm transport: credssp
OS: Microsoft Windows Server 2o22 Standard
Version: 10.0.20348 Build 20348
Are these calls always coming from the same account in Windows?
The "msstore" source is requiring the agreement. That source can change the agreement from time to time, but if the agreement acceptance is explicitly passed for every install, I'd need verbose logs to begin to troubleshoot.
WinGet is experimental on Server 2022, but I don't think that has any bearing on this particular issue.
"Are these calls always coming from the same account in Windows?" - We notice such a problem only for new win users that use winget for the first time, or after clean installation.
Please feel free to find the error log attached. WinGet-2024-01-30-12-11-34.675.log
Sorry, misclicked.