SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
229 stars 91 forks source link

Running `npx sfcc-ci code:deploy` results in "The requested URL was not found on this server" #321

Open Timi96 opened 2 years ago

Timi96 commented 2 years ago

I am on WINDOWS and seem to be the only one of my colleagues who face this issue when running npx sfcc-ci code:deploy resulting in the error message "The requested URL was not found on this server."

File: /lib/webdav.js Issue: The / at the start of WEBDAV_BASE string leads to the below REQUEST object:

REQUEST { baseUrl: 'https://*****.sandbox.us01.dx.commercecloud.salesforce.com', uri: '\on\demandware.servlet\webdav\Sites\cartridges\version1.zip', auth: { bearer: 'aY_TPqnkH19VOy-8AnyLmxV4Ov0' }, strictSSL: true, method: 'DELETE', callback: [Function (anonymous)] } which ends up as: https://*****.sandbox.us01.dx.commercecloud.salesforce.com//on/demandware.servlet/webdav/Sites/cartridges/version1.zip

Notice the double // before on/demandware.servlet, hence my suggestion to remove that forward slash from the string WEBDAV_BASE

Result: const WEBDAV_BASE = 'lib/webdav.json/demandware.servlet/webdav/Sites';

tobiaslohr commented 2 years ago

Thanks for raising @Timi96! Quick question: concatenating the baseUrl and the uri from the request details above would end up to https://*****.sandbox.us01.dx.commercecloud.salesforce.com\on\demandware.servlet\webdav\Sites\cartridges\version1.zip.

Do you make sure, not to pass --instance with a trailing / in the value?