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

Add-AppxPackage : Deployment failed with HRESULT: 0x80080204, The Appx package's manifest is invalid. #9721

Open
2 tasks
Martin-Suska opened this issue Mar 2, 2023 · 7 comments

Comments

@Martin-Suska
Copy link

Windows Version

Microsoft Windows [Version 10.0.17763.3887]

WSL Version

N/A

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

N/A

Distro Version

Ubuntu 22.04 LTS

Other Software

No response

Repro Steps

I followed the instructions from https://learn.microsoft.com/en-us/windows/wsl/install-on-server

I downloaded Ubuntu2204-221101.AppxBundle which is downloaded, when clicked on a link from https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions from a browser.

Instructions says it should be with suffix .appx, but it's only when downloaded via command (Invoke-WebRequest/curl.exe, which I tried too - same file is downloaded).

Those 2 pages contains different instructions, but I tried both:

  • Add-AppxPackage .\Ubuntu2204-221101.AppxBundle
  • Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx
    • where Ubuntu_2204.1.7.0_x64.appx is extracted from Ubuntu2204-221101.AppxBundle

Expected Behavior

I expected it would work - install Ubuntu.

Actual Behavior

It failed with an error instead:

PS C:\download\Ubuntu> Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx
Add-AppxPackage : Deployment failed with HRESULT: 0x80080204, The Appx package's manifest is invalid.
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96,
Note: The schema for MaxVersionTested specified does not recognize XML fields with namespace
"http://schemas.microsoft.com/appx/manifest/uap/windows10/10". Please ensure that you have the correct
MaxVersionTested specified. Reason: The attribute
'{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element
'{http://schemas.microsoft.com/appx/manifest/foundation/window
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96,
Note: The schema for MaxVersionTested specified does not recognize XML fields with namespace
"http://schemas.microsoft.com/appx/manifest/uap/windows10/10". Please ensure that you have the correct
MaxVersionTested specified. Reason: The attribute
'{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element
'{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Application' is not defined in the DTD/Schema.
NOTE: For additional information, look for [ActivityId] 5a67827c-4ccc-0005-bf89-675acc4cd901 in the Event Log or use
the command line Get-AppPackageLog -ActivityID 5a67827c-4ccc-0005-bf89-675acc4cd901
At line:1 char:1
+ Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (C:\msuska\downl....1.7.0_x64.appx:String) [Add-AppxPackage], Exception
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

I'm on Windows Server 2019 Datacenter, version 1809 (which is 1709+ as mentioned on webpage).

Diagnostic Logs

No response

@Martin-Suska
Copy link
Author

Martin-Suska commented Mar 2, 2023

I was not able to provide wls version as it says invalid option:

PS C:\download\Ubuntu> wsl.exe --version
Invalid command line option: --version
Usage: wsl.exe [option] ...
Options:
    -d, --distribution <DistributionName>
        Launch the specified distribition.

    -e, --exec <CommandLine>
        Execute the specified Linux command. The remainder of the arguments are
        used as the command line to execute.

    -u, --user <UserName>
        Run as the specified user.

    --help
        Display this usage information.

    --
        Stop parsing arguments and pass the remainder to the Linux process.

@AndreaMontanari89
Copy link

AndreaMontanari89 commented Mar 7, 2023

Same here. I suppose that the command wsl.exe --version fails because it's the version 1 of WSL, but that's not the point.

I've tryed the wslubunt2004 and it works fine, but the wslubuntu2204 gave me the same error.

@Martin-Suska
Copy link
Author

Thanks @AndreaMontanari89 , based on your reply I used Ubuntu 20.04 without problems.

I compared manifests and I deleted xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10" which is not used in manifest anyway, so error above was solved, but there was another one:

PS C:\msuska\download> Add-AppxPackage .\Ubuntu2204-221101.AppxBundle
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened.
error 0x8007000D: Opening the package from location Ubuntu2204-221101.AppxBundle failed.
NOTE: For additional information, look for [ActivityId] 55e71190-5183-0003-1e1e-e7558351d901 in the Event Log or use the command line Get-AppPackageLog -ActivityID 55e71190-5183-0003-1e1e-e7558351d901
At line:1 char:1
+ Add-AppxPackage .\Ubuntu2204-221101.AppxBundle
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (C:\msuska\downl...1101.AppxBundle:String) [Add-AppxPackage], FileNotFoundException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

PS C:\msuska\download> Get-AppPackageLog -ActivityID 55e71190-5183-0003-1e1e-e7558351d901

