Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winget source add doesn't warn you when adding an unsupported source. #1416

Closed
jedieaston opened this issue Aug 30, 2021 · 1 comment · Fixed by #1396
Closed

winget source add doesn't warn you when adding an unsupported source. #1416

jedieaston opened this issue Aug 30, 2021 · 1 comment · Fixed by #1396
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@jedieaston
Copy link
Contributor

jedieaston commented Aug 30, 2021

Brief description of your issue

winget source add doesn't warn you when adding an unsupported source.

Steps to reproduce

  1. Stand up a REST Source that only advertises support for version 1.1.0 of the schema, not 1.0.0.
  2. As an administrator, run winget source add -n <name of repo> <address of repo> --type "Microsoft.Rest"
  3. Notice that it returns zero and acts like everything is hunky-dory.
  4. 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
@ghost ghost added the Needs-Triage Issue need to be triaged label Aug 30, 2021
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Aug 30, 2021
@denelon denelon linked a pull request Aug 31, 2021 that will close this issue
@denelon
Copy link
Contributor

denelon commented Aug 31, 2021

This should be fixed in PR #1396

@denelon denelon closed this as completed Aug 31, 2021
@denelon denelon added this to the v1.3-Client milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants