MicrosoftEdge-Extensions icon indicating copy to clipboard operation
MicrosoftEdge-Extensions copied to clipboard

[FeatureReq - Partner Center] An error occurred while performing the operation

Open Xsy41 opened this issue 9 months ago • 15 comments

Is your feature request related to a problem? Please describe. When performing the 4th step of the process (checking the publication status) via the API, I always encounter the error message: "message": "An error occurred while performing the operation". However, when manually checking the status in the Edge Add-ons dashboard, everything works fine. Could you help me understand why this happens? Or is there something wrong with my API request?

Describe the solution you’d like I would like the API to return the correct publication status, similar to what happens when I manually check the status through the Edge Add-ons dashboard, without encountering this error message.

Describe alternatives you’ve considered

  1. Manually checking the publication status through the dashboard, which works but does not automate the process.
  2. Verifying the API request to ensure it’s formed correctly and checking if there are any required headers or parameters missing.

Additional context The error occurs during the 4th step when checking the publication status via the API. The same process works fine manually, but the API always returns an error, preventing me from automating the workflow.

I always get this error message: “message”: “An error occurred while performing the operation”, but when I manually click to upload, it succeeds. Could you tell me why this is happening? Or is there an issue with my API implementation? Please help me out.

Image Image Image

https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/update/api/addons-api-reference?tabs=v1-1#publish-the-product-draft-submission

Xsy41 avatar Feb 15 '25 09:02 Xsy41

Image Here's my code! https://github.com/Xsy41/MMiao/blob/main/deploy.js

Please help me! Thank you very much!

Xsy41 avatar Feb 15 '25 09:02 Xsy41

Hi @Xsy41, thank you for contacting us. Could you please provide us with your seller ID and the details of your extension? This will help us verify your information and assist you accordingly.

ManikanthMSFT avatar Feb 18 '25 03:02 ManikanthMSFT

Okay, thank you for your help. My client ID is b6ad4503-a9d4-442b-a5af-0441ffabb4b0.

Xsy41 avatar Feb 18 '25 03:02 Xsy41

I want to publish the 1.1.18 version of my HyperCRX draft through the API, but while I can publish it manually, I am unable to do so using the API.

Xsy41 avatar Feb 18 '25 03:02 Xsy41

My product ID is b70debf5-70b0-41f6-ba93-c19ab9ef33b2.

Xsy41 avatar Feb 18 '25 05:02 Xsy41

Hi @Xsy41, thank you for providing us with the required information. We are looking into this and will let you know as soon as we have an update.

ManikanthMSFT avatar Feb 18 '25 12:02 ManikanthMSFT

Thank you! @ManikanthMSFT

Xsy41 avatar Feb 18 '25 12:02 Xsy41

@ManikanthMSFT is Microsoft aware that this is a broader issue beyond a single customer?

This has been an ongoing issue since July, 2024. It first began in July, 2024 as reported in this issue: https://github.com/microsoft/MicrosoftEdge-Extensions/issues/175

That was briefly fixed near the end of July until it regressed in mid October and has been unreliable ever since. Checking publish status fails ~80% of the time forcing users to do manual releases.

AllanKerr avatar Feb 19 '25 03:02 AllanKerr

Hi @AllanKerr, we are looking into this and once we have an update we will write back to you.

ManikanthMSFT avatar Mar 05 '25 05:03 ManikanthMSFT

Hi @Xsy41, @AllanKerr, could you please confirm if you have migrated to the latest version of the API?

ManikanthMSFT avatar Mar 07 '25 06:03 ManikanthMSFT

Yes.

Image

Xsy41 avatar Mar 07 '25 06:03 Xsy41

See also https://github.com/wdzeng/edge-addon/issues/16#issuecomment-2707209359

danielhjacobs avatar Mar 07 '25 20:03 danielhjacobs

Quick thought/question: Is it okay to send the https://api.addons.microsoftedge.microsoft.com/v1/products/${productId}/submissions request immediately after the https://api.addons.microsoftedge.microsoft.com/v1/products/${productId}/submissions/draft/package succeeds, or should we be waiting an extra X seconds after that?

danielhjacobs avatar Mar 07 '25 20:03 danielhjacobs

Hi @Xsy41, @AllanKerr, could you please confirm if you have migrated to the latest version of the API?

Yes, we are

AllanKerr avatar Mar 17 '25 17:03 AllanKerr

Hi, below is a PowerShell script that you can use to query the status of your upload and proceed to publish only when the status changes from 'In Progress'. Please fill in your values for ClientID, ClientSecret, ProductID, and FilePATH.

