forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
491 stars 79 forks source link

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

Closed DougMidgley closed 3 years ago

DougMidgley commented 3 years ago

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

github-actions[bot] commented 3 years ago

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.

DougMidgley commented 3 years ago

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

bast-shb commented 3 years ago

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.

DougMidgley commented 3 years ago

@bast-shb did you have the exact version?

bast-shb commented 3 years ago

@DougMidgley You mean the version I reverted to?

I did this in our pipeline:

sudo npm install sfdx-cli@7.86.3 --global as that was the latest previous version that worked for us.

So version 7.86.3.

uip-robot-zz commented 3 years ago

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

Raspikabek commented 3 years ago

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:

nikhileshmishra commented 2 years ago

@RodEsp @DougMidgley What was the solution for this error ? Is there any other way to resolve apart from forcing sfdx-cli to a previous version

shetzel commented 2 years ago

@nikhileshmishra this was fixed long ago so I would ensure you're using the most recent CLI version and do not have the salesforcedx plugin installed. Run sfdx plugins --core to list the core plugins and if salesforcedx is listed (as is listed in the OP) then run sfdx plugins:uninstall salesforcedx and rerun the deploy command. This definitely works as expected in recent CLIs.