winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Winget fails to update source and install package when agreement flags are provided

Open Fedoop1 opened this issue 1 year ago • 3 comments

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

image

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

Fedoop1 avatar Feb 06 '24 17:02 Fedoop1

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.

denelon avatar Feb 06 '24 21:02 denelon

"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

Fedoop1 avatar Feb 07 '24 14:02 Fedoop1

Sorry, misclicked.

Fedoop1 avatar Feb 07 '24 14:02 Fedoop1