forcedotcom / commerce-on-lightning

An SFDX Plugin to setup a B2C or B2B Store
BSD 3-Clause "New" or "Revised" License
63 stars 75 forks source link

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

Open peterTrifecta opened 1 year ago

peterTrifecta commented 1 year ago

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?

github-actions[bot] commented 1 year ago

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.

peterTrifecta commented 1 year ago

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

alarrosa2 commented 1 year ago

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