boxstarter
boxstarter copied to clipboard
Invoke-BoxstarterBuild errors out with "Can not access a closed Stream"
I have a package I am trying to create with a few files, some large (50mb).
New-BoxstarterPackage -Name MyPackage -Description "MyDescription" -Path "c:\files"
A new Chocolatey package has been created at C:\Users\sean.amos\AppData\Roaming\Boxstarter\BuildPackages\MyPackage.
You may now edit the files in this package and build the final .nupkg using Invoke-BoxstarterBuild.
Invoke-BoxstarterBuild MyPackage
Invoke-Command : Exception calling "Run" with "1" argument(s): "Can not access a closed Stream."
At C:\Users\sean.amos\AppData\Roaming\Boxstarter\Boxstarter.Common\Enter-DotNet4.ps1:38 char:9
+ Invoke-Command -ScriptBlock $ScriptBlock -argumentlist $Argum ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-Command], MethodInvocationException
+ FullyQualifiedErrorId : ObjectDisposedException,Microsoft.PowerShell.Commands.InvokeCommandCommand
It seems to be the call in the chocolatey wrapper invoke-chocolatey.ps1
that is blowing up, _choco.RunConsole(args);
@seanamosw is this still an issue?
I have encountered the same issue today when I include a SQL database of 190MB in a package dependency folder.
@aaronralls Just to be clear, that 190MB is inside the package or the package has a dependency on that 190MB package?
I have a dependency folder where I keep other items that need to get installed or supporting scripts. One of the items is a SQL Server database backup. That file is 190MB and I had the same issue with a smaller database base backup of 93MB. The largest file in that folder that did not have an issue was 5.6MB.
To be clear I am trying to include the database backups as part of the package.
@aaronralls I need the Boxstarter log for this. I can't reproduce.
Got this today while trying to include a 73MB zip file. Log attached. Below is the output that was not in the log.
Retrying this with a much smaller 2K file worked just fine.
PS C:\Users\rpresser> Invoke-BoxStarterBuild -name ARI.teamcityagent -Verbose
VERBOSE: Loading module from path 'C:\ProgramData\Boxstarter\Boxstarter.chocolatey\Boxstarter.chocolatey.psd1'.
VERBOSE: Importing function 'Enable-BoxstarterClientRemoting'.
VERBOSE: Importing function 'Enable-BoxstarterCredSSP'.
VERBOSE: Importing function 'Export-BoxstarterVars'.
VERBOSE: Importing function 'Get-BoxStarterConfig'.
VERBOSE: Importing function 'Get-PackageRoot'.
VERBOSE: Importing function 'Install-BoxstarterPackage'.
VERBOSE: Importing function 'Install-ChocolateyInstallPackageOverride'.
VERBOSE: Importing function 'Invoke-BoxStarterBuild'.
VERBOSE: Importing function 'Invoke-BoxstarterFromTask'.
VERBOSE: Importing function 'Invoke-Chocolatey'.
VERBOSE: Importing function 'Invoke-ChocolateyBoxstarter'.
VERBOSE: Importing function 'New-BoxstarterPackage'.
VERBOSE: Importing function 'New-PackageFromScript'.
VERBOSE: Importing function 'Resolve-VMPlugin'.
VERBOSE: Importing function 'Set-BoxStarterConfig'.
VERBOSE: Importing function 'Set-BoxstarterShare'.
VERBOSE: Importing function 'Write-HostOverride'.
VERBOSE: Importing alias 'Enable-BoxstarterVM'.
VERBOSE: Importing alias 'Install-ChocolateyInstallPackage'.
VERBOSE: Importing alias 'Write-Host'.
Attempting to build package from 'ARI.teamcityagent.nuspec'.
tools\instantclient-basic-windows.x64-12.2.0.1.0.zip
Invoke-Command : Exception calling "Run" with "1" argument(s): "Can not access a closed Stream."
At C:\ProgramData\Boxstarter\Boxstarter.Common\Enter-DotNet4.ps1:38 char:9
+ Invoke-Command -ScriptBlock $ScriptBlock -argumentlist $Argum ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-Command], MethodInvocationException
+ FullyQualifiedErrorId : ObjectDisposedException,Microsoft.PowerShell.Commands.InvokeCommandCommand
PS C:\Users\rpresser>
Hi, I am new to Boxstarter and I'm encountering the same issue.
This sounds similiar to an issue we had with cChoco - can you try this fix and confirm if it works or not?
Hi, I have tried the fix but it did not worked for me.
I still have the same issue for a .exe of 40mo, while the issue did not occured for a .exe of 7mo.
Hi, I went back to a previous version from 2015, and it works perfectly again.
I asked one of my colleague who have a working version if he could send me this file C:\ProgramData\Boxstarter\Boxstarter.Common\Enter-DotNet4.ps1 so I could compare his and mine, and this file did not existed back in 2015.
Having the same issue with a file of 33MB
Had to make a really strange workaround where i split the zip file into multiple files and then joined them together on installation.
This actually just prompted me to convert the package to a pure chocolatey package and drop boxstarter altogether
Still waiting for this to be fixed. Our biggest use case for creating packages is so that we can use chocolatey on machines with no internet access; therefore we need to include large files like MSIs within the package. This obstacle remains quite annoying. Any chance this is being worked on?
@rpresser I will try to look at this soon.