Closed tarcang closed 10 months 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.
Hello @tarcang :wave: It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json
for the CLI you're using (sf
or sfdx
).
A few more things to check:
rc
or nightly
versions. (docs)doctor
command to diagnose common issues.Thank you!
Hello @tarcang :wave: None of the versions of sf
you shared match the latest release.
Shared: 2.15.9
Latest: 2.16.7
Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc
and nightly
releases! (docs)
After updating, share the full output of sf version --verbose --json
This issue has been linked to a new work item: W-14470146
Same issue if you run the following command.
sf project deploy validate --test-level RunLocalTests --metadata-dir ./toDeploy --target-org hotfix --wait 45 --junit --results-dir tests --coverage-formatters cobertura --json > deploy-result.json
response
{
"code": 1,
"context": "DeployMetadataValidate",
"commandName": "DeployMetadataValidate",
"data": {
"deployId": "0Af1X00002h5J2sSAE"
},
"message": "Failed to validate the deployment (0Af1X00002h5J2sSAE). Due To:\n1 component error(s)",
"name": "FailedValidationError",
"status": 1,
"stack": "FailedValidationError: Failed to validate the deployment (0Af1X00002h5J2sSAE). Due To:\n1 component error(s)\n at Messages.createError (/Users/tbozinis/.local/share/sf/client/2.17.14-31db5eb/node_modules/@salesforce/core/lib/messages.js:393:16)\n at DeployMetadataValidate.run (/Users/tbozinis/.local/share/sf/client/2.17.14-31db5eb/node_modules/@salesforce/plugin-deploy-retrieve/lib/commands/project/deploy/validate.js:80:18)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async DeployMetadataValidate._run (/Users/tbozinis/.local/share/sf/client/2.17.14-31db5eb/node_modules/@salesforce/plugin-deploy-retrieve/node_modules/@oclif/core/lib/command.js:117:22)\n at async Config.runCommand (/Users/tbozinis/.local/share/sf/client/2.17.14-31db5eb/node_modules/@oclif/core/lib/config/config.js:400:25)\n at async run (/Users/tbozinis/.local/share/sf/client/2.17.14-31db5eb/node_modules/@oclif/core/lib/main.js:85:16)",
"exitCode": 1,
"warnings": []
}
with exceptions
sfdx force:source:deploy -c -l RunLocalTests -p ./toDeploy --target-org hotfix --wait 45 --junit --resultsdir tests --coverageformatters cobertura --json > test.json
{
"status": 1,
"result": {
"checkOnly": true,
"completedDate": "2023-11-17T11:25:16.000Z",
"createdBy": "0050X000008Ti3Q",
"createdByName": "Admin User",
"createdDate": "2023-11-17T11:25:06.000Z",
"details": {
"componentFailures": [
{
"changed": false,
"columnNumber": 3,
"componentType": "ApexClass",
"created": false,
"createdDate": "2023-11-17T11:25:13.000Z",
"deleted": false,
"fileName": "classes/AccountTriggerHandler.cls",
"fullName": "AccountTriggerHandler",
"lineNumber": 14,
"problem": "Missing ';' at 'Integer'",
"problemType": "Error",
"success": false
}
],
"componentSuccesses": [
{
"changed": true,
"componentType": "",
"created": false,
"createdDate": "2023-11-17T11:25:14.000Z",
"deleted": false,
"fileName": "package.xml",
"fullName": "package.xml",
"success": true
}
],
"runTestResult": {
"numFailures": 0,
"numTestsRun": 0,
"totalTime": 0,
"codeCoverage": [],
"codeCoverageWarnings": [],
"failures": [],
"flowCoverage": [],
"flowCoverageWarnings": [],
"successes": []
}
},
"done": true,
"id": "0Af1X00002h5J3xSAE",
"ignoreWarnings": false,
"lastModifiedDate": "2023-11-17T11:25:16.000Z",
"numberComponentErrors": 1,
"numberComponentsDeployed": 0,
"numberComponentsTotal": 1,
"numberTestErrors": 0,
"numberTestsCompleted": 0,
"numberTestsTotal": 0,
"rollbackOnError": true,
"runTestsEnabled": true,
"startDate": "2023-11-17T11:25:12.000Z",
"status": "Failed",
"success": false,
"deployedSource": [
{
"fullName": "AccountTriggerHandler",
"type": "ApexClass",
"state": "Failed",
"error": "Missing ';' at 'Integer' (14:3)",
"problemType": "Error",
"filePath": "/Users/tbozinis/VS Code Projects/sfdc-dg/toDeploy/classes/AccountTriggerHandler.cls",
"lineNumber": 14,
"columnNumber": 3
}
],
"outboundFiles": [],
"deploys": [
{
"checkOnly": true,
"completedDate": "2023-11-17T11:25:16.000Z",
"createdBy": "0050X000008Ti3Q",
"createdByName": "Admin User",
"createdDate": "2023-11-17T11:25:06.000Z",
"details": {
"componentFailures": [
{
"changed": false,
"columnNumber": 3,
"componentType": "ApexClass",
"created": false,
"createdDate": "2023-11-17T11:25:13.000Z",
"deleted": false,
"fileName": "classes/AccountTriggerHandler.cls",
"fullName": "AccountTriggerHandler",
"lineNumber": 14,
"problem": "Missing ';' at 'Integer'",
"problemType": "Error",
"success": false
}
],
"componentSuccesses": [
{
"changed": true,
"componentType": "",
"created": false,
"createdDate": "2023-11-17T11:25:14.000Z",
"deleted": false,
"fileName": "package.xml",
"fullName": "package.xml",
"success": true
}
],
"runTestResult": {
"numFailures": 0,
"numTestsRun": 0,
"totalTime": 0,
"codeCoverage": [],
"codeCoverageWarnings": [],
"failures": [],
"flowCoverage": [],
"flowCoverageWarnings": [],
"successes": []
}
},
"done": true,
"id": "0Af1X00002h5J3xSAE",
"ignoreWarnings": false,
"lastModifiedDate": "2023-11-17T11:25:16.000Z",
"numberComponentErrors": 1,
"numberComponentsDeployed": 0,
"numberComponentsTotal": 1,
"numberTestErrors": 0,
"numberTestsCompleted": 0,
"numberTestsTotal": 0,
"rollbackOnError": true,
"runTestsEnabled": true,
"startDate": "2023-11-17T11:25:12.000Z",
"status": "Failed",
"success": false,
"deployedSource": [
{
"fullName": "AccountTriggerHandler",
"type": "ApexClass",
"state": "Failed",
"error": "Missing ';' at 'Integer' (14:3)",
"problemType": "Error",
"filePath": "/Users/tbozinis/VS Code Projects/sfdc-dg/toDeploy/classes/AccountTriggerHandler.cls",
"lineNumber": 14,
"columnNumber": 3
}
],
"outboundFiles": []
}
],
"coverage": {
"cobertura": "tests/coverage/cobertura.xml"
}
},
"warnings": [
"We plan to deprecate this command in the future. Try using the \"project deploy start\" command instead."
]
}
Summary
When I use the new
sf project deploy start
command to deploy my apex classes and flows, if there are any errors it is not printed. I get an output like this:However, if I use the soon to be deprecated command for this task,
sfdx force:source:deploy
, I do get an error printed out like so:There is something wrong with the
sf project deploy start
which makes it hard to debug deployment issues if it occurs.Steps To Reproduce
sf project deploy start -o <YOUR_ORG>
You will see something like this:sfdx force source deploy -u <YOUR_ORG> -p main/default/
Now this should appearExpected result
sf project deploy start
should also have printed the error.Actual result
sf project deploy start
didn't print the error although it recognized there is one.System Information
MacBook Pro Intel (2019) Using /bin/sh