Solve deployment errors
- Reading the deployment job log
- Metadata errors
- Test classes errors
- Code Coverage errors
- SOS, I'm lost
Reading the deployment job log
At the end of a deployment or a deployment check, sfdx-hardis displays a short summary instead of the complete Salesforce deployment response, which can be several hundred thousand characters long on big orgs.
Deployment check summary for calculated-package-xml
Status: Succeeded
Deployment ID: 0AfG500000PCMG6KAP
Deployment mode: DELTA
Components: 26 deployed, 0 failed (26 total)
Apex tests: 465 completed, 0 failed (465 total)
Org-wide Apex coverage: 86.82%
Duration: 0:39:24.000
Full deployment JSON: hardis-report/deploy-result-calculated-package-xml.json (published in CI job artifacts, hardis-report folder)
Define NO_TRUNCATE_LOGS=true to display the full deployment JSON in the console again
Deployment errors, failed Apex tests and deployment tips are still displayed in full below that summary.
Full deployment JSON
The complete deployment response is written in the report directory (hardis-report by default), as deploy-result-<package label>.json, on success and on failure. It contains the component successes, the Apex test details, the coverage details and every other field returned by the Metadata API.
The CI/CD pipelines generated by sfdx-hardis publish that folder as a job artifact. If your repository was created before this feature, add the artifact publication to your existing pipeline:
| Platform | Add to the deployment job |
|---|---|
| GitLab | artifacts:when: alwayspaths:- hardis-reportexpire_in: 1 week |
| GitHub | A step using actions/upload-artifact@v4 with if: success() \|\| failure() and path: hardis-report |
| Azure Pipelines | - publish: $(System.DefaultWorkingDirectory)/hardis-report/condition: succeededOrFailed()artifact: hardis-report |
| Bitbucket | artifacts:- hardis-report/** |
| Jenkins | Already archived by the default Jenkinsfile |
To get the complete JSON back in the console, define the environment variable NO_TRUNCATE_LOGS=true on the job.
Metadata errors
sfdx-hardis will display the error and often provide tips about how to solve the error.
Fix with new commit
You can solve the issue, create a new commit and run again command 
Fix with reset commits then new commit
If the issue is caused by the fact that you committed files that you finally decided to not publish, you can reset your selection.
- Stage and commit again the elements that you want to publish
Test classes errors
That's simple: fix the test classes :)
If you are an admin, you might need the help of a developer, who will directly work in your branch
Code Coverage errors
Don't be lazy, write the missing test classes :)
You know you'll need them to be able to deploy in production anyway :)
SOS, I'm lost
- Call your release manager, he/she's here to help you !
- Google / ChatGPT / Bard the issue
- Ask on Slack #inte-hotline-cicd if you work at Cloudity
- Ask on Salesforce StackExchange


