Giter VIP home page Giter VIP logo

Comments (6)

florelis avatar florelis commented on June 2, 2024 1

That is HTTP_E_STATUS_BAD_METHOD "Method not allowed (405)." So it sounds to me like the deployment stack is trying to do some request to your web application that the server does not support. I don't know off the top of my head what it could be, but you may be able to find out by looking at the requests your server is receiving.

from msix-packaging.

florelis avatar florelis commented on June 2, 2024

You can get more details on the error by looking at the logs from App Installer. These are located in %LocalAppData%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\, either as TempState\AILog.txt or LocalState\DiagOutputDir\AppInstaller-<timestamp>.log

Does the .appinstaller file point to your web application or the Azure blob storage? If it is pointing to the blob storage, please try changing it to point to the web application. Regardless of the initial URI used to access the file, App Installer will then request the files from the URIs listed in the file to check for updates.

from msix-packaging.

MoodieG avatar MoodieG commented on June 2, 2024

Thanks for the reply.

The .appinstaller file points to the web application for both, the AppInstaller Uri and the MainPackage Uri.

I looked into the logs, and it seems like the app installer is failing due to error code "0x80070138"

Any idea what that error code means?

For reference, I was able to confirm that the .appinstaller is hitting my web application endpoint by placing a break point in the API implementation. If it helps, here is how my implementation looks like:

[HttpGet("{toolName}")]
public async Task<IActionResult> Get(string toolName)
{
    var blobServiceClient = this.storageSettings.GetBlobServiceClient();
    var toolBlob = blobServiceClient.GetBlobContainerClient("tools").GetBlobClient(toolName);

    if (!toolBlob.Exists())
    {
        return this.NotFound();
    }

    var tool = await toolBlob.DownloadContentAsync();
    var contentType = Path.GetExtension(toolName).ToUpperInvariant() switch
    {
        ".APPINSTALLER" => "application/appinstaller",
        ".MSIX" => "application/msix",
        _ => throw new NotSupportedException()
    };

    return this.File(tool.Value.Content.ToArray(), contentType);
}

from msix-packaging.

florelis avatar florelis commented on June 2, 2024

That error code is ERROR_NO_RANGES_PROCESSED "No ranges for the specified operation were able to be processed."

Does your web application support HTTP range requests?

Generally, the package is not downloaded completely and instead only specific pieces of the file are downloaded. For example, the manifest file and icon for showing the install prompt. Then, during actual installation, only the relevant architecture is fetched. For example, if you have a bundle that contains x86, x64 in English and French, only one arch and locale would be downloaded. To do that, HTTP range requests are used.

The error code sounds to me like an issue with those range requests, that could happen if your web application doesn't support them.

from msix-packaging.

MoodieG avatar MoodieG commented on June 2, 2024

Thanks so much! That indeed was the issue. I just had to enable range by changing the last line to

return this.File(tool.Value.Content.ToArray(), contentType, enableRangeProcessing: true);

Unfortunately, now I am getting a new error "Method not allowed". Here are the lines in the log that produced the error:

[Thu Mar 14 14:45:05 2024]{49192} [InstallFromUriAsync] -> Deploying AppInstaller extension file
[Thu Mar 14 14:45:05 2024]{49192} [InstallFromUriAsync] -> Starting AddPackageByUriAsync()
[Thu Mar 14 14:45:05 2024]{49192} DeploymentCompletionCallback
[Thu Mar 14 14:45:05 2024]{49192} DeploymentCompletionCallback -> Install Operation Failed. Error Code: 0x80190195, Extended Error Code: 0x80190195
[Thu Mar 14 14:45:05 2024]{49192} DeploymentCompletionCallback -> fallbackErrorText: Appinstaller operation failed with error code 0x80190195. Detail: Method not allowed (405). (0x80190195)

Any ideas on what could be wrong now?

from msix-packaging.

MoodieG avatar MoodieG commented on June 2, 2024

Hey, thanks a lot for your help.

It turned out that my API did not support an HTTP HEAD request. After fixing that, the "Method not allowed" error got resolved.

I did run into another error, where the app installer was stuck in installing the package. After some debugging, I noticed that my API implementation downloads the MSIX package fully on every range request call. I changed the implementation to cache the package in memory so the API does not keep redownloading the MSIX package when not needed.

A better implementation of my API may be to download only the bytes requested in the range header that I may look into improving in the future.

from msix-packaging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.