forcedotcom / forcedotcom/commerce-on-lightning
sfdx commerce:products:import fails with ENOENT file not found, yet running sfdx shane:data:file:upload on the exact same file does work.
- Dominant language
- TypeScript
- Stars
- 84
- Forks
- 84
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
sfdx commerce:products:import --products-file-csv=./config/NorthernTrail.csv --store-name=D2C --type=b2c -u myscratch --apiversion=57.0
Importing products.
› Warning: sfdx-cli update available from 7.177.1 to 7.183.1.
› Warning: sfdx-cli update available from 7.177.1 to 7.183.1.
[Error: ENOENT: no such file or directory, open './config/NorthernTrail.csv'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './config/NorthernTrail.csv'
}
ERROR running commerce:products:import: {
"status": 1,
"name": "Error",
"message": "form-data: ENOENT: no such file or directory, open './config/NorthernTrail.csv'",
"exitCode": 1,
"commandName": "Upload",
"stack": "Error: ENOENT: no such file or directory, open './config/NorthernTrail.csv'\nOuter stack:\n at SfdxError.wrap (/Users/peter.knolle/.local/share/sfdx/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n at Upload.catch (/Users/peter.knolle/.local/share/sfdx/node_modules/@salesforce/command/lib/sfdxCommand.js:248:67)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Upload._run (/Users/peter.knolle/.local/share/sfdx/node_modules/@salesforce/command/lib/sfdxCommand.js:85:13)\n at async Config.runCommand (/usr/local/lib/sfdx/node_modules/@oclif/core/lib/config/config.js:272:25)\n at async run (/usr/local/lib/sfdx/node_modules/@oclif/core/lib/main.js:74:5)",
"warnings": [],
"command": "sfdx shane:data:file:upload -f ./config/NorthernTrail.csv -u \"test-0wvdfppshr61@example.com\" --json --apiversion=57.0"
}
Importing products.... ⡿ Uploading...
BUT THIS WORKS:
sfdx shane:data:file:upload -f ./config/NorthernTrail.csv -u test-0wvdfppshr61@example.com --json --apiversion=57.0
{
"status": 0,
"result": {
"attributes": {
"type": "ContentVersion",
"url": "/services/data/v57.0/sobjects/ContentVersion/06801000002BgndAAC"
},
"Id": "06801000002BgndAAC",
"ContentDocumentId": "06901000002C159AAC"
}
}
What's going on that the code in commerce:products:import doesn't work?
Contributor guide
Research direction
Start at the commerce:products:import command implementation and trace how it passes ./config/NorthernTrail.csv to the upload operation. Reproduce the failing import and the working shane:data:file:upload command, then compare their relative-path handling. Done means products:import accepts the same existing relative file path and completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100