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

adding parameters for choco packages causes error #88

Open
SonOfSafwat opened this issue Jul 2, 2020 · 3 comments
Open

adding parameters for choco packages causes error #88

SonOfSafwat opened this issue Jul 2, 2020 · 3 comments

Comments

@SonOfSafwat
Copy link

The following commands cause errors due to being obsolete:

  • choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'"

  • choco install -y Microsoft-Hyper-V-All --source="'windowsFeatures'"

  • choco install -y visualstudio2017community --package-parameters="'--add Microsoft.VisualStudio.Component.Git'"

  • choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'"

After checking chocolatey, I believe they changed how to reference params. Hence, I suggest updating those scripts and similar to the following

  • choco install -y git --params "/GitAndUnixToolsOnPath /WindowsTerminal"

  • choco install -y -source windowsfeatures Microsoft-Hyper-V-All

  • choco install -y visualstudio2017community --params="--add Microsoft.VisualStudio.Component.Git"

  • choco install -y -source windowsfeatures Microsoft-Windows-Subsystem-Linux

@gep13
Copy link
Collaborator

gep13 commented Jul 3, 2020

@ASafwatAli can you provide the log for what you are seeing?

Nothing should have changed from a Chocolatey stand point with regard to the options that you can pass to the install command.

@SonOfSafwat
Copy link
Author

Sure I’ll add the logs shortly. I can submit a PR with the fixes that worked for me.

@SonOfSafwat
Copy link
Author

@gep13 I've extracted some of the logs, but they're pretty big and contain personal information.
This is the log for choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'". Again Those errors disappeared as soon as I fixed the command parameters as mentioned.

I've also created a one click link with the mentioned 4 commands to test it out
http://boxstarter.org/package/url?https://raw.githubusercontent.com/ASafwatAli/win-dev-setup/choco-errors-test/choco-errors.ps1

`

  • Boxstarter starting Calling Chocolatey to install --package-parameters='/GitAndUnixToolsOnPath. This may take several minutes to complete...
  • Boxstarter starting Calling Chocolatey to install --package-parameters='/GitAndUnixToolsOnPath. This may take several minutes to complete...
    Installing the following packages:
    git
    By installing you accept licenses for the packages.
    [NuGet] Attempting to resolve dependency 'git.install (= 2.27.0)'.
    Progress: Downloading git.install 2.27.0... 41% Progress: Downloading git.install 2.27.0... 42% Progress: Downloading git.install 2.27.0... 100%
    Progress: Downloading git.install 2.27.0... 100%
    [NuGet] Attempting to resolve dependency 'chocolatey-core.extension (≥ 1.3.3)'.
    Progress: Downloading chocolatey-core.extension 1.3.5.1... 100%
    Progress: Downloading chocolatey-core.extension 1.3.5.1... 100%
    [NuGet] Attempting to resolve dependency 'chocolatey (≥ 0.10.7)'.
    Progress: Downloading chocolatey 0.10.15... 100%
    Progress: Downloading chocolatey 0.10.15... 100%
    Progress: Downloading git 2.27.0... 100%
    Progress: Downloading git 2.27.0... 100%
    [NuGet] Installing 'chocolatey-core.extension 1.3.5.1'.
    [NuGet] Successfully installed 'chocolatey-core.extension 1.3.5.1'.

chocolatey-core.extension v1.3.5.1 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
Installed/updated chocolatey-core extensions.
The install of chocolatey-core.extension was successful.
Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
[NuGet] Installing 'chocolatey 0.10.15'.
[NuGet] Successfully installed 'chocolatey 0.10.15'.

chocolatey v0.10.15 [Approved]
chocolatey package files install completed. Performing other installation steps.
ERROR: The string is missing the terminator: '.
The install of chocolatey was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall.ps1'.
See log for details.
[NuGet] Installing 'git.install 2.27.0'.
[NuGet] Successfully installed 'git.install 2.27.0'.

git.install v2.27.0 [Approved]
git.install package files install completed. Performing other installation steps.
ERROR: The string is missing the terminator: '.
The install of git.install was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\git.install\tools\chocolateyInstall.ps1'.
See log for details.
[NuGet] Installing 'git 2.27.0'.
[NuGet] Successfully installed 'git 2.27.0'.

git v2.27.0 [Approved]
git package files install completed. Performing other installation steps.
The install of git was successful.
Software install location not explicitly set, could be in package or
default install location if installer.

Chocolatey installed 2/4 packages. 2 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

  • chocolatey (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall.ps1'.
    See log for details.
  • git.install (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\git.install\tools\chocolateyInstall.ps1'.
    See log for details.
    Chocolatey reported an unsuccessful exit code of -1. See C:\Users\abdelrhmansafwat\AppData\Local\Boxstarter\boxstarter.log for details.
  • Boxstarter finished Calling Chocolatey to install --package-parameters='/GitAndUnixToolsOnPath. This may take several minutes to complete... 00:01:46.9910480
  • Boxstarter finished Calling Chocolatey to install --package-parameters='/GitAndUnixToolsOnPath. This may take several minutes to complete... 00:01:46.9910480
  • Boxstarter starting Calling Chocolatey to install /WindowsTerminal'. This may take several minutes to complete...
  • Boxstarter starting Calling Chocolatey to install /WindowsTerminal'. This may take several minutes to complete...
    Installing the following packages:
    /WindowsTerminal';git
    By installing you accept licenses for the packages.
    Boxstarter: Error from Chocolatey:

ErrorRecord : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
WasThrownFromThrowStatement : False
Message : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.ArgumentException: Second path fragment must not be a drive or UNC name.
Parameter name: path2
at System.IO.Path.InternalCombine(String path1, String path2)
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) at NuGet.PhysicalFileSystem.GetFiles(String path, String filter, Boolean recursive) at NuGet.LocalPackageRepository.<GetPackageFiles>d__31.MoveNext() at NuGet.LocalPackageRepository.<GetPackages>d__28.MoveNext() at NuGet.CollectionExtensions.AddRange[T](ICollection1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func2 openPackage, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action1 continueAction) at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func2 function)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action1 parseArgs) at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container) at CallSite.Target(Closure , CallSite , Object , Object ) TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception) StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec
t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.b__0()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsT
oTop, List1 variablesToDefine, Dictionary2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
at Microsoft.PowerShell.Commands.InvokeCommandCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087

Boxstarter: Error from Chocolatey:

ErrorRecord : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
WasThrownFromThrowStatement : False
Message : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.ArgumentException: Second path fragment must not be a drive or UNC name.
Parameter name: path2
at System.IO.Path.InternalCombine(String path1, String path2)
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) at NuGet.PhysicalFileSystem.GetFiles(String path, String filter, Boolean recursive) at NuGet.LocalPackageRepository.<GetPackageFiles>d__31.MoveNext() at NuGet.LocalPackageRepository.<GetPackages>d__28.MoveNext() at NuGet.CollectionExtensions.AddRange[T](ICollection1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func2 openPackage, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action1 continueAction) at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func2 function)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action1 parseArgs) at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container) at CallSite.Target(Closure , CallSite , Object , Object ) TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception) StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec
t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.b__0()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsT
oTop, List1 variablesToDefine, Dictionary2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
at Microsoft.PowerShell.Commands.InvokeCommandCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants