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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans