Why it reported The metadata deploy operation failed?

First, I used the below command to do a apex class test –

sfdx force:mdapi:deploy --checkonly --testlevel RunSpecifiedTests --runtests ProvisioningQuestionDelete_CC_Test  --zipfile b.zip

and then i used the following command to get the result. But why it reported deploy operation failed please?

sfdx force:mdapi:deploy:report

Deployment finished in 204000ms

=== Result
Status:  Failed
jobid:  0Af0R00000RijoHSAR
Completed:  2019-05-27T05:54:49.000Z
Component errors:  0
Components checked:  9
Components total:  9
Tests errors:  0
Tests completed:  9
Tests total:  9
Check only: true

=== Test Success [9]
NAME                      METHOD
────────────────────────  ───────────────────────────
ProvisioningForm_CC_Test  testEmptyProducts
ProvisioningForm_CC_Test  testFillProducts
ProvisioningForm_CC_Test  testFilterProducts
ProvisioningForm_CC_Test  testFilterProducts1
ProvisioningForm_CC_Test  testFilterProducts2
ProvisioningForm_CC_Test  testFormForOrder
ProvisioningForm_CC_Test  testGetParentAnswersAsList
ProvisioningForm_CC_Test  testGetQuestionValuesAsList
ProvisioningForm_CC_Test  testListContainsOneOfList

=== Apex Code Coverage
NAME                 % COVERED  UNCOVERED LINES
───────────────────  ─────────  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
ProvisioningForm_CC  **86%**        14,16,29,50,51,74,86,94,95,97,98,99,102,121,122,128,155,159,247,262,266,267,268,269,270,307,308,310,311,312,348,349,350,351,352,411,414,417,420,423,533,570,586,597,600,715,722,758,760,762,764,802,827,828,829,830,851,892,899,912,1009,1011,1013,1014,1015,1016,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1053,1060

Total Test Time:  18417.0

ERROR running force:mdapi:deploy:report: The metadata deploy operation failed.

Answer

As pointed by Mariano Hernandez, to know what did go wrong, you’ll need the visual feedback of deployment details, which is available in the Deployment Status page, at Salesforce Setup section. It will have the log details you need. You can use the link below as a shortcut:

https://<YOUR_ORG_NAME_HERE>.lightning.force.com/lightning/setup/DeployStatus/home

enter image description here

Attribution
Source : Link , Question Author : Chao Cai , Answer Author : Murilo Perrone

Leave a Comment