
Hi ,
We were facing this issue while deploying a package into test machine. The deployment was stopped at step 4 with the error:
"The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A positional parameter cannot be found that accepts argument 'Package deployment failed as the extraction of the package zip file failed."
Looking at the Runbook file, the step 4 mentioned file named "AutoUpdateAOSService.ps1".
<Step>
<ID>4</ID>
<RunbookID>XYZ-runbook</RunbookID>
<MachineName>XYZ</MachineName>
<ServiceModelName>AOSService</ServiceModelName>
<ScriptToExecute>
<FileName>AutoUpdateAOSService.ps1</FileName>
<Automated>true</Automated>
<Description>update AOS service</Description>
</ScriptToExecute>
<DependentStepIDList>
<string>3</string>
</DependentStepIDList>
<StepType>Update</StepType>
</Step>
<Step>
Then drilling down further, I reached to the file named "dynamicspackagemanagement.psm1". This file is located in "J:\AosService\PackagesLocalDirectory\InstallationRecords\dynamicsax-<packageName>\tools\dynamicspackagemanagement.psm1".
function Install-AxPackage([string] $packageName, [string] $zipName, [string] $installPath, [string] $fileDrop,[string]$log)
{
$Global:log=$log
Initialize-Log
Write-Log "Install-AxPackage($packageName, $zipName, $installPath, $fileDrop, $log)"
# Handle compile metadata
$packageId = Get-PackageId -zipName:$zipName
if ($packageId.EndsWith('-compile'))
{
$installPath = Join-Path $installPath 'XppMetadata'
}
Write-Log "Got install target dir '$installPath'"
$packageId = Get-PackageId -zipName:$zipName
$contentZip = Join-Path $fileDrop $zipName
Write-Log "Unzipping file at '$contentZip' to '$installPath'"
$dynamicstoolsdir= join-path $env:SystemDrive "DynamicsTools"
$zipLocation = Join-Path $dynamicstoolsdir "7za.exe"
if(!(Test-Path $zipLocation)){
throw "Package deployment failed as the required Dynamics tools are missing at '$dynamicstoolsdir'."
}
Write-Log "Start-Process $zipLocation -ArgumentList `"x $contentZip -o$installPath -y -mmt`" -WindowStyle Hidden -PassThru"
$zip = Start-Process $zipLocation -ArgumentList "x $contentZip -o$installPath -y -mmt" -Wait -WindowStyle Hidden -PassThru
if($zip.ExitCode -ne "0")
{
throw "Package deployment failed as the extraction of the package zip file failed."
}
}
The text was found in that tile "Package deployment failed as the extraction of the package zip file failed." So I started debugging through windows powershell ISE. When I reached that particular condition which throws this error, I found out that the path to zip file which is located at "C:DeployablePackage\AOSService\Packages\files\<modelName>.zip" did not get the full path because it was truncated due to long directory path. the path was around 125 chars. I decided to change the name of root folder to make it a small. That worked for me.
Regards,
-Vishal Jevtani
*This post is locked for comments
I have the same question (0)