microsoft / SDCM

Surface Dev Center Manager tool to automate WHQL/Attestation submissions and Shipping Label creation for Microsoft Hardware Dev Center
MIT License
34 stars 17 forks source link

Http retries Exhausted Exception while sending signing request #62

Closed MTKSDCM closed 2 months ago

MTKSDCM commented 2 months ago

Describe the bug

Create Product

  • Create JSON
  • Submit Did not find product ID SurfaceDevCenterManager v1.0.0.1 Create Option

============================================================ SurfaceDevCenterManager Exception Log Option: CreateOption Section: NewProduct **Type: Microsoft.Devices.HardwareDevCenterManager.Utility.HttpRetriesExhaustedException Message: AuthorizationHandler: NULL response, unable to communicate with Hardware Dev Center Inner Exception: Correlation Id: ***

Correlation Id: * Return: -1000 (PARTNER_CENTER_HTTP_EXCEPTION)

To Reproduce Run latest SDCM tool

Expected behavior SIgn should success.

Desktop (please complete the following information)

Additional context May i know what could be the possible issue and how can we mitigate it .

Ben-Carpenter commented 2 months ago

@MTKSDCM, which -creds option are you passing in your command? Please use the following for each scenario.

sdcm.exe -creds ???? create product -productid 123456789
For all options below, these common key-value pairs are needed either in environment variable or in the authconfig.json file depending on which credential option you are using. Auth Config File Environment Variables
tenantId SDCM_CREDS_TENANTID
clientId SDCM_CREDS_CLIENTID
url SDCM_CREDS_URL
urlPrefix SDCM_CREDS_URLPREFIX
Credential Type -creds Option Credential Reference Values to Use Notes
Managed Identity ManagedIdentity ManagedIdentity common + SDCM_CREDS_MI_CLIENTID, SDCM_CREDS_MI_SCOPE Set environment variables + Federated Credential needs to be set in app registration.
Managed Identity MiThenFile MiThenFile common + managedIdentityClientId, scope Use authconfig.json file + Federated Credential needs to be set in app registration.
Client Credentials ENVOnly ENVOnly common + SDCM_CREDS_KEY Environment variables need to be set.
Client Credentials ClientCredentials ClientCredentials common + SDCM_CREDS_KEY Client secret needs to be valid in app registration.
File Only FileOnly FileOnly common + the other values from previous options in this table. Use authconfig.json file. Ensure values and/or app registration has the correct values from previous options above depending on which -creds option you are trying to use.
Ben-Carpenter commented 2 months ago

@MTKSDCM,

Please let us know if you need further help. If nothing else is needed, please close the issue. I will get my previous reply into the README.

Ben-Carpenter commented 2 months ago

@MTKSDCM, would you mind if we updated the title of this issue to AuthorizationHandler: NULL response, unable to communicate with Hardware Dev Center

MTKSDCM commented 2 months ago

previously i never passed such credential in command, i just used authconfig.json for credentials

MTKSDCM commented 2 months ago

Is it mandatory now to pass this option ? and because of this i am getting this error

Ben-Carpenter commented 2 months ago

Is it mandatory now to pass this option ? and because of this i am getting this error

It's not mandatory. If you don't pass a credential it defaults to AADThenFile. This will try GetWebApiCreds if creds is null it will read the authconfig.json file.

Only populate the values for the credential option you want to use.

If you are using client credentials, your json should look like this.

[
  {
    "tenantId": "guid",
    "clientId": "guid",
    "managedIdentityClientId": "guid", // remove or leave as empty string
    "scope":  "string", // remove or leave as empty string
    "key": "string",
    "url": "https://manage.devcenter.microsoft.com",
    "urlPrefix": "v2.0/my"
  }
]
Ben-Carpenter commented 2 months ago

@MTKSDCM, checking back to make sure you were able to get things working.

Ben-Carpenter commented 2 months ago

@MTKSDCM, checking back to make sure you were able to get things working.

@MTKSDCM, please let us know if you are still having issues or were able to resolve. If we don't hear back by EOW we will close the issue.

MTKSDCM commented 2 months ago

Still getting this issue on one windows server. Attestation Submission [2024-09-20 09:50:35] [build-stdout] > Create Product [2024-09-20 09:50:35] [build-stdout] Create JSON [2024-09-20 09:50:35] [build-stdout] Submit [2024-09-20 09:50:40] [build-stdout] PID: 13990390021569011 [2024-09-20 09:50:40] [build-stdout] > Create Submission [2024-09-20 09:50:40] [build-stdout] Create JSON [2024-09-20 09:50:40] [build-stdout] * Submit [2024-09-20 09:50:42] [build-stdout] Did not find submission ID [2024-09-20 09:50:42] [build-stdout] SurfaceDevCenterManager v1.0.0.1 [2024-09-20 09:50:42] [build-stdout] > Create Option [2024-09-20 09:50:42] [build-stdout] > Creating Submission [2024-09-20 09:50:42] [build-stdout] CreateOption NewSubmission experienced a HTTP 429 Too Many Requests response. [2024-09-20 09:50:42] [build-stdout] Correlation Id: 9a5c1401-2de1-4dac-a8ee-97518e753024 [2024-09-20 09:50:42] [build-stdout] Return: -429 (HTTP_429_RATE_LIMIT_EXCEEDED) [2024-09-20 09:50:42] [build-stdout] -1

Ben-Carpenter commented 2 months ago

Still getting this issue on one windows server. Attestation Submission [2024-09-20 09:50:35] [build-stdout] > Create Product [2024-09-20 09:50:35] [build-stdout] Create JSON [2024-09-20 09:50:35] [build-stdout] Submit [2024-09-20 09:50:40] [build-stdout] PID: 13990390021569011 [2024-09-20 09:50:40] [build-stdout] > Create Submission [2024-09-20 09:50:40] [build-stdout] Create JSON [2024-09-20 09:50:40] [build-stdout] * Submit [2024-09-20 09:50:42] [build-stdout] Did not find submission ID [2024-09-20 09:50:42] [build-stdout] SurfaceDevCenterManager v1.0.0.1 [2024-09-20 09:50:42] [build-stdout] > Create Option [2024-09-20 09:50:42] [build-stdout] > Creating Submission [2024-09-20 09:50:42] [build-stdout] CreateOption NewSubmission experienced a HTTP 429 Too Many Requests response. [2024-09-20 09:50:42] [build-stdout] Correlation Id: 9a5c1401-2de1-4dac-a8ee-97518e753024 [2024-09-20 09:50:42] [build-stdout] Return: -429 (HTTP_429_RATE_LIMIT_EXCEEDED) [2024-09-20 09:50:42] [build-stdout] -1

Glad to hear you were able to get past your auth issue. We can close this issue #62

For the HTTP 429, you are making too many calls to the Partner Center APIs within your allowed rate per minute. You will need to handle that separately. Try a delay between your calls. If you are using multiple machines or instances with the same client ID, you will need to keep that in mind.

Looks like your Submission might have had an issue with submit based on the 'Did not find submission ID'. Check Partner Center for any error details.