cli icon indicating copy to clipboard operation
cli copied to clipboard

sfdx force:source:deploy failing with Unhandled rejection TypeError: Cannot read property 'result' of null

Open nagendraks opened this issue 3 years ago • 9 comments

Summary

While using CI/CD to validate components we are receiving an exception from node module of sfdx. Below are the verbose statements from deploy command.

Expected result

Validation should run successfully.

Actual result

Validation does not run successfully and github workflow never stops after an error seens while running sfdx force:source:deploy command.

System Information

sfdx force:source:deploy -x deltaPackageGoesHere --checkonly -l 'RunSpecifiedTests' -r $TestClasses -u ProdUserName -w 60 --dev-debug

I can see in org the validation is done but the github workflow never stops and I can see an error here.

SOURCE PROGRESS | ███████████████████████████████████░░░░░ | 43/49 Components SOURCE PROGRESS | ███████████████████████████████████░░░░░ | 43/49 Components SOURCE PROGRESS | ███████████████████████████████████░░░░░ | 43/49 Components SOURCE PROGRESS | ███████████████████████████████████░░░░░ | 43/49 Components SOURCE PROGRESS | █████████████████████████████████████░░░ | 45/49 Components SOURCE PROGRESS | █████████████████████████████████████░░░ | 45/49 Components SOURCE PROGRESS | █████████████████████████████████████░░░ | 45/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components Unhandled rejection TypeError: Cannot read property 'result' of null at /usr/local/lib/sfdx/node_modules/salesforce-alm/node_modules/jsforce/lib/api/metadata.js:53:16 at tryCallOne (/usr/local/lib/sfdx/node_modules/promise/lib/core.js:37:12) at /usr/local/lib/sfdx/node_modules/promise/lib/core.js:123:15 at flush (/usr/local/lib/sfdx/node_modules/asap/raw.js:50:29) at processTicksAndRejections (internal/process/task_queues.js:79:11) From previous event: at processImmediate (internal/timers.js:456:21) From previous event: at Force.mdapiCheckDeployStatus (/usr/local/lib/sfdx/node_modules/salesforce-alm/dist/lib/core/force.js:610:53) at CheckStatus._getStatus (/usr/local/lib/sfdx/node_modules/salesforce-alm/dist/lib/mdapi/mdapiCheckStatusApi.js:89:21) at CheckStatus._pollForStatus (/usr/local/lib/sfdx/node_modules/salesforce-alm/dist/lib/mdapi/mdapiCheckStatusApi.js:56:14) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components SOURCE PROGRESS | ██████████████████████████████████████░░ | 47/49 Components

nagendraks avatar Mar 23 '22 19:03 nagendraks

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 Mar 23 '22 19:03 github-actions[bot]

what version of the cli are you using? From the error message I can tell it's an older one. I would suggest updating to the latest CLI and trying again

WillieRuemmele avatar Mar 24 '22 15:03 WillieRuemmele

We do have latest cli , as in github action we fire npm install sfdx-cli g, so it installs the latest version. Also this seems to be known issue from past 9 days

nagendraks avatar Mar 24 '22 15:03 nagendraks

By

Also this seems to be known issue from past 9 days

do you mean it started 9 days ago? Or do you have a like to a Known Issue?

Have you tried running these commands locally, not in the CI process? I would ask for the output of sfdx plugins --core and ensure that it has source 1.8.18 (core) and salesforce-alm 54.0.1 (core)

WillieRuemmele avatar Mar 24 '22 16:03 WillieRuemmele

Sorry forgot to paste the link.

https://trailblazer.salesforce.com/issues_view?id=a1p4V000002JjgrQAC

I would share the output too of sfdx plugins, but i dont think thats the issue here. This only comes when we try to run large number of testcases. For eg : more than 200 in one deployment.

nagendraks avatar Mar 24 '22 16:03 nagendraks

Thank you.

if you're able to share the project that is causing this issue that'll be hugely helpful in reproducing the error. But I'll be looking into this

WillieRuemmele avatar Mar 24 '22 16:03 WillieRuemmele

@WillieRuemmele Yes I did run this locally also via python scrip and got the same error message.

    `C:\Users\nagen>sfdx plugins --core
    @oclif/plugin-autocomplete 0.3.0 (core)
    @oclif/plugin-commands 1.3.0 (core)
    @oclif/plugin-help 3.3.1 (core)
    @oclif/plugin-not-found 1.2.6 (core)
    @oclif/plugin-plugins 1.10.11 (core)
    @oclif/plugin-update 1.5.0 (core)
    @oclif/plugin-warn-if-update-available 1.7.3 (core)
    @oclif/plugin-which 1.0.4 (core)
    @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
    alias 1.2.1 (core)
    apex 0.11.0 (core)
    auth 1.8.1 (core)
    community 1.1.4 (core)
    config 1.3.23 (core)
    custom-metadata 1.0.12 (core)
    data 0.6.9 (core)
    generator 1.2.2 (core)
    info 1.3.0 (core)
    limits 1.3.0 (core)
    org 1.11.2 (core)
    salesforce-alm 54.0.1 (core)
    schema 1.1.0 (core)
    sfdx-cli 7.142.1 (core)
    sfdx-git-delta 5.0.3
    source 1.8.18 (core)
    telemetry 1.4.0 (core)
    templates 54.2.0 (core)
    trust 1.1.0 (core)
    user 1.7.1 (core)`

C:\Users\nagen>sfdx version
sfdx-cli/7.142.1 win32-x64 node-v16.14.0

I did ask the same on stackoverflow too, so running on CI/CD process or local, If a large number of test cases are running, then the same issue is replicable everywhere.

https://salesforce.stackexchange.com/questions/372233/getting-errors-from-yesterday-while-including-test-run-from-sfdx-command

But, sorry, I wont be able to share the project though as it my Company's repo.

nagendraks avatar Mar 25 '22 03:03 nagendraks

update: we've had another report of this happening and believe something is happening on the server-side in the metadata-api. We've reached out to that team

WillieRuemmele avatar Mar 28 '22 17:03 WillieRuemmele

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.

github-actions[bot] avatar Mar 30 '22 19:03 github-actions[bot]

We haven't seen the missing fields on mdapi responses in a long time. I'm closing.

mshanemc avatar Nov 27 '23 19:11 mshanemc