ForceCLI/force

source:retrieve issue

Closed this issue · 2 comments

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}

Hi Robert, https://github.com/forcedotcom/cli is the repo for reporting sfdx cli issues.

The force cli command for fetching metadata using package.xml is force fetch -x src/package.xml.

Thanks @cwarden , I will post it over there. I am doing a trailhead and the retrieve call was specifically listed to use so maybe they just need to update it. The trailhead is Create a Salesforce DX Project