Repository navigation
Closed
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.
Milestone
Description
Brief description of your issue
winget source add doesn't warn you when adding an unsupported source.
Steps to reproduce
- Stand up a REST Source that only advertises support for version 1.1.0 of the schema, not 1.0.0.
- As an administrator, run
winget source add -n <name of repo> <address of repo> --type "Microsoft.Rest" - Notice that it returns zero and acts like everything is hunky-dory.
- Try to use winget show/install/list/upgrade/search and realize they don't work because even though your source added successfully, it isn't supported by this version of winget.
Expected behavior
An error when you try to add the unsupported source. (So winget should reach out to the information endpoint and check the ServerSupportedVersions then. Or, better yet, have the winget client be able to handle minor schema changes, as right now it can't talk to 1.1.0 REST sources even if I set the ServerSupportedVersions to 1.0.0 because it doesn't know to ignore the new fields. but that's probably a separate bug).
Actual behavior
PS C:\Users\easton> sudo winget source reset --force
Resetting all sources...Done
PS C:\Users\easton> sudo winget source add -n eastonsrepo https://10.211.55.2:8000 --type "Microsoft.Rest"
Adding source:
eastonsrepo -> https://10.211.55.2:8000
Done
PS C:\Users\easton> winget show --source eastonsrepo --id Microsoft.EdgeBeta --exact
Failed to open the source; try the 'source reset' command if the problem persists.
An unexpected error occurred while executing the command:
0x8a150038 : The configured rest source is not supported
PS C:\Users\easton> winget install Google.Chrome
Failed to open the source; try the 'source reset' command if the problem persists.
An unexpected error occurred while executing the command:
0x8a150038 : The configured rest source is not supported
PS C:\Users\easton> ((iwr https://10.211.55.2:8000/information/).Content | ConvertFrom-JSON).Data
SourceIdentifier : A WinGet source!
SourceAgreements :
ServerSupportedVersions : {1.1.0}
UnsupportedPackageMatchFields :
RequiredPackageMatchFields :
UnsupportedQueryParameters :
RequiredQueryParameters :
PS C:\Users\easton> # But you said 'adding source.... done' :(
Environment
[winget --info]
Windows Package Manager version 1.0.11694
Windows: Windows.Desktop version 10.0.22000.168
Package: Microsoft.DesktopAppInstaller version 1.15.11694.0
Any other software? I believe Microsoft Solitaire Collection is installed, if that changes anything :D
Metadata
Metadata
Assignees
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.
Activity
denelon commentedon Aug 31, 2021
This should be fixed in PR #1396