bigcommerce / stencil-cli

BigCommerce Stencil emulator for local theme development
https://developer.bigcommerce.com/stencil-docs
BSD 4-Clause "Original" or "Old" License
101 stars 141 forks source link

stencil start 403 (stencil version check producing cloudflare challenge) #975

Open edward-simpson opened 2 years ago

edward-simpson commented 2 years ago

Expected behaviour

Running stencil start a local development version of the site should be spun up without issue

Actual behaviour

Error reported:

not ok -- Error: The BigCommerce Store you are pointing to either does not exist or is not available at this time.
Error details:
Request failed with status code 403

The request in question is to the /stencil-check-version endpoint, the response is a cloudflare security challenge

Screenshot 2022-08-31 at 09 58 29

This also occurs if we bypass the client's CF using a host file entry, but we're unsure whether BC CF is fingerprinting the request and still presenting the same challenge when going direct.

We've been able to bypass this by using the normalStoreUrl (initialStencilConfig.normalStoreUrl) in the checkCliVersion call in the stencil start command

Steps to reproduce behaviour

Proxy the site through cloudflare using a custom url and subdomain (e.g. bc.site-url.com), with the custom url as the channel url in bigcommerce.

Environment

Stencil-cli version stencil --version: 5.1.0

Node version node -v: 14.19.3

NPM version npm -v: 6.14.17

OS: Monterey 12.0.1 w/ M1 chip (but occurs on non M1 chip)

davidalexander commented 2 years ago

+1 Exact same issue for me.

diztinct-glenn commented 2 years ago

+1 same issue here as well. please advise. This seems to be only for older projects that I'm working on though

mradilamin commented 1 year ago

same issue with me.

davidalexander commented 1 year ago

Confirmed the same occurs with latest version of stencil (6.0.0)

onur-o7 commented 1 year ago

I had to same issue, but i manage to solve that with VPN thru USA.

bc-bm commented 1 year ago

Hi All

I see the issue is still open and wanted to share a workaround we found for this so that it can benefit anyone who is still blocked. Since using CF is what causes this, we found a way to add a redirect rule for the Stencil version check to use the store's permanent URL. Please see image below.

image

Thanks.