microsoft / microsoft/winget-cli
Failing to upgrade packages - Scheduled Task
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
I created a scheduled SYSTEM task so Winget will upgrade in the background without user interaction. The task will run, but it does not update any of the packages.
I tested deployment to a small test environment with 8 devices, and 2 of the devices are getting the same errors.
Any feedback is greatly appreciated.
Steps to reproduce
- Created a scheduled task to run a PS1 script with Winget command:
winget upgrade --accept-source-agreements --accept-package-agreements --all --silent - Running .exe from SYSTEM accessible WindowApps directory
Expected behavior
I'd like for it to run in the background to keep apps updated, it works for most but not all of the devices I tested on. Winget works fine when updating manually via terminal.
Actual behavior
Winget runs but the logs cut off after checking Repo information. Logs from different days
2022-06-16 17:00:01.521 [CORE] OS: Windows.Desktop v10.0.19044.1766
2022-06-16 17:00:01.521 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.17.10941.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --accept-source-agreements --accept-package-agreements --all --silent
2022-06-16 17:00:01.521 [CORE] IsCOMCall:0; Caller: winget-cli
2022-06-16 17:00:01.522 [CLI ] WinGet invoked with arguments: 'upgrade' '--accept-source-agreements' '--accept-package-agreements' '--all' '--silent'
2022-06-16 17:00:01.523 [CLI ] Found subcommand: upgrade
2022-06-16 17:00:01.523 [CLI ] Leaf command to execute: root:upgrade
2022-06-16 17:00:01.524 [CLI ] Executing command: upgrade
2022-06-16 17:00:01.532 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2022-06-16 17:00:01.532 [REPO] Default source requested, multiple sources available, adding all to source references.
2022-06-16 17:00:01.532 [REPO] Adding to source references msstore
2022-06-16 17:00:01.533 [REPO] Adding to source references winget
2022-06-16 17:00:01.534 [REPO] Source past auto update time [5 mins]; it has been at least 438 mins
2022-06-16 17:00:01.535 [REPO] Source past auto update time [5 mins]; it has been at least 437 mins
2022-06-16 17:00:12.758 [REPO] Multiple sources available, creating aggregated source.
2022-06-16 17:00:12.758 [REPO] Adding to aggregated source: msstore
2022-06-16 17:00:12.758 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2022-06-16 17:00:13.048 [REPO] Response status: 200
2022-06-16 17:00:13.049 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2022-06-16 17:00:13.203 [REPO] Response status: 200
2022-06-16 17:00:13.203 [REPO] Adding to aggregated source: winget
2022-06-16 17:00:13.208 [REPO] Opening SQLite Index for Read at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\Microsoft.PreIndexed.Package\Microsoft.Winget.Source_8wekyb3d8bbwe\index.db'
2022-06-16 17:00:13.208 [SQL ] Opening SQLite connection: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\Microsoft.PreIndexed.Package\Microsoft.Winget.Source_8wekyb3d8bbwe\index.db' [1, 0]
2022-06-16 17:00:13.212 [REPO] Opened SQLite Index with version [1.3], last write [2022-06-16 10:30:24.000]
2022-06-16 17:00:13.255 [REPO] Creating PredefinedInstalledSource with filter [None]
2022-06-16 17:00:13.255 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:'
2022-06-16 17:00:13.255 [SQL ] Opening SQLite connection: ':memory:' [6, 0]
2022-06-16 17:00:13.282 [REPO] Examining ARP entries for Machine | X64
2022-06-16 17:00:13.290 [REPO] Examining ARP entries for Machine | X86
2022-06-16 17:00:13.299 [REPO] Examining ARP entries for User | X64
=============================================================
2022-06-20 11:37:53.125 [CORE] WinGet, version [1.2.0], activity [{8CA40935-CB82-468B-8D89-9B29B19F5569}]
2022-06-20 11:37:53.128 [CORE] OS: Windows.Desktop v10.0.19044.1766
2022-06-20 11:37:53.128 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.17.10941.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --accept-source-agreements --accept-package-agreements --all --silent --verbose-logs
2022-06-20 11:37:53.128 [CORE] IsCOMCall:0; Caller: winget-cli
2022-06-20 11:37:53.128 [CLI ] WinGet invoked with arguments: 'upgrade' '--accept-source-agreements' '--accept-package-agreements' '--all' '--silent' '--verbose-logs'
2022-06-20 11:37:53.128 [CLI ] Found subcommand: upgrade
2022-06-20 11:37:53.128 [CLI ] Leaf command to execute: root:upgrade
2022-06-20 11:37:53.129 [CORE] Setting action: Get, Type: Secure, Name: admin_settings
2022-06-20 11:37:53.129 [CORE] Admin settings was not found
2022-06-20 11:37:53.129 [CLI ] Executing command: upgrade
2022-06-20 11:37:53.132 [CORE] Setting action: Get, Type: Secure, Name: user_sources
2022-06-20 11:37:53.134 [CORE] Setting action: Get, Type: Standard, Name: sources_metadata
2022-06-20 11:37:53.138 [YAML] Detected UTF-8
2022-06-20 11:37:53.140 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2022-06-20 11:37:53.140 [REPO] Default source requested, multiple sources available, adding all to source references.
2022-06-20 11:37:53.140 [REPO] Adding to source references msstore
2022-06-20 11:37:53.140 [REPO] Adding to source references winget
2022-06-20 11:37:53.143 [CORE] Setting action: Get, Type: Secure, Name: user_sources
2022-06-20 11:37:53.143 [CORE] Setting action: Get, Type: Standard, Name: sources_metadata
2022-06-20 11:37:53.143 [YAML] Detected UTF-8
2022-06-20 11:37:53.143 [REPO] Source past auto update time [5 mins]; it has been at least 25 mins
2022-06-20 11:37:53.143 [CORE] Setting action: Set, Type: Standard, Name: sources_metadata
2022-06-20 11:37:53.144 [REPO] Source past auto update time [5 mins]; it has been at least 5437 mins
Environment
Windows Package Manager v1.2.10941
Windows: Windows.Desktop v10.0.19044.1766
Package: Microsoft.DesktopAppInstaller v1.17.10941.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the winget upgrade --accept-source-agreements --accept-package-agreements --all --silent entry point invoked by the SYSTEM scheduled task, comparing it with the manual terminal run. Use the supplied logs and environment versions to trace why execution stops after source metadata and ARP processing; done means identifying a reproducible cause and confirming upgrades complete on affected devices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100