Release v51 breaks mdapi deployment
See original GitHub issueSummary
In release v51, force:mdapi:deploy
now uses the REST API by default, which is failing with a JSON parser error. See below for error stack.
Steps To Reproduce:
- Run the mdapi deployment without the --soapdeploy parameter
$ sfdx force:mdapi:deploy -u <env> -d <dir> --json -l RunSpecifiedTests -r skip
Expected result
Deployment is queued
Actual result
{
"status": 1,
"name": "Error",
"message": "JSON_PARSER_ERROR: Can not deserialize: unexpected array at [line:1, column:73]",
"exitCode": 1,
"commandName": "MdapiDeployCommand",
"stack": "Error: JSON_PARSER_ERROR: Can not deserialize: unexpected array at [line:1, column:73]\n at Request._callback (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/salesforce-alm/dist/lib/core/force.js:590:29)\n at Request.self.callback (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/request/request.js:185:22)\n at Request.emit (events.js:315:20)\n at Request.EventEmitter.emit (domain.js:467:12)\n at Request.<anonymous> (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/request/request.js:1154:10)\n at Request.emit (events.js:315:20)\n at Request.EventEmitter.emit (domain.js:467:12)\n at IncomingMessage.<anonymous> (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/request/request.js:1076:12)\n at Object.onceWrapper (events.js:421:28)\n at IncomingMessage.emit (events.js:327:22)\n at IncomingMessage.EventEmitter.emit (domain.js:467:12)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)\nOuter stack:\n at Function.wrap (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n at MdapiDeployCommand.catch (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/salesforce-alm/dist/ToolbeltCommand.js:248:46)\n at MdapiDeployCommand._run (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/@salesforce/command/lib/sfdxCommand.js:85:13)\n at Config.runCommand (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/@oclif/config/lib/config.js:173:24)\n at Main.run (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/@oclif/command/lib/main.js:27:9)\n at Main._run (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/node_modules/@oclif/command/lib/command.js:43:20)\n at Object.run (/Users/alan.ly/.local/share/sfdx/client/7.88.4-3b2e55c3f1/dist/cli.js:121:21)",
"warnings": []
}
Additional information
Feel free to attach a screenshot.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version): Version 7.88.4 SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core) Version 51.0.4 OS and version: macOS Catalina Version 10.15.7
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Run force:mdapi:deploy Instead of ... - Salesforce Developers
If you run force:source:deploy, from then on, force:source:push will always push all source from your local project to your org, which can lead...
Read more >Version Controlling Profiles and Why It Makes Sense for ...
Deployment of the profile packages can be done via source or mdapi deployment commands from the SFDX CLI. If you are looking to...
Read more >Property 'valueSet' not valid in version 37.0 - Gearset
In some releases, there aren't major or breaking changes between API ... Attempting to deploy metadata containing a value set via the v37 ......
Read more >Most Frequently used SFDX Commands – Home - Jitendra Zaa
Retrieve and Deploy code in Sandbox using SFDX – Old File Format ... 2, echo "Command - sfdx force:mdapi:retrieve -r metadata -u pathtocode...
Read more >Metadata API Developer Guide
Deploy Metadata with REST API in Salesforce CLI . ... For the release, move metadata from the repository to production by pulling the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@aly76 - This specific error is due to the CLI sending the
runTests
property as a string but the REST API expects an array. That is an easy fix and we’ll let you know when it’s in latest-rc.The current workaround is to use --soapdeploy and everything works as expected