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

installing package from a local source that doesn't exist throws a bogus message #1674

Closed
yishaigalatzer opened this Issue Nov 2, 2015 · 12 comments

Comments

Projects
None yet
6 participants
@yishaigalatzer

yishaigalatzer commented Nov 2, 2015

Run the following command from Power Shell, of course make sure the folder c:\temp\data does not exist on your machine

PM> install-package Rules -source c:\temp\data
install-package : Unable to find package 'Rules'
At line:1 char:1
+ install-package Rules -source c:\temp\data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

The error says Unable to find package 'Rules' instead of cannot find the folder (or a mix of the two)

@yishaigalatzer yishaigalatzer added this to the 3.4 milestone Dec 10, 2015

@yishaigalatzer yishaigalatzer modified the milestones: 3.4 Beta, 3.4 RTM Feb 25, 2016

@yishaigalatzer yishaigalatzer modified the milestones: 3.4 RTM, 3.4 RTM - Triage, 3.5 Beta Mar 11, 2016

@yishaigalatzer yishaigalatzer modified the milestones: 3.5 Beta, 3.5 RC Apr 8, 2016

@mishra14 mishra14 modified the milestones: 3.5 RTM, 3.6 Beta Jul 6, 2016

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 8, 2016

Contributor

@rohit21agrawal @yishaigalatzer @harikmenon @rrelyea

Please let me know if this looks fine?

Case 1 - invalid local path

PM> install-package Rules -source c:\temp\data
install-package : Unable to find package 'Rules' at source 'c:\temp\data'. Source not found.
At line:1 char:1
+ install-package Rules -source c:\temp\data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:00.0579984

Case 2 - Invalid http path that does not contain the package

PM> install-package Rules -source http://example.com
install-package : An error occurred while retrieving package metadata for 'Rules' from source 'http://example.com'.
  The V2 feed at 'http://example.com/FindPackagesById()?id='Rules'' returned an unexpected status code '404 Not Found'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 3 - Random String as path

PM> install-package Rules -source random-string
install-package : Unsupported type of source  'random-string'. Please provide an http or local source.
At line:1 char:1
+ install-package Rules -source random-string
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:00.0547044
Contributor

mishra14 commented Jul 8, 2016

@rohit21agrawal @yishaigalatzer @harikmenon @rrelyea

Please let me know if this looks fine?

Case 1 - invalid local path

PM> install-package Rules -source c:\temp\data
install-package : Unable to find package 'Rules' at source 'c:\temp\data'. Source not found.
At line:1 char:1
+ install-package Rules -source c:\temp\data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:00.0579984

Case 2 - Invalid http path that does not contain the package

PM> install-package Rules -source http://example.com
install-package : An error occurred while retrieving package metadata for 'Rules' from source 'http://example.com'.
  The V2 feed at 'http://example.com/FindPackagesById()?id='Rules'' returned an unexpected status code '404 Not Found'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 3 - Random String as path

PM> install-package Rules -source random-string
install-package : Unsupported type of source  'random-string'. Please provide an http or local source.
At line:1 char:1
+ install-package Rules -source random-string
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:00.0547044
@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jul 8, 2016

Contributor

a random string can be the name of a source in the nuget.config file

Contributor

rohit21agrawal commented Jul 8, 2016

a random string can be the name of a source in the nuget.config file

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 8, 2016

Contributor

Yes. As we discussed offline, I will be removing the check for that. Thanks!

Contributor

mishra14 commented Jul 8, 2016

Yes. As we discussed offline, I will be removing the check for that. Thanks!

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 8, 2016

Contributor

@yishaigalatzer @harikmenon @rrelyea

Please let me know if this looks fine?

I have edited them, based on feedback from @rohit21agrawal .

Case 1 - invalid local path

PM> install-package Rules -source c:\temp\data

install-package : Unable to find package 'Rules' at source 'c:\temp\data'. Source not found.
At line:1 char:1
+ install-package Rules -source c:\temp\data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 2 - Valid http path that does not contain the package

PM> install-package Rules -source http://example.com
install-package : An error occurred while retrieving package metadata for 'Rules' from source 'http://example.com'.
  The V2 feed at 'http://example.com/FindPackagesById()?id='Rules'' returned an unexpected status code '404 Not Found'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 3 - Random String as path

PM> install-package Rules -source nuget.random
install-package : Unsupported type of source  'nuget.random'. Please provide an http or local source.
At line:1 char:1
+ install-package Rules -source nuget.random
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 4 - Known source

PM> install-package Rules -source nuget.org
install-package : Unable to find package 'Rules'
At line:1 char:1
+ install-package Rules -source nuget.org
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Contributor

mishra14 commented Jul 8, 2016

@yishaigalatzer @harikmenon @rrelyea

