question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Release v51 breaks mdapi deployment

See original GitHub issue

Summary

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:

  1. 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
shetzelcommented, Mar 3, 2021

@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.

2reactions
azlam-abdulsalamcommented, Feb 24, 2021

The current workaround is to use --soapdeploy and everything works as expected

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found