Param( [string] $ClientID = '', [string] $ClientSecret = '', [string] $ProductID = '', [string] $FilePATH = '', [int] $RetryLimit = 10, [int] $RetryAfterPeriod = 5, [string] $ApiEndpoint = 'https://api.addons.microsoftedge.microsoft.com', [string] $PublishNotes = 'This is test publish' )

function ReadKeyFromJSON($jsonContent, $keyToFetch){ $jsonContent.TrimStart('{').TrimEnd('}').Split(',') |ForEach-Object { $key,$value = $_.Split(':') if($key.Trim('"') -eq $keyToFetch) { return $value.Trim('"') } } return '' }

function ReadLocationFromRawContent($jsonRawContent) { $jsonRawContent.Split([System.Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries) | ForEach-Object { $key,$value = $_.Split(':') if ($key -eq 'Location') { return $value } } return '' }

$PublishNotesBody = @{ notes = $PublishNotes }

$GetTokenHeaders = @{ 'Content-Type' = 'application/x-www-form-urlencoded' }

$UploadHeaders = @{ "Authorization" = "ApiKey $ClientSecret" "Content-Type" = "application/zip" "X-ClientID" = "$ClientID" }

$uploadResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$ProductID/submissions/draft/package" -Headers $UploadHeaders -Method 'POST' -InFile $FilePATH $uploadResponse

$uploadOperationId = '' if($uploadResponse.StatusCode -eq 202) { "Upload Successful" $uploadOperationId = ReadLocationFromRawContent($uploadResponse.RawContent) }

$uploadStatusResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$ProductID/submissions/draft/package/operations/$UploadOperationId" -Headers $UploadHeaders -Method 'GET' $uploadStatusResponse

$uploadStatus = 'InProgress' if($uploadStatusResponse.StatusCode -eq 202) { "Upload Status Received Successfully" $retryCount = 1; while($uploadStatus -eq 'InProgress')
{ if($retryCount -gt $RetryLimit) { Exit-PSSession } $uploadStatusResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$ProductID/submissions/draft/package/operations/$UploadOperationId" -Headers $UploadHeaders -Method 'GET' $retryCount = $retryCount + 1 Start-Sleep -Seconds $RetryAfterPeriod $uploadStatus = ReadKeyFromJSON($uploadStatusResponse.Content, 'status') } }

$publishResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$productID/submissions" -Headers $UploadHeaders -Method 'POST' -Body $PublishNotesBody $publishResponse

$PublishOperationId = '' if($publishResponse.StatusCode -eq 202) { "Published Successfully" $PublishOperationId = ReadLocationFromRawContent($publishResponse.RawContent) } $PublishOperationId

$publishStatusResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$ProductID/submissions/operations/$PublishOperationId" -Headers $UploadHeaders -Method 'GET' $publishStatusResponse

$publishStatus = 'InProgress' $publishStatusResponse.Content if($publishStatusResponse.StatusCode -eq 202) { "Publish Status Received Successfully" $retryCount = 1; while($publishStatus -eq 'InProgress') { if($retryCount -gt $RetryLimit) { Exit-PSSession } $publishStatusResponse = Invoke-WebRequest "$ApiEndpoint/v1/products/$ProductID/submissions/operations/$PublishOperationId" -Headers $UploadHeaders -Method 'GET' $retryCount = $retryCount + 1 Start-Sleep -Seconds $RetryAfterPeriod $publishStatus = ReadKeyFromJSON($publishStatusResponse.Content, 'status') } } $publishStatus

If the requests continue to fail, please share your seller ID and the timestamp of the request so we can further investigate the issue.

ManikanthMSFT avatar Mar 28 '25 11:03 ManikanthMSFT

Hi @Xsy41 @AllanKerr

I am Rahul from the Microsoft Edge Extensions Developer Support team.

Apologies for the delayed response. I’d like to inform you that the issue has been resolved by our team, and the documentation has also been updated accordingly. You can find the updated documentation here: https://learn.microsoft.com/en-us/microsoft-edge/extensions/update/api/using-addons-api?tabs=v1-1

Thank you for your efforts in sharing all the necessary details—they were instrumental in helping us resolve this.

Please confirm if the issue is now resolved on your end. If you're still experiencing it, kindly share your Seller ID and the timestamp of the request so we can investigate further and assist you accordingly.

Rahul-Bauri avatar Jul 28 '25 10:07 Rahul-Bauri

Hi @Xsy41 @AllanKerr

Closing this issue for now as we haven’t received any response from you. If you encounter the problem again in the future, please feel free to raise a new bug so we can assist you further with the resolution.

Rahul-Bauri avatar Aug 19 '25 18:08 Rahul-Bauri