Please let me know if this looks fine?

I have edited them, based on feedback from @rohit21agrawal .

Case 1 - invalid local path

PM> install-package Rules -source c:\temp\data

install-package : Unable to find package 'Rules' at source 'c:\temp\data'. Source not found.
At line:1 char:1
+ install-package Rules -source c:\temp\data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 2 - Valid http path that does not contain the package

PM> install-package Rules -source http://example.com
install-package : An error occurred while retrieving package metadata for 'Rules' from source 'http://example.com'.
  The V2 feed at 'http://example.com/FindPackagesById()?id='Rules'' returned an unexpected status code '404 Not Found'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 3 - Random String as path

PM> install-package Rules -source nuget.random
install-package : Unsupported type of source  'nuget.random'. Please provide an http or local source.
At line:1 char:1
+ install-package Rules -source nuget.random
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Case 4 - Known source

PM> install-package Rules -source nuget.org
install-package : Unable to find package 'Rules'
At line:1 char:1
+ install-package Rules -source nuget.org
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
@harikmenon

This comment has been minimized.

Show comment
Hide comment

harikmenon commented Jul 9, 2016

:shipit:

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Jul 12, 2016

Contributor

Case 2 seems confusing. Why do we talk about package metadata?

Contributor

rrelyea commented Jul 12, 2016

Case 2 seems confusing. Why do we talk about package metadata?

@alpaix

This comment has been minimized.

Show comment
Hide comment
@alpaix

alpaix Jul 14, 2016

When the implementation PR is pushed we need to add end-to-end tests for each of the cases.

alpaix commented Jul 14, 2016

When the implementation PR is pushed we need to add end-to-end tests for each of the cases.

@mishra14 mishra14 closed this Jul 14, 2016

@mishra14 mishra14 reopened this Jul 14, 2016

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 15, 2016

Contributor

@harikmenon : Realized that we cant have different error message for a random string, since its treated as a local relative string ( like a local folder name!). So the case 3 would be updated to the following -

Update Case 3 -

PM> install-package Rules -source nuget.random
install-package : Unable to find package 'Rules' at source 'nuget.random'. Source not found.
At line:1 char:1
+ install-package Rules -source nuget.random
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], PackageSourceException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Let me know your thoughts or if this is fine?

cc : @rohit21agrawal @rrelyea @yishaigalatzer

Contributor

mishra14 commented Jul 15, 2016

@harikmenon : Realized that we cant have different error message for a random string, since its treated as a local relative string ( like a local folder name!). So the case 3 would be updated to the following -

Update Case 3 -

PM> install-package Rules -source nuget.random
install-package : Unable to find package 'Rules' at source 'nuget.random'. Source not found.
At line:1 char:1
+ install-package Rules -source nuget.random
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], PackageSourceException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Let me know your thoughts or if this is fine?

cc : @rohit21agrawal @rrelyea @yishaigalatzer

@harikmenon

This comment has been minimized.

Show comment
Hide comment
@harikmenon

harikmenon Jul 15, 2016

Sounds good to me.

harikmenon commented Jul 15, 2016

Sounds good to me.

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 16, 2016

Contributor

@harikmenon : Had an offline talk with @rrelyea about the complexity of the error message in Case 2.

I will update that to the following, simpler error message -

Update Case 2 -

install-package : Unable to find package 'Rules' at source 'http://example.com'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Let me know if this looks fine?

cc : @rohit21agrawal @yishaigalatzer

Contributor

mishra14 commented Jul 16, 2016

@harikmenon : Had an offline talk with @rrelyea about the complexity of the error message in Case 2.

I will update that to the following, simpler error message -

Update Case 2 -

install-package : Unable to find package 'Rules' at source 'http://example.com'.
At line:1 char:1
+ install-package Rules -source http://example.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Let me know if this looks fine?

cc : @rohit21agrawal @yishaigalatzer

@harikmenon

This comment has been minimized.

Show comment
Hide comment

harikmenon commented Jul 18, 2016

:shipit:

@mishra14

This comment has been minimized.

Show comment
Hide comment
@mishra14

mishra14 Jul 20, 2016

Contributor

Original issue commits : NuGet/NuGet.Client@0f83bee NuGet/NuGet.Client@779f2bb

Improved Case 2 error message commit : NuGet/NuGet.Client@370687d

End to End test cases commit : NuGet/NuGet.Client@018ebd6

Contributor

mishra14 commented Jul 20, 2016

Original issue commits : NuGet/NuGet.Client@0f83bee NuGet/NuGet.Client@779f2bb

Improved Case 2 error message commit : NuGet/NuGet.Client@370687d

End to End test cases commit : NuGet/NuGet.Client@018ebd6

@mishra14 mishra14 closed this Jul 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment