Sfdx source push command interruption

salesforcedxsource-push

When I am deploying metadata using sfdx force:source:push to my scratch org, if for whatever reason I decide to interrupt the process CTRL+C (missing metadata, or need to change a file) and then re-enter the same command for the same scratch org, the source progress seems to hang for almost 30mins and displays source progress 0/0 components before starting again.

SOURCE PROGRESS | ████████████████████████████████████████ | 0/0 Components

(mostly happens when doing an initial push to a new scratch org)

It seems faster to simply create a new scratch org and push the metadata to the newly created org than to wait.

Does anyone know what may be the cause of this? what happens under the hood when we interrupt this command?

Best Answer

Killing the sfdx-cli process does not stop the deployment on the server. That process is asynchronous and will continue regardless of the CLI monitoring the deployment or not. Note that if the push succeeds after killing the process, the client's metadata tracking cache will be outdated, and you will have to use force:source:push --force or force:source:pull --force to use any further pushes or pulls. The previously started deployment will lock the server from additional administrative changes (deploys/pushes) until the deployment succeeds, fails, or is cancelled. You can kill the deployment from the Deployment Status screen found in Setup.

Related Topic