microsoft / StoreBroker

A PowerShell module that leverages the Windows Store Submission API to allow easy automation of application submissions to the Windows Store. The master branch is stable and the v2 branch is under active development.
Other
97 stars 40 forks source link

Unable to create/update the Submission using Update-ApplicationSubmission #248

Closed wolkowsky closed 6 months ago

wolkowsky commented 6 months ago

Hi,

We want to move to the automated submissions approach as opposed to manual approach (via partner portal).

I did the entire setup of StoreBroker it all works fine until I run the command below:

Update-ApplicationSubmission -AppId -SubmissionDataPath "C:\Out\Path\Upload.json" -PackagePath "C:\Out\Path\Upload.zip" -AddPackages -Force -UpdatePublishModeAndVisibility -verbose

All I am getting is:

Write-Log : 2024-02-23 09:23:05 : xx: The remote server returned an error: (400) Bad Request.
400 | Bad Request
Items Received: 1
Items Accepted: 0
Errors:
index statusCode message
----- ---------- -------
    0        400 106: Field 'id' on type 'ExceptionDetails' is of incorrect type. Expected: int
Original body: {"name":"Microsoft.ApplicationInsights.66d83c523070489b886b09860e05e78a.Event","time":"2024-02-23T07:16:25.5071198Z","iKey":"4cdaa89f-33c5-46b4-ba5a-3befb5d8fe01","tags":{"ai.user.id":"7CAB070FBA9BE45019F028C46ACDA69E0434ACB9A7736D512AC6D3F90A9E84D56093E
22C47A679C18DC3D3D93CA4F023EEFA271F8E9BCAF6EEBF05F2E2223BD9","ai.session.id":"8eedcb39-b923-4740-b7f8-d9055cb19f86","ai.application.ver":"1.21.2","ai.internal.sdkVersion":"2.0.1.33027"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"properties":{"DayOfWeek":"F
riday","Username":"7CAB070FBA9BE45019F028C46ACDA69E0434ACB9A7736D512AC6D3F90A9E84D56093E22C47A679C18DC3D3D93CA4F023EEFA271F8E9BCAF6EEBF05F2E2223BD9","Force":{"IsPresent":false},"ExistingPackageRolloutAction":"NoAction","ErrorBucket":"Remove-ApplicationSubmission","Mess
age":"{\r\n    \"Message\":  \"The remote server returned an error: (400) Bad Request.\",\r\n    \"CorrelationId\":  \"6650d6dd-7e52-4ae9-adc5-19e4366a3878\",\r\n    \"StatusDescription\":  \"Bad Request\",\r\n    \"RawContent\":  \"\",\r\n    \"InnerMessage\":
\"{\\\"code\\\":\\\"InvalidOperation\\\",\\\"data\\\":[],\\\"details\\\":[],\\\"message\\\":\\\"Ingestion API can only update, delete, and commit submissions that are created through the API. Please delete the current in-progress submission and create one using the
API\\\",\\\"source\\\":\\\"Ingestion Api\\\",\\\"target\\\":\\\"applicationSubmission\\\"}\",\r\n    \"StatusCode\":  400\r\n}","HResult":"0x80131501","SubmissionId":"1152921505697414254","UriFragment":"applications/9PP20XH3JXRB","AppId":"9PP20XH3JXRB"},"handledAt":"Us
erCode","exceptions":[{"id":133531498140254040,"typeName":"System.Management.Automation.RemoteException","message":"{\r\n    \"Message\":  \"The remote server returned an error: (400) Bad Request.\",\r\n    \"CorrelationId\":
\"6650d6dd-7e52-4ae9-adc5-19e4366a3878\",\r\n    \"StatusDescription\":  \"Bad Request\",\r\n    \"RawContent\":  \"\",\r\n    \"InnerMessage\":  \"{\\\"code\\\":\\\"InvalidOperation\\\",\\\"data\\\":[],\\\"details\\\":[],\\\"message\\\":\\\"Ingestion API can only
update, delete, and commit submissions that are created through the API. Please delete the current in-progress submission and create one using the API\\\",\\\"source\\\":\\\"Ingestion Api\\\",\\\"target\\\":\\\"applicationSubmission\\\"}\",\r\n    \"StatusCode\":  400\
r\n}","hasFullStack":true,"parsedStack":[{"assembly":"StoreBroker","method":"\u003cunknown\u003e","fileName":"C:\\Users\\MateuszWolochow\\Documents\\WindowsPowerShell\\Modules\\StoreBroker\\1.21.2\\StoreBroker\\StoreIngestionApi.psm1","level":0,"line":1916},{"assembly"
:"StoreBroker","method":"\u003cScriptBlock\u003e","fileName":"\u003cNo file\u003e","level":1,"line":"58"}]}],"name":"Get-Application","measurements":{"Duration":3.3393644}}}}
At C:\Users\MateuszWolochow\Documents\WindowsPowerShell\Modules\StoreBroker\1.21.2\StoreBroker\Telemetry.ps1:365 char:9
+         Write-Log -Message $newLineOutput -Level Error
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log

