Closed lukargit closed 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Can you try running the export command outside of DSC? I'm almost certain this is an issue caused by WinGet being run in system context, so knowing if it works outside of a DSC script will help determine the root cause
@Trenly it runs fine outside of DSC on the same machine. This same DSC config is working well on 350+ other machines, so running winget in system context is working well elsewhere. I can re-image the machine and likely resolve the issue for us, but I wanted to keep it around in case there is additional data that could be useful in getting to a root cause.
Any updates on action we can take here to continue the investigation? This has started occurring on more machines after they are working fine for some time (weeks). Our only mitigation at this point is to reimage them, after which winget export
works fine again.
Is this still happening with WinGet 1.8?
@denelon we have not run into this since upgrading to 1.8.1911
. At the rate it was occurring, if the bug still existed I would expect at least one machine to have run into it, so i'm good with closing this. I can create a new issue if we run into it again.
I have two systems, deployed with the same OS and tools. One is failing unless I run as the user, if I run as 'system' i get an error. The other works fine.
I checked the local security policy, couldn't find any differences. Same AV etc...
The only potential difference, is one has HyperV instaleld right now.
`PS C:\temp> winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22631.4037
System Architecture: X64
Winget Directories
------------------------------------------------------------------------------------------------------
Logs %TEMP%\WinGet\defaultState
User Settings %LOCALAPPDATA%\Microsoft\WinGet\Settings\defaultState\settings.json
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads C:\Users\Default\Downloads
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
PS C:\temp> whoami
nt authority\system
PS C:\temp> winget update
Name Id Version Available Source
-------------------------------------------------------------------------------------------------
Mozilla Firefox (x64 en-US) Mozilla.Firefox 129.0.1 129.0.2 winget
Google Chrome Google.Chrome 127.0.6533.120 128.0.6613.85 winget
Microsoft Edge WebView2 Runtime Microsoft.EdgeWebView2Runtime 127.0.2651.105 128.0.2739.42 winget
Microsoft Edge Microsoft.Edge 127.0.2651.105 128.0.2739.42 winget
4 upgrades available.`
System 2 -
`PS C:\Windows\system32> winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22631.4037
System Architecture: X64
Winget Directories
------------------------------------------------------------------------------------------------------
Logs %TEMP%\WinGet\defaultState
User Settings %LOCALAPPDATA%\Microsoft\WinGet\Settings\defaultState\settings.json
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads C:\Users\Default\Downloads
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
PS C:\Windows\system32> whoami
nt authority\system
PS C:\Windows\system32> winget update
Failed to open the predefined source; please report to winget maintainers.
An unexpected error occurred while executing the command:
0x80070490 : Element not found.
PS C:\Windows\system32> `
Brief description of your issue
We are using WinGet to install applications machine wide with Powershell DSC, and one of the test scripts is failing during the execution of
winget export
with this error:This is not a widespread issue and has only happened on one machine at this point, but it does reproduce 100% of the time on this machine. Note that winget is running under SYSTEM context.
Steps to reproduce
DSC runs (under SYSTEM context)
winget.exe export --include-versions --no-vt --accept-source-agreements --disable-interactivity --output exportedApps.json
during the test portion of a script resource, and that always fails with anElement not found
error.Expected behavior
The current list of installed applications is written to
exportedApps.json
Actual behavior
The export fails and no file is written.
Environment