microsoft / microsoft/winget-cli

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

Open
#4,146 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the command in the listed Windows Server 2022 and WinGet 1.6.2771 environment, comparing the failing install with a manual winget source update. The payload names no source files or tests, so trace the source-agreement handling from the CLI entry point and use the reported error output; done means explaining the failure and verifying that the install succeeds without the manual update.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, cpp
Domain
cli, devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.