1

Update (6/6/22): Just encountered this error again. I swear it comes back to taunt me every few months, then goes away just as randomly. Am I missing some documentation somewhere that explains what this means, or what I'm supposed to do? Since when do SFDX CLI commands involve an ID? Since when do I need to start a 'new job' to issue a sfdx force:source:deploy command? aaargh


Attempting to do deployments from SFDX. The same command line that worked just fine last night is now failing this morning.

Attempts such as

sfdx force:source:deploy -c -p force-app/main/default

or

sfdx force:source:deploy -c -x package.xml

return the same error:

ERROR running force:source:deploy: Metadata API request failed: The deploy operation is missing a job ID. Initialize an operation with an ID, or start a new job.

I can find no results on google explaining this error or what the fix is. Dev documentation doesn't show any sfdx commands related to initializing a job ID (I thought those were assigned automatically?), or starting a new job (I thought that's what running a new deployment command was?).

I ran the exact same command to the same org last night and it deployed successfully.

I updated SFDX to the latest version, no effect.

I can use the sfdx force:source:retrieve command successfully as well.

Anyone see this error before?

6
  • 1
    If you look for ~/.sfdx/stash.json file - does it contain a jobId? Commented Mar 25, 2022 at 17:01
  • @KrisGoncalves there does not appear to be a stash.json file in that directory, just a sfdx-config.json
    – smohyee
    Commented Mar 28, 2022 at 21:21
  • sfdx-config.json is in your repo directory. I'm talking about looking, if on windows, in your C:\Users\YourUser\.sfdx folder. I believe that file, stash.json is where the tool stores job Ids so was intrigued to see if you had it or if it had values. Commented Mar 30, 2022 at 12:10
  • ah thanks, found it. { "MDAPI_RETRIEVE": { "jobid": "09S03000001OOwpEAG", "retrievetargetdir": "C:\\Users\\smohyee\\AppData\\Local\\Temp\\sdx_sourceRetrieve_pkg_1623097891473" }, "SOURCE_DEPLOY": { "jobid": "0Af0500000X8EKmCAN" } }
    – smohyee
    Commented Mar 31, 2022 at 0:48
  • 2
    @smohyee this seems related to existing open issue sfdx force:source:deploy issue using REST or SOAP, you might want to post a comment there to have further info
    – Shamina
    Commented Jun 7, 2022 at 7:47

5 Answers 5

5

I received this error b/c I recently refreshed my sandbox and forgot to reauthenticate my sfdx client for that org. Once I reauthenticated, this fixed the error.

1
  • Same issue, same fix.
    – JP Seabury
    Commented Aug 1, 2022 at 14:35
2

This ended up resolving with running sfdx update and getting the latest version.

1
  • 1
    For anyone searching and finding this thread... I ran into this problem again at a later date and had a fully updated SFDX, so this probably wasn't related to whatever solved the issue
    – smohyee
    Commented Jun 7, 2022 at 0:31
2

I had this error today (16/10/2024) when deploying using the context menu in VSCode. The error went away once I reloaded the window, opening the command palette (Crl + P) and typing:

"> Developer: Reload Window"

Don't forget to include the ">" at the beginning

0

This does not answer the question but as I mentioned in the comments, it's worth noting that the error is closely related to an open issue reported on the GitHub repo:

sfdx force:source:deploy issue using REST or SOAP

For anyone else having the same error, followup the issue on GitHub to have latest update on the bug resolution

0

@Mike - thank you! I had the same error message like described here and it drove me crazy. We had recently changed the myDomain and I assume that made a reauthentication needed - and changing the URL seems to cause this error message when deploying.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .