web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Package Deployment error "Package deployment failed as the extraction of the package zip file failed."

(0) ShareShare
ReportReport
Posted on by 278

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)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans