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

Handle null items better #853

Closed
ferventcoder opened this issue Jul 8, 2016 · 2 comments
Closed

Handle null items better #853

ferventcoder opened this issue Jul 8, 2016 · 2 comments
Assignees
Milestone

Comments

@ferventcoder
Copy link
Member

There are some errors like

[ERROR] - Value cannot be null.
Parameter name: path

That tend to crop up when things do not install correctly. Handle these better.

@ferventcoder ferventcoder added this to the 0.9.10.4 milestone Jul 8, 2016
@ferventcoder ferventcoder self-assigned this Jul 8, 2016
@caleyg
Copy link

caleyg commented Jul 9, 2016

Greetings-

I'm seeing something similar while trying to do choco install .\selenium-standalone-server --noop --debug --verbose

PS C:\choco-utils> choco install .\selenium-standalone-server --noop --debug --verbose
Chocolatey is running on Windows v 6.2.9200.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" install .\selenium-standalone-server --noop --debug --verbose
Received arguments: install .\selenium-standalone-server --noop --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source '' evaluated to a 'normal' source type

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='install'|
CacheLocation='C:\Users\Administrator\AppData\Local\Temp\2\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
SourceType='normal'|Debug='True'|Verbose='True'|Force='False'|
Noop='True'|HelpRequested='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='.\selenium-standalone-server'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='.\selenium-standalone-server'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
IgnoreDependencies='False'|AllowMultipleVersions='False'|
AllowDowngrade='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.2.9200.0'|
Information.PlatformName='Windows Server 2012'|
Information.ChocolateyVersion='0.9.10.2'|
Information.ChocolateyProductVersion='0.9.10.2'|
Information.FullName='choco, Version=0.9.10.2, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|`
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Features.AutoUninstaller='True'|
Features.CheckSumFiles='True'|Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyInstallCommand - Noop Mode _
Chocolatey would have used NuGet to install packages (if they are not already installed):
.\selenium-standalone-server
Attempting to create directory "C:\Users\Administrator\AppData\Local\Temp\2\Chocolatey\TempInstalls_20160709_173543_56
42".
Chocolatey had an error occur:
System.NullReferenceException: Object reference not set to an instance of an object.
   at chocolatey.infrastructure.app.nuget.NugetCommon.GetRemoteRepository(ChocolateyConfiguration configuration, ILogg
er nugetLogger)
   at chocolatey.infrastructure.app.nuget.NugetCommon.GetPackageManager(ChocolateyConfiguration configuration, ILogger
 nugetLogger, Action`1 installSuccessAction, Action`1 uninstallSuccessAction, Boolean addUninstallHandler)
   at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action`1 continu
eAction)
   at chocolatey.infrastructure.app.services.NugetService.install_noop(ChocolateyConfiguration config, Action`1 contin
ueAction)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_action(ChocolateyConfigura
tion config, Action`1 action)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_noop(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.runners.GenericRunner.find_command(ChocolateyConfiguration config, Container conta
iner, Boolean isConsole, Action`1 parseArgs)
   at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boo
lean isConsole, Action`1 parseArgs)
   at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Cont
ainer container)
   at chocolatey.console.Program.Main(String[] args)
Exiting with 1

@caleyg
Copy link

caleyg commented Jul 9, 2016

so I was doing choco install .\selenium-standalone-server --noop --debug —verbose instead of choco install .\selenium-standalone-server.2.53.1.nupkg --noop --debug —verbose

It executed fine now. .\selenium-standalone-server was the unpacked nupkg

@ferventcoder ferventcoder changed the title Handle null paths better Handle null items better Jul 13, 2016
ferventcoder added a commit that referenced this issue Jul 24, 2016
When a path is empty or null, handle it with either better error
messaging or work around the issue.

- Do not allow combining paths when the left side is null.
- When attempting to get files from a directory, if the directory value
   is empty, do not perform the search.
- When splitting strings, attempt to always remove empty entries.
- Check null or empty for strings
ferventcoder added a commit that referenced this issue Jul 24, 2016
* stable:
  (maint) Skip log PowerShell resource assembly failures
  (GH-871) Fix - Uninstall zip: Path is empty string
  (maint) remove unused import
  (GH-854) Reset Exit Code between package runs
  (GH-852) Bump up the default log sizes
  (GH-867) NuGet.Core Errors Exit Code 1
  (GH-853) Handle null values better
  (GH-836) Fix - Use 32 bit 7zip
  (GH-847) Tab Completion Enhancements
  (GH-857) Fix - Sometimes paths contain null chars
ferventcoder added a commit that referenced this issue Aug 10, 2016
Do not remove empty entries in the case of prompt for choice, which is
determining if a string contains `&` so it can build the labels
properly.

This is a partial reversion of what was introduced by 401335b.
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