microsoft / msstore-cli

Microsoft Store CLI
MIT License
80 stars 8 forks source link

msstore publish - Not publishing anything or 0 files #50

Closed clFaster closed 3 months ago

clFaster commented 3 months ago

I'm trying to create an update for my application using the msstore-cli. The application is a MAUI project for Windows desktops. I've successfully configured the CLI; I can list all my apps, view open submissions, and so on.

To create a new app version, I run the following commands:

msstore package -ver 1.1.1.1
msstore publish -i .\AppPackages\XXXXX_1.1.1.1_X64_Test\ -id XXXXXXXXXXXX -nc

Both commands run successfully, but when I check the newly created submission in the Microsoft Partner Center, everything is marked as "unchanged" and no new package is published.

I ran the msstore publish command with the -v flag, and after the Ok! Found the app! AppId: XXXX log, the following message appears: info: MSStore.CLI.ProjectConfigurators.MauiProjectConfigurator[0] Trying to publish these 0 files:.

What am I doing wrong here? The MSIX file I want to publish exists in the folder, and if I manually upload the file in the Microsoft Partner Center, it uploads and validates successfully.

azchohfi commented 3 months ago

This seems to be a bug. I believe MAUI changed the default output folder for new projects, as well as compilation settings, which broke our package command. I'm working on a fix.

clFaster commented 3 months ago

Thank you for the update. The app is now packaged, and the msix file is included in the published zip. However, the submission to the Microsoft Store is still missing the new msix file. Probably thats a configuration issue on my end. 🤔

clFaster commented 3 months ago

Seems like after removing the -nc flag on the publish command it works nearly as expected (msix gets added to the submission).

msstore package -ver 1.1.1.1
msstore publish -id XXXXXXXXXXXX

Now my workflow is also stuck at CommitStarted -> Issue: https://github.com/microsoft/msstore-cli/issues/29

azchohfi commented 3 months ago

Commit needs to be called one way or another. The -nc should be used only if you want to call msstore submission update command to update some metadata of the submission, or something else, to only then call the msstore submission commit. How long is the submission stuck at CommitStarted?

clFaster commented 3 months ago

It's stuck for about an hour on CommitStarted and then an exception is thrown. When I manually click the Submit for Certification button in the Partner Center while the command is still executing, it ends successfully.

image

Submission Status - CommitStarted
Unhandled exception: MSStore.API.MSStoreException: { "statusCode": 401, "message": "APIM: Unauthorized. Access token is missing or invalid." }
   at MSStore.API.SubmissionClient.InvokeAsync[T](HttpMethod httpMethod, String relativeUrl, Object requestContent, CancellationToken ct) in /_/MSStore.API/SubmissionClient.cs:line 290
   at MSStore.API.Packaged.StorePackagedAPI.GetSubmissionStatusAsync(String productId, String submissionId, CancellationToken ct) in /_/MSStore.API/Packaged/StorePackagedAPI.cs:line 323
   at MSStore.CLI.Helpers.IStorePackagedAPIExtensions.EnumerateSubmissionStatusAsync(IStorePackagedAPI storePackagedAPI, String productId, String flightId, String submissionId, Boolean waitFirst, CancellationToken ct)+MoveNext() in /_/MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs:line 166
   at MSStore.CLI.Helpers.IStorePackagedAPIExtensions.EnumerateSubmissionStatusAsync(IStorePackagedAPI storePackagedAPI, String productId, String flightId, String submissionId, Boolean waitFirst, CancellationToken ct)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at MSStore.CLI.Helpers.IStorePackagedAPIExtensions.PollSubmissionStatusAsync(IStorePackagedAPI storePackagedAPI, String productId, String flightId, String submissionId, Boolean waitFirst, ILogger logger, CancellationToken ct) in /_/MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs:line 183
   at MSStore.CLI.Helpers.IStorePackagedAPIExtensions.PollSubmissionStatusAsync(IStorePackagedAPI storePackagedAPI, String productId, String flightId, String submissionId, Boolean waitFirst, ILogger logger, CancellationToken ct) in /_/MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs:line 183
   at MSStore.CLI.Helpers.IStorePackagedAPIExtensions.PublishAsync(IStorePackagedAPI storePackagedAPI, DevCenterApplication app, String flightId, FirstSubmissionDataCallback firstSubmissionDataCallback, AllowTargetFutureDeviceFamily[] allowTargetFutureDeviceFamilies, DirectoryInfo output, IEnumerable`1 input, Boolean noCommit, IBrowserLauncher browserLauncher, IConsoleReader consoleReader, IZipFileManager zipFileManager, IFileDownloader fileDownloader, IAzureBlobManager azureBlobManager, IEnvironmentInformationService environmentInformationService, ILogger logger, CancellationToken ct) in /_/MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs:line 603
   at MSStore.CLI.ProjectConfigurators.FileProjectConfigurator.PublishAsync(String pathOrUrl, DevCenterApplication app, String flightId, DirectoryInfo inputDirectory, Boolean noCommit, IStorePackagedAPI storePackagedAPI, CancellationToken ct) in /_/MSStore.CLI/ProjectConfigurators/FileProjectConfigurator.cs:line 193
   at MSStore.CLI.Commands.PublishCommand.Handler.InvokeAsync(InvocationContext context) in /_/MSStore.CLI/Commands/PublishCommand.cs:line 171
   at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue, InvocationContext context)
   at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at MSStore.CLI.Program.<>c.<<Main>b__0_2>d.MoveNext() in /_/MSStore.CLI/Program.cs:line 229
--- End of stack trace from previous location ---
   at System.CommandLine.Hosting.HostingExtensions.<>c__DisplayClass1_0.<<UseHost>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
azchohfi commented 3 months ago

This is because the access token is cached, but it expires in one hour. This is a separate issue. We should add a retry logic to get a new access token if it expired. This process is not supposed to run for longer than 1 hour, at all. I don't know what is happening. If you go to partner center, and go to the details of the submission's packages, do you have any extra information there?

clFaster commented 3 months ago

The details of the latest submission package look like this: image

There are no warnings etc in the partner center, everthing seems fine and I can "Submit for certification" there without any problems - or Delete submission.

azchohfi commented 3 months ago

What about a "msstore submission get APPID"? This might have more details than this screen.

clFaster commented 3 months ago

Thanks for your help! Yes, there seems to be a problem, will try to fix that:

...
"Status": "CommitFailed",
  "StatusDetails": {
    "Errors": [
      {
        "Code": "IsInternalError",
        "Details": "Commit workflow 83e8994c-78cb-4398-a9cc-b9fc143ca642 is cancelled."
      }
    ],
    "Warnings": [
      {
        "Code": "SalesUnsupportedWarning",
        "Details": "The sales resource is no longer supported. To view or edit the sales data for this submission, use the Dev Center
dashboard."
      }
    ],
    "CertificationReports": []
  },
...