I'm stumped on this one. I get that the error has to do with an API version mismatch, but as far as I can see everything is on the same version.
I'm trying to pull an unmanaged package from my sandbox using force:mdapi:retrieve
, so that I can extract the package.xml file and use it with the new sfdx force:source:retrieve
CLI command, which was released in Winter '19.
My Sandbox API is 44.0 (highest selectable version for an Apex class in dev console).
My SFDX Project API is 44.0 ("sourceApiVersion":"44.0" in sfdx-project.json). It's a new project created today expressly to test this.
My VSCode Salesforce Extension Pack is v44.11.0
Here's what I got in my VSCode terminal:
PS P:\SpreadsConsolidation> sfdx force:mdapi:retrieve -p "Spreads Consolidation" -s -u fullcopy -r ./mdpkg
Retrieving source...
ERROR: UNSUPPORTED_API_VERSION: Invalid Api version specified on URL.
Adding the -a 44.0
flag got the same error.
What am I missing here?
Best Answer
Thanks to sfdcfox and the commenters above for the solution!
in CLI terminal,
sfdx force --version
andsfdx plugins
revealed to me that even if my VSCode extensions are v44, and my CLI version issfdx-cli/6.44.0-dead729fb5 (windows-x64) node-v8.9.4
... well, apparently sfdx itself (which I thought was an abstraction) has a version #, and it was 45.Solution is to manually override the API version used by your project