Receiving "The 'path' argument must be of type string. Received type object" during force:source:deploy/retrieve
See original GitHub issueThe full thread of discussion is available here for context:
https://success.salesforce.com/0D53A00004MMUPU
but the short version is that on May 10, 2019, I suddenly started to receive this error when deploying/retrieving metadata against my DE org using force:source:deploy/retrieve
:
$ sfdx force:source:deploy -u alias -x manifest/package.xml --json
{
"status": 1,
"name": "TypeError [ERR_INVALID_ARG_TYPE]",
"message": "The \"path\" argument must be of type string. Received type object",
"exitCode": 1,
"commandName": "SourceDeployCommand",
"stack": "TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Object.join (path.js:427:7)\n at CustomObjectSubtypeMetadataType.getAggregateMetadataFilePathFromWorkspacePath (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\metadataTypeImpl\\customObjectSubtypeMetadataType.js:29:21)\n at new _SourceLocations (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:31:64)\n at new SourceWorkspaceAdapter (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceWorkspaceAdapter.js:49:28)\n at SourceDeployApi.doDeploy (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceDeployApi.js:35:20)\nOuter stack:\n at Function.wrap (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:151:27)\n at SourceDeployCommand.catch (c:\\Program Files\\Salesforce CLI\\client\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:216:46)",
"warnings": []
}
If you scroll to the bottom of that thread, I confirmed that the problem occurs against this org via the latest build of the Salesforce CLI from both Windows and Mac, and it does not occur against other orgs that I’ve tried. Whatever is going on seems to be specific to this org which has worked well for me for the past 5-6 years.
The organization ID is 00D610000006x9HEAQ
. I’m happy to provide support access to this organization for reproduction purposes. Just let me know when you’re ready for that. Reproduction should be as simple as running:
$ sfdx force:source:retrieve -u <alias> -m 'CustomObject:Account'
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
It happens for me when executing the
sfdx force:source:deploy -p <package_path> -u <username>
command while having an incorrect directory structure in the package for example:instead of
no longer reproducible for me on current plugin-source for the example that @pawelhajduk-ef shared
The error message @SCWells72 sees won’t occur with the new plugin (something else might though if the org is somehow broken). I’ll optimistically close this one.