cli icon indicating copy to clipboard operation
cli copied to clipboard

force:data:bulk:delete command return value=0 even on error

Open yurifugi opened this issue 2 years ago • 2 comments

I'm using sfdx-cli/7.159.0 linux-x64 node-v16.15.1 and trying some bulk:deletes.

Noticed that even when the command fails -in my case it is failing because of API limits exceeded- the return value ($?) is 0 (zero). Should not the return value ($?) be 0 (zero) on success?

Outputs:

$ sfdx force:data:bulk:delete \
>             --csvfile "$CSVFILE" \
>             --sobjecttype "$SOBJECT" \
>             --targetusername "$ORG_USER" \
>             --wait 300
Bulk Delete... Error
ExceededQuota: ApiBatchItems Limit exceeded.
    at BulkApi.getError (/home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/http-api.js:307:12)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/http-api.js:154:23
    at async /home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/api/bulk.js:428:21 {
  errorCode: 'ExceededQuota',
  content: undefined
}

$ echo "$?"
0

Thanks in advance.

yurifugi avatar Jul 28 '22 11:07 yurifugi

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.

github-actions[bot] avatar Jul 28 '22 19:07 github-actions[bot]

This issue has been linked to a new work item: W-11509580

git2gus[bot] avatar Jul 28 '22 19:07 git2gus[bot]

This is now in the latest CLIs: sfdx 7.208.10 / sf 1.85.8

shetzel avatar Jul 06 '23 20:07 shetzel