Cli: ERROR running force:source:deploy: Unexpected element {http://soap.sforce.com/2006/04/metadata}id during simple type deserialization

Created on 24 Feb 2021  路  7Comments  路  Source: forcedotcom/cli

Summary

When deploying using Quick Deploy ID, the following error is thrown as follows but the deployment technically works. No change was made to pipeline (pulling latest version).
This means we cannot parse the results from the deploy and use them in the CICD progress afterwards

PS C:\workspace\sfdc> Write-Host "DeploymentID: $deploymentId"
DeploymentID: 0Af2D00000f3vYGSAY 
PS C:\workspace\sfdc> sfdx force:source:deploy -q $deploymentId -u devevo
Job ID | [object Object]
ERROR running force:source:deploy:  Unexpected element {http://soap.sforce.com/2006/04/metadata}id during simple type deserialization

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.

  1. Successfully run validation with tests
  2. Retrieve Deploy ID
  3. Attempt to quick deploy using sfdx force:source:deploy -q $deploymentId -u devevo
  4. Check salesforce org and see that the deployment actually did pass so the command is assumed to be correct but the CLI throw error.

Expected result

Updates with Job deployment should be pushed to CLI

Actual result

firstly, it seems something is not parsing the deployment Id since it says [object Object], but I assume this is the same issue throwing the error.

PS C:\workspace\sfdc> Write-Host "DeploymentID: $deploymentId"
DeploymentID: 0Af2D00000f3vYGSAY 
PS C:\workspace\sfdc> sfdx force:source:deploy -q $deploymentId -u devevo
Job ID | [object Object]
ERROR running force:source:deploy:  Unexpected element {http://soap.sforce.com/2006/04/metadata}id during simple type deserialization

Additional information

SFDX CLI Version:
sfdx-cli/7.88.4 win32-x64 node-v15.5.1

SFDX plugin Version:
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.4.0-2 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.7 (core)
auth 1.4.8 (core)
config 1.2.5 (core)
generator 1.1.5 (core)
salesforcedx 51.0.4 (core)
鈹溾攢 limits 1.0.4 (core)
鈹溾攢 schema 1.0.4 (core)
鈹溾攢 user 1.1.2 (core)
鈹溾攢 custom-metadata 1.0.11 (core)
鈹溾攢 templates 51.2.0 (core)
鈹溾攢 apex 0.1.4 (core)
鈹溾攢 salesforce-alm 51.0.2 (core)
鈹斺攢 @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.88.4 (core)
sfdx-git-delta 4.2.1
sfpowerkit 2.6.5
telemetry 1.1.1 (core)

OS and version:
Windows 10 AND Ubuntu 20

bug

All 7 comments

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.

Just saw https://github.com/forcedotcom/cli/issues/876 was also submitted while was still writing this - could be same issue

Hey man, we added two reports of the same issue almost at the same time.

Just so you know, I managed to temporarily work around the issue by forcing sfdx-cli to a previous version, rather than latest. This allows you to run the pipeline while this is being fixed.

@bast-shb did you have the exact version?

@DougMidgley You mean the version I reverted to?

I did this in our pipeline:

sudo npm install [email protected] --global as that was the latest previous version that worked for us.

So version 7.86.3.

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

Same issue by using force:mdapi:deploy command.

While using --soapdeploy with force:mdapi:deploy command the ERROR returned is:

sfdx force:mdapi:deploy -u DevHub -w 100 --soapdeploy --validateddeployrequestid $JOBID
ERROR running force:mdapi:deploy:  Cannot create property 'status' on string '0AfXXXXXXXXXXXX''

Tested on versions:

  • sfdx-cli 7.90.2
  • sfdx-cli 7.91.0
Was this page helpful?
0 / 5 - 0 ratings