forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
474 stars 77 forks source link

Metadata API request failed: UNKNOWN_EXCEPTION #2944

Closed Alfystar closed 1 week ago

Alfystar commented 1 week ago

Summary

Hello! During ours validation flow, we encounter this strange error:

Error (20): Metadata API request failed: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 193357600-12117

This is the log how catch the problem:

>> Show operation status for job '0AfMA0000042Lao0AE'
└─▶ $ sf project deploy report --target-org 'TSTAMSAUTO_RMX' --job-id 0AfMA0000042Lao0AE --wait 12000
Status: {status} | 0/0 Components{errorInfo}{testInfo}{trackingInfo}
Status: In Progress | 1/231 Components
Status: In Progress | 5/231 Components
Status: In Progress | 7/231 Components
Status: In Progress | 219/231 Components
Status: In Progress | 230/231 Components
Status: In Progress | 231/231 Components
Status: In Progress | 231/231 Components | 0/100 Tests
Status: In Progress | 231/231 Components | 1/100 Tests
Status: In Progress | 231/231 Components | 2/100 Tests
Status: In Progress | 231/231 Components | 3/100 Tests
Status: In Progress | 231/231 Components | 5/100 Tests
Status: In Progress | 231/231 Components | 6/100 Tests
Status: In Progress | 231/231 Components | 7/100 Tests
Status: In Progress | 231/231 Components | 8/100 Tests
Status: In Progress | 231/231 Components | 9/100 Tests
Status: In Progress | 231/231 Components | 10/100 Tests
Status: In Progress | 231/231 Components | 11/100 Tests
Status: In Progress | 231/231 Components | 13/100 Tests
Status: In Progress | 231/231 Components | 15/100 Tests
Status: In Progress | 231/231 Components | 17/100 Tests
Status: In Progress | 231/231 Components | 18/100 Tests
Status: In Progress | 231/231 Components | 20/100 Tests
Status: In Progress | 231/231 Components | 21/100 Tests
Status: In Progress | 231/231 Components | 23/100 Tests
Status: In Progress | 231/231 Components | 24/100 Tests
Status: In Progress | 231/231 Components | 25/100 Tests
Status: In Progress | 231/231 Components | 26/100 Tests
Status: In Progress | 231/231 Components | 27/100 Tests
Status: In Progress | 231/231 Components | 28/100 Tests
Status: In Progress | 231/231 Components | 29/100 Tests
Status: In Progress | 231/231 Components | 30/100 Tests
Status: In Progress | 231/231 Components | 31/100 Tests
Status: In Progress | 231/231 Components | 32/100 Tests
Status: In Progress | 231/231 Components | 33/100 Tests
Status: In Progress | 231/231 Components | 34/100 Tests
Status: In Progress | 231/231 Components | 35/100 Tests
Status: In Progress | 231/231 Components | 36/100 Tests
Status: In Progress | 231/231 Components | 37/100 Tests
Status: In Progress | 231/231 Components | 38/100 Tests

Error (20): Metadata API request failed: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 193357600-121176 (-102518988)

But in the org, the the run test work well, as you can see from this screenshot:

image

Steps To Reproduce

Normal flow, but unexpected error

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.46.6",
  "nodeVersion": "node-v20.14.0",
  "osVersion": "Darwin 23.5.0",
  "rootPath": "/Users/ea_enel/.local/share/sf/client/2.46.6-191291b",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.2 (core)",
    "@oclif/plugin-commands 4.0.2 (core)",
    "@oclif/plugin-help 6.2.1 (core)",
    "@oclif/plugin-not-found 3.2.3 (core)",
    "@oclif/plugin-plugins 5.2.4 (core)",
    "@oclif/plugin-search 1.1.2 (core)",
    "@oclif/plugin-update 4.3.5 (core)",
    "@oclif/plugin-version 2.2.3 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.5 (core)",
    "@oclif/plugin-which 3.2.2 (core)",
    "@salesforce/cli 2.46.6 (core)",
    "apex 3.1.18 (core)",
    "auth 3.6.21 (core)",
    "data 3.4.6 (core)",
    "deploy-retrieve 3.9.4 (core)",
    "info 3.3.6 (core)",
    "limits 3.3.12 (core)",
    "marketplace 1.2.12 (core)",
    "org 4.2.1 (core)",
    "packaging 2.4.6 (core)",
    "schema 3.3.11 (core)",
    "settings 2.3.1 (core)",
    "sobject 1.4.11 (core)",
    "source 3.4.2 (core)",
    "telemetry 3.4.0 (core)",
    "templates 56.2.11 (core)",
    "trust 3.7.5 (core)",
    "user 3.5.13 (core)",
    "sfdx-plugin-source-read 1.2.0 (user) published 245 days ago (Tue Oct 24 2023)"
  ]
}
github-actions[bot] commented 1 week ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

shetzel commented 1 week ago

@Alfystar - unfortunately, this is not something the CLI can fix. Whenever you see an error that looks like that (193357600-12117) it's when the server has a problem and the CLI (by design) doesn't continue. That command requests the deployment status until the timeout is reached and in one of the status requests the metadata API returned an unexpected error so the CLI command exited. The deploy most likely continued and when you checked the status in the org UI it was successful.

If you want to know what happened during deploy status polling you can open a support case and they can provide a more specific answer. If this is happening regularly I would definitely do that.

Alfystar commented 1 week ago

Okay, I understand For now, it's the first time, but if it happens again, we'll open a ticket Thank you very much!