WARNING: 2024-02-23 09:16:54 : xx: Encountered a problem while trying to record telemetry events.
This is non-fatal, but it would be helpful if you could report this problem
to the StoreBroker team for further investigation:

System.Management.Automation.RuntimeException: The remote server returned an error: (400) Bad Request.
400 | Bad Request
Items Received: 1                                                                                                                                                                                                                                                             Items Accepted: 0                                                                                                                                                                                                                                                             Errors:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     index statusCode message
----- ---------- -------
    0        400 106: Field 'id' on type 'ExceptionDetails' is of incorrect type. Expected: int

I guess the main problem is this: Ingestion API can only update, delete, and commit submissions that are created through the API. Please delete the current in-progress submission and create one using the API But... I have no idea how I can create the submission in a different way than I am doing it now.

Could someone steer me into the right direction, how can I move it forward?

I did also try doing it all manually (using StoreBroker)

By running: New-ApplicationSubmission -AppId <appid> -Force but this gives me the same result

zhuxb711 commented 6 months ago

Same issue from my side: Ingestion API can only update, delete, and commit submissions that are created through the API. Please delete the current in-progress submission and create one using the API image

HowardWolosky commented 6 months ago

The error comes directly via Partner Center. It means that if you log into the Partner Center portal, you must already have an in-progress submission that was previously started via the website. You need to delete that pending submission, and then you can use StoreBroker. The Ingestion API (which StoreBroker uses) is unable to interact with submissions that were started/initiated via the web portal.

zhuxb711 commented 6 months ago

@HowardWolosky Actually there is no submission in progress. I tried deleting the submission that created by StoreBroker in portal (which is not finished due to the error) and run the StoreBroker again the issue still exists.

zhuxb711 commented 6 months ago

It works just a few weeks ago. I suspect that is a new bug if Microsoft Store team deployed something new recently.

wolkowsky commented 6 months ago

Yes, it's exactly as @zhuxb711 says.

I did go to the portal and removed all submissions that were in progress. There's no pending/in progress submissions. Yet, the ingestion API (I am assuming it's not a StoreBroker issue as the same things happens with the msstore cli) does not let do anything to the submission created via API.

I know that we had one submission (Submission 4) opened manually that's been deleted. What I am going to try is to bring the Submission 4 to the end manually and then see if this will unblock the API with the subsequent submissions.

camnewnham commented 6 months ago

We've also run into this. No changes to our CI pipeline. After manually deleting any pending packages (produces as a result of this error), it still occurs.

GillesRonsin commented 6 months ago

Hi all same here. almost glad I am not alone even if I kill previous submission, the error come at update phasis but I am able to submit by Partners interface... by hand..

Makciek commented 6 months ago

@HowardWolosky Looks like this should not be closed? If it's not the right repository to have this issue, can you advise where should it land?

afonso-tsx commented 6 months ago

The error comes directly via Partner Center. It means that if you log into the Partner Center portal, you must already have an in-progress submission that was previously started via the website. You need to delete that pending submission, and then you can use StoreBroker. The Ingestion API (which StoreBroker uses) is unable to interact with submissions that were started/initiated via the web portal.

We are facing the same issue, and the only in progress submission was created by storebroker, not in the webportal, our CI just stopped working like many other users

HowardWolosky commented 6 months ago

Re-activating this issue given all of these additional reports. While this isn't a StoreBroker issue per-se, I'll keep this issue open while I reach out to the relevant API team within Partner Center to see if we can get this problem sorted out.

GillesRonsin commented 6 months ago

Re-activating this issue given all of these additional reports. While this isn't a StoreBroker issue per-se, I'll keep this issue open while I reach out to the relevant API team within Partner Center to see if we can get this problem sorted out.

I am pretty sure you are right. But here, is the only place I found where you are talking about this issue.

HowardWolosky commented 6 months ago

Hey all -- it would be great for you to try your submissions again. The Partner Center API team believes that they have addressed the issue that was causing the problem, and would like to have external confirmation that the issue is resolved as well.

MatthewSteeples commented 6 months ago

I'm not using this particular library but I'm suffering from the same issue. I've just tried it now and it still gave me the same error. I made sure there were no flights in progress before running it. Correlation Id (if it means anything to anyone) is 43937bf1-a8fa-424c-9a26-b2775959e3af

HowardWolosky commented 6 months ago

Thanks for the confirmation that it's not quite working yet, @MatthewSteeples. The Partner Center team has informed me that they have another fix for this that is being deployed. When it's ready for validation again, will ping back on this Issue.

GillesRonsin commented 6 months ago

@HowardWolosky
Hi Howard, it is working for me now... thank you for your work

Joost-Jens-Luminis commented 6 months ago

It also works for us now. Thanks for your assistance on this.

MatthewSteeples commented 6 months ago

Working here too as well

wolkowsky commented 6 months ago

Thank you Howard. It works fine now.

HowardWolosky commented 6 months ago

Great to hear that their fix is working now for everyone. @wolkowsky, thanks for filing the issue. Closing this out now.