Time                      ID           Message
----                      --           -------
2023-03-08 12:10:11       603          Started deployment Add operation on a package with main parameter Ubuntu2204-221101.AppxBundle and Options 0 and 0. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
2023-03-08 12:10:11       465          error 0x8007000D: Opening the package from location Ubuntu2204-221101.AppxBundle failed.
2023-03-08 12:10:11       403          error 0x8007000D: Failure to get staging session for: file:///C:/msuska/download/Ubuntu2204-221101.AppxBundle.
2023-03-08 12:10:11       404          AppX Deployment operation failed for package  with error 0x80073CF0. The specific error text for this failure is: error 0x8007000D: Opening the package from location Ubuntu2204-221101.AppxBundle failed.

@VireshMathapati13
Copy link

I am also facing the same issue with Ubuntu 22.04 LTS but no any issues with Ubuntu 20.04

Add-AppxPackage : Deployment failed with HRESULT: 0x80080204, The Appx package's manifest is invalid.
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96, Note: The schema for MaxVersionTested
specified does not recognize XML fields with namespace "http://schemas.microsoft.com/appx/manifest/uap/windows10/10". Please ensure that you have the correct
MaxVersionTested specified. Reason: The attribute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element
'{http://schemas.microsoft.com/appx/manifest/foundation/window
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96, Note: The schema for MaxVersionTested
specified does not recognize XML fields with namespace "http://schemas.microsoft.com/appx/manifest/uap/windows10/10". Please ensure that you have the correct
MaxVersionTested specified. Reason: The attribute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element
'{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Application' is not defined in the DTD/Schema.

@amobley1108
Copy link

I was able to accomplish by installing 20.04 and then upgrading it to 22.04 in the terminal.

@pv2b
Copy link

pv2b commented Dec 21, 2023

Same issue on Windows Server 2019 (Version 1809, OS Build 17763.5206)

Steps to reproduce:

  1. Install WSL with this powershell command: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Download Ubuntu2204-221101.AppxBundle and copy it into E:\WSLDistros
  3. See below:
PS E:\WSLDistros> Rename-Item .\Ubuntu2204-221101.AppxBundle .\Ubuntu2204-221101.AppxBundle.ZIP
PS E:\WSLDistros> expand-archive .\Ubuntu2204-221101.AppxBundle.ZIP .\Ubuntu2204-221101
PS E:\WSLDistros> cd .\Ubuntu2204-221101\
PS E:\WSLDistros\Ubuntu2204-221101> Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx
Add-AppxPackage : Deployment failed with HRESULT: 0x80080204, The Appx package's manifest is invalid.
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96, Note
: The schema for MaxVersionTested specified does not recognize XML fields with namespace "http://schemas.microsoft.com/
appx/manifest/uap/windows10/10". Please ensure that you have the correct MaxVersionTested specified. Reason: The attrib
ute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element '{http://schemas.microsoft
.com/appx/manifest/foundation/window
error 0xC00CE015: App manifest validation error: The app manifest must be valid as per schema: Line 22, Column 96, Note
: The schema for MaxVersionTested specified does not recognize XML fields with namespace "http://schemas.microsoft.com/
appx/manifest/uap/windows10/10". Please ensure that you have the correct MaxVersionTested specified. Reason: The attrib
ute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/10}Parameters' on the element '{http://schemas.microsoft
.com/appx/manifest/foundation/windows10}Application' is not defined in the DTD/Schema.
NOTE: For additional information, look for [ActivityId] aed04015-33f5-0002-5158-d0aef533da01 in the Event Log or use th
e command line Get-AppPackageLog -ActivityID aed04015-33f5-0002-5158-d0aef533da01
At line:1 char:1
+ Add-AppxPackage .\Ubuntu_2204.1.7.0_x64.appx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (E:\WSLDistros\U....1.7.0_x64.appx:String) [Add-AppxPackage], Exception
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

This is following steps from https://learn.microsoft.com/en-us/windows/wsl/install-on-server

@selimfelex
Copy link

selimfelex commented Feb 21, 2024

there is a missing extra step here for Windows 2019
you need to rename the appropriate package which ends with x64 again to .zip then extract it again to have the ubuntu.exe then run it and it will install , the manafist file resides inside each package
1- Rename the downloaded file Ubuntu2204.appx to Ubuntu2204_.zip, then extract this archive. Inside there are different appx files for different platforms. Choose the one for your platform, e.g. Ubuntu_2204.1.7.0_x64.appx.
2 - Rename the appx file for your platform again to Ubuntu2204.zip and extract this archive.
3- Extract the files in Ubuntu2204.zip to the target location where you would like your linux distro to reside.
4- Open the target location folder with the files of Ubuntu2204.zip extracted and run the file ubuntu.exe, which is located inside the folder. This will install the distribution

image image

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

6 participants