DSC stops setting configuration if `WinGet/Source` encounters "hash incompatible" error
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Beginne damit, die mitgelieferte Konfiguration mit dsc config set --file auszuführen und den Hash-Mismatch-Fehler aus der Ressource Microsoft.WinGet/Source zu reproduzieren. Verfolge, wie dieser Fehler durch die Ressourcenverarbeitung weitergegeben wird, und vergleiche dies mit den unabhängigen Einträgen von Microsoft.WinGet/Package. Als erledigt gilt die Aufgabe, wenn eine fehlgeschlagene Ressource gemeldet wird, während die Ausführung späterer unabhängiger Ressourcen fortgesetzt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hello! This is a copy of https://github.com/PowerShell/DSC/issues/1685#issuecomment-5374789253 because their team thinks that this is the problem with WinGet's declared resource. In short: winget fails checking hash, and dsc stops working because of that.
Here's a copy of the issue:
Summary
If WinGet has a package that is updated but the package manifest contains an outdated SHA-256 hash, it fails with this error:
> winget install -e --id PKI.NCALayer
Найдено NCALayer [PKI.NCALayer] Версия 1.4-260623
Download from https://ncl.pki.gov.kz/images/NCALayer/NCALayerInstall_x64.exe
██████████████████████████████ 63.7 MB / 63.7 MB
Installer hash does not match # <-- THIS
– that's expected, and can be skipped by supplying additional parameters.
The dsc, when underlying winget encounters the error, all of sudden stops working, See the error below.
That's unexpected behaviour for me as DSC user because the documentation says it work per-item:
The DSC resources handle the how for each instance.
The result for each instance...
Provides metadata about the operation as a whole and for each resource instance
I thought it is assumed that if one resource item fails, other proceed to be executed as independent (they are independent from each other, in config below).
Steps to reproduce
- Create this configuration:
Details
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.3
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
metadata:
winget:
processor:
identifier: "dscv3"
resources:
- name: winget_Microsoft.PreIndexed.Package
type: Microsoft.WinGet/Source
metadata:
description: "winget_Microsoft.PreIndexed.Package: настройка"
winget:
securityContext: "elevated"
properties:
type: "Microsoft.PreIndexed.Package"
trustLevel: "trusted"
argument: "https://cdn.winget.microsoft.com/cache"
name: "winget"
- name: winget_Logitech.GHUB
type: Microsoft.WinGet/Package
metadata:
description: "Установить Logitech.GHUB"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "Logitech.GHUB"
source: "winget"
- name: winget_Microsoft.GameInput
type: Microsoft.WinGet/Package
metadata:
description: "Установить Microsoft.GameInput"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "Microsoft.GameInput"
source: "winget"
- name: winget_NexusMods.Vortex
type: Microsoft.WinGet/Package
metadata:
description: "Установить NexusMods.Vortex"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "NexusMods.Vortex"
source: "winget"
- name: winget_ParadoxInteractive.ParadoxLauncher
type: Microsoft.WinGet/Package
metadata:
description: "Установить ParadoxInteractive.ParadoxLauncher"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "ParadoxInteractive.ParadoxLauncher"
source: "winget"
- name: winget_ElectronicArts.EADesktop
type: Microsoft.WinGet/Package
metadata:
description: "Установить ElectronicArts.EADesktop"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "ElectronicArts.EADesktop"
source: "winget"
- name: winget_EpicGames.EpicGamesLauncher
type: Microsoft.WinGet/Package
metadata:
description: "Установить EpicGames.EpicGamesLauncher"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "EpicGames.EpicGamesLauncher"
source: "winget"
- name: winget_Ubisoft.Connect
type: Microsoft.WinGet/Package
metadata:
description: "Установить Ubisoft.Connect"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "Ubisoft.Connect"
source: "winget"
- name: winget_Valve.Steam
type: Microsoft.WinGet/Package
metadata:
description: "Установить Valve.Steam"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "Valve.Steam"
source: "winget"
- name: winget_Blizzard.BattleNet
type: Microsoft.WinGet/Package
metadata:
description: "Установить Blizzard.BattleNet"
dependsOn:
- "[resourceId('Microsoft.WinGet/Source', 'winget_Microsoft.PreIndexed.Package')]"
properties:
id: "Blizzard.BattleNet"
source: "winget"
-
Verify with
dsc config test --file "E:\Сеть\gaming.winget"to see the syntax is correct; -
Try to apply the config
dsc config set --file "E:\Сеть\gaming.winget"- and you will encounter an error with SHA-256 mismatch; -
After the error happened, see that next items in the resource are not "set" (or installed, in terms of WinGet):
Details
PS> dsc config get --file "E:\Сеть\gaming.winget"
executionInformation:
duration: PT106.57571S
endDatetime: 2026-08-21T21:22:48.042501300+07:00
executionType: actual
operation: get
securityContext: restricted
startDatetime: 2026-08-21T21:21:01.466791300+07:00
version: 3.2.3
metadata:
Microsoft.DSC:
duration: PT106.5754106S
endDatetime: 2026-08-21T21:22:48.042201900+07:00
executionType: actual
operation: get
securityContext: restricted
startDatetime: 2026-08-21T21:21:01.466791300+07:00
version: 3.2.3
results:
- executionInformation:
duration: PT0.4021512S
metadata:
Microsoft.DSC:
duration: PT0.4021512S
name: winget_Microsoft.PreIndexed.Package
type: Microsoft.WinGet/Source
result:
actualState:
_exist: true
argument: https://cdn.winget.microsoft.com/cache
explicit: false
name: winget
trustLevel: trusted
type: Microsoft.PreIndexed.Package
- executionInformation:
duration: PT46.2572849S
metadata:
Microsoft.DSC:
duration: PT46.2572849S
name: winget_Logitech.GHUB
type: Microsoft.WinGet/Package
result:
actualState:
_exist: true
id: Logitech.GHUB
source: winget
useLatest: true
version: 2026.5.939708
- executionInformation:
duration: PT1.0847518S
metadata:
Microsoft.DSC:
duration: PT1.0847518S
name: winget_Microsoft.GameInput
type: Microsoft.WinGet/Package
result:
actualState:
_exist: true
id: Microsoft.GameInput
source: winget
useLatest: false
version: 3.3.221.0
- executionInformation:
duration: PT1.0564382S
metadata:
Microsoft.DSC:
duration: PT1.0564382S
name: winget_NexusMods.Vortex
type: Microsoft.WinGet/Package
result:
actualState:
_exist: true
id: NexusMods.Vortex
source: winget
useLatest: true
version: 2.5.0
- executionInformation:
duration: PT1.0319307S
metadata:
Microsoft.DSC:
duration: PT1.0319307S
name: winget_ParadoxInteractive.ParadoxLauncher
type: Microsoft.WinGet/Package
result:
actualState:
_exist: false
id: ParadoxInteractive.ParadoxLauncher
source: winget
- executionInformation:
duration: PT24.1893277S
metadata:
Microsoft.DSC:
duration: PT24.1893277S
name: winget_ElectronicArts.EADesktop
type: Microsoft.WinGet/Package
result:
actualState:
_exist: true
id: ElectronicArts.EADesktop
source: winget
useLatest: false
version: 13.443.0.5956
- executionInformation:
duration: PT1.044192S
metadata:
Microsoft.DSC:
duration: PT1.044192S
name: winget_EpicGames.EpicGamesLauncher
type: Microsoft.WinGet/Package
result:
actualState:
_exist: false
id: EpicGames.EpicGamesLauncher
source: winget
- executionInformation:
duration: PT1.0269845S
metadata:
Microsoft.DSC:
duration: PT1.0269845S
name: winget_Ubisoft.Connect
type: Microsoft.WinGet/Package
result:
actualState:
_exist: false
id: Ubisoft.Connect
source: winget
- executionInformation:
duration: PT23.4049799S
metadata:
Microsoft.DSC:
duration: PT23.4049799S
name: winget_Valve.Steam
type: Microsoft.WinGet/Package
result:
actualState:
_exist: true
id: Valve.Steam
source: winget
useLatest: true
version: 2.10.91.91
- executionInformation:
duration: PT1.0425187S
metadata:
Microsoft.DSC:
duration: PT1.0425187S
name: winget_Blizzard.BattleNet
type: Microsoft.WinGet/Package
result:
actualState:
_exist: false
id: Blizzard.BattleNet
source: winget
messages: []
hadErrors: false
Expected behavior
Once meet the error with one resource item, `dsc` should proceed to the next independent item.
Actual behavior
It stops working for all next entries once it gets error in underlying `winget`.
Error details
PS> dsc config set --file "E:\Сеть\gaming.winget"
2026-08-21T12:23:58.220183Z ERROR Failed to run process 'winget': Command: Resource 'winget' [exit code -1978335215] <E> [CLI ] Package hash verification failed. SHA256 in manifest [7684a4317d9963102e7ba4ed3820e8fc9d7f6fb70f70c3aa8eb5d9299e29affb] does not match download [273d053b130d4a3daae34b6bfac8775d8ef2b9bf5c86bb8a605de58ad8418612] with file size [161619120] and content type [application/x-msdownload]
<E> [CLI ] Terminating context: 0x8a150011 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\DownloadFlow.cpp:244
<E> [CLI ] Terminating context: 0x8a150011 at :0
2026-08-21T12:23:58.221775Z ERROR Error: Command: Resource 'winget' [exit code -1978335215] <E> [CLI ] Package hash verification failed. SHA256 in manifest [7684a4317d9963102e7ba4ed3820e8fc9d7f6fb70f70c3aa8eb5d9299e29affb] does not match download [273d053b130d4a3daae34b6bfac8775d8ef2b9bf5c86bb8a605de58ad8418612] with file size [161619120] and content type [application/x-msdownload]
<E> [CLI ] Terminating context: 0x8a150011 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\DownloadFlow.cpp:244
<E> [CLI ] Terminating context: 0x8a150011 at :0
Environment data
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.6.5
PSEdition Core
GitCommitId 7.6.5
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
3.2.3
Visuals
No response
- Vorherrschende Sprache
- C++
- Sterne
- 26.6k
- Forks
- 1.8k
- Ø Merge
- 3 T. 10 Std.
- Gemergte PRs (30 T.)
- 41
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/winget-cli
-
Issue-Docs Needs-Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
microsoft/winget-cli#6692 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Issue-Docs Possible-Duplicate
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microsoft/winget-cli#6493 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Issue-Feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoft/winget-cli#6427 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Issue-Docs msstore
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
microsoft/winget-cli#6331 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Command-Source Issue-Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoft/winget-cli#6148 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in microsoft/winget-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
stratum-mining/sv2-tp#167 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Sign up button opens the Sign in page instead of the Sign up page for Enterprise edition serversOffenauth bug ui/ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
MerginMaps/mobile#4795 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
HarperFast/rocksdb-js#1118 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CollaboraOnline/online#16421 · 1 Kommentar ·