commerce-on-lightning icon indicating copy to clipboard operation
commerce-on-lightning copied to clipboard

sfdx commerce:products:import fails with ENOENT file not found, yet running sfdx shane:data:file:upload on the exact same file does work.

Open peterTrifecta opened this issue 1 year ago • 3 comments

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 "[email protected]" --json --apiversion=57.0" } Importing products.... ⡿ Uploading...

BUT THIS WORKS: sfdx shane:data:file:upload -f ./config/NorthernTrail.csv -u [email protected] --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?

peterTrifecta avatar Mar 17 '23 19:03 peterTrifecta

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

github-actions[bot] avatar Mar 17 '23 19:03 github-actions[bot]

When I changed to use the absolute path it worked. Relative paths may not work. That should be noted if it's like that on purpose or fixed if it's a bug.

Running from the project root at /Users/peter.knolle/work/dev/project: --products-file-csv=/Users/peter.knolle/work/dev/project/config/NorthernTrail.csv works --products-file-csv=./config/NorthernTrail.csv does not work

peterTrifecta avatar Mar 17 '23 19:03 peterTrifecta

I have the same issue even if the CMS content is created I can't see products on salesforce backend, no cms project is created in the backend

alarrosa2 avatar Apr 26 '23 09:04 alarrosa2