1

When I do a
sfdx force:source:retrieve --manifest assets/package.xml --targetusername DevHub --wait 10 --loglevel TRACE

I am getting the error ERROR running force:source:retrieve: Cannot convert undefined or null to object.

When I review the log I am seeing something that I believe is a bit odd but I am not entirely sure. Why is it looking for the project file in my user directory? I'm not sure how to troubleshoot this. I'm running the command from within my project root which is not in my user directory.

sfdx --version => sfdx-cli/7.82.0-3d0c527ac6 win32-x64 node-v12.18.3

log result

{"name":"sfdx","hostname":"Rstru147310","pid":2552,"log":"SfdxProjectJson","level":40,"msg":"The config file: C:\\Users\\Rob\\.sfdx\\sfdx-project.json is not schema valid\nDue to: Validation errors:\nshould have required property 'packageDirectories'","time":"2020-12-21T15:25:20.085Z","v":0}
{"name":"sfdx","hostname":"Rstru147310","pid":2552,"log":"SfdxProjectJson","level":40,"msg":"The config file: C:\\Users\\Rob\\.sfdx\\sfdx-project.json is not schema valid\nDue to: Validation errors:\nshould have required property 'packageDirectories'","time":"2020-12-21T15:25:20.089Z","v":0}
{"name":"sfdx","hostname":"Rstru147310","pid":2552,"log":"SourceRetrieveCommand","level":50,"msg":"[\n  '\\u001b[1mERROR running force:source:retrieve: \\u001b[22m',\n  '\\u001b[31mCannot convert undefined or null to object\\u001b[39m'\n]","time":"2020-12-21T15:25:20.096Z","v":0}

1 Answer 1

2

Turns out the issue was that the package.xml file located in the assets directory was corrupt. I copy/pasted it from trailhead so I am assuming there was some special characters in the stream somewhere (although I did check for that early on and didn't see any) because it worked fine when I created a new package.xml file from scratch.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .