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

choco list source with redirects does not resolve #171

Closed
fdcastel opened this issue Mar 14, 2015 · 5 comments
Closed

choco list source with redirects does not resolve #171

fdcastel opened this issue Mar 14, 2015 · 5 comments

Comments

@fdcastel
Copy link

Error: choco list -source: "Invalid URI: The hostname could not be parsed."

These both used to work in v0.9.8

choco list -source http://feeds.myrepo.com
choco list -source http://myrepo.com/nuget

(http://feeds.myrepo.com being a redirect (302) to http://myrepo.com/nuget)

However, in v0.9.9 this one works:

choco list -source http://myrepo.com/nuget

And this one fails

choco list -source http://feeds.myrepo.com
Chocolatey v0.9.9.2
Invalid URI: The hostname could not be parsed.
@ferventcoder
Copy link
Member

Since I may not have a good repro, can you give me the output of that with -dv?

@ferventcoder
Copy link
Member

Just the one that fails should be sufficient.

@fdcastel
Copy link
Author

Sure, Rob!

The bad one:

C:\Windows\system32>choco list -source http://feeds.myrepo.com -dv
Chocolatey v0.9.9.2
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" list -source http://feeds.myrepo.com -dv
Received arguments: list -source http://feeds.myrepo.com -dv

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='list'|
CacheLocation='C:\Users\MyUser\AppData\Local\Temp'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|Sources='http://feeds.myrepo.com'|
Debug='True'|Verbose='True'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|
PromptForConfirmation='True'|
AcceptLicense='False'|AllowUnofficialBuild='False'|AllVersions='False'|
SkipPackageInstallProvider='False'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.3.9600.0'|
Information.PlatformName='Windows 8.1'|
Information.ChocolateyVersion='0.9.9.2'|
Information.ChocolateyProductVersion='0.9.9.2'|
Information.FullName='choco, Version=0.9.9.2, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|Features.AutoUninstaller='False'|
Features.CheckSumFiles='True'|ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|
UpgradeCommand.FailOnUnfound='False'|
NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'|
FeatureCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'|
PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyListCommand - Normal Run Mode _
Searching for package information
Invalid URI: The hostname could not be parsed.
Exiting with 1

The good one:

C:\Windows\system32>choco list -source http://myrepo.com/nuget -dv
Chocolatey v0.9.9.2
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" list -source http://myrepo.com/nuget -dv
Received arguments: list -source http://myrepo.com/nuget -dv

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: CommandName='list'|
CacheLocation='C:\Users\MyUser\AppData\Local\Temp'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|
Sources='http://myrepo.com/nuget'|Debug='True'|
Verbose='True'|Force='False'|Noop='False'|HelpRequested='False'|
RegularOutput='True'|PromptForConfirmation='True'|
AcceptLicense='False'|
AllowUnofficialBuild='False'|AllVersions='False'|
SkipPackageInstallProvider='False'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.3.9600.0'|
Information.PlatformName='Windows 8.1'|
Information.ChocolateyVersion='0.9.9.2'|
Information.ChocolateyProductVersion='0.9.9.2'|
Information.FullName='choco, Version=0.9.9.2, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|Features.AutoUninstaller='False'|
Features.CheckSumFiles='True'|ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|
UpgradeCommand.FailOnUnfound='False'|
NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'|
FeatureCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'|
PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyListCommand - Normal Run Mode _
Searching for package information

((packages info follows))

@ferventcoder
Copy link
Member

I think we determined this may be a nuget 2.8.2 issue?

@ferventcoder
Copy link
Member

I think I have this resolved.

@ferventcoder ferventcoder changed the title choco list -source: "Invalid URI: The hostname could not be parsed." choco list source with redirects does not resolve Apr 20, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue Apr 20, 2015
Instead of the default NuGet HttpClient, the console uses a
RedirectedHttpClient by default that resolves the actual address by
following redirects. Chocolatey should also use this.
ferventcoder added a commit that referenced this issue Apr 20, 2015
* stable: (22 commits)
  (GH-121) Making Uninstall-ChocolateyZipPackage more robust when
deleting files that were copied during installation of the Zip package
  (doc) update changelog/nuspec
  (GH-238) ApiKey source matching intuitive
  (maint) formatting
  (GH-240) Set CredentialProvider for NuGet
  (GH-240) ChocolateyNugetCredentialProvider
  (GH-240) Add default sources to machine sources
  (maint) Only warn subcommand list if not empty
  (GH-171) Use RedirectedHttpClient
  (GH-240) pass credentials at runtime
  (GH-240)(config) Add machine sources
  (doc) how to quote values
  (GH-230) Export all functions and aliases imported
  (GH-230) Fix Issues with Generate/Remove BinFile
  (GH-185) Remove console prompt default choices
  (GH-186) Uninstall - no prompt for one version
  (GH-182) Ask before printing ps1 scripts
  (GH-187) Show log file path in messages.
  (maint) formatting
  (GH-169) Do not resolve disabled sources
  ...

Conflicts:
	src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs
	src/chocolatey/infrastructure.app/runners/GenericRunner.cs
@ferventcoder ferventcoder self-assigned this Jan 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants