stencil-cli icon indicating copy to clipboard operation
stencil-cli copied to clipboard

StoreSettingsLocaleError - 403

Open liamxtensive opened this issue 3 years ago • 9 comments

Expected behavior

When trying to stencil start, I get the following error:

`not ok -- StoreSettingsLocaleError: Request failed with status code 403

Please visit the troubleshooting page https://developer.bigcommerce.com/stencil-docs/deploying-a-theme/troubleshooting-theme-uploads. If this error persists, please visit https://github.com/bigcommerce/stencil-cli/issues and submit an issue.`

Actual behavior

Steps to reproduce behavior

Environment

Macbook 2021 (M1) - using Rosetta on Terminal

Stencil-cli version stencil --version: 3.7.0

Node version node -v: 12.22.7

NPM version npm -v: 6.14.15 OS: Mac OS Monterey

liamxtensive avatar Dec 11 '21 14:12 liamxtensive

Not an answer, but at least maybe a temporary workaround. I backed Stencil-CLI back to 3.6.2, and that seems to have resolved the error for me.

STLCajun avatar Dec 12 '21 00:12 STLCajun

Just downloaded a fresh stencil-cli and Cornerstone theme to get started on a new site and I struck exactly the same issue with the error not ok -- StoreSettingsLocaleError: Request failed with status code 403

For now I stepped back to the previous version of node used in my last BC project nvm use 12.9.0 which loads stencil-cli 3.5.1 which works as expected.

P4ulJC avatar Dec 13 '21 00:12 P4ulJC

You have to create a new Stencil CLI token as the note on the release also states. I got the same error with my old token

tomhelmer avatar Dec 15 '21 09:12 tomhelmer

Thanks tomhemler. Creating a new Stencil CLI token fixed the issue.

The below stencil init command as in the BC documentation didn't work at first:

stencil init --url https://www.domain.com.au --token xxxxxxxxxxxxxxxxxxx --apiHost https://api.bigcommerce.com

It failed with error: unknown option '--apiHost'

Leaving off the --apiHost option works and stencil init adds the default api host for you anyway.

One glitch in my case is the stencil API token is not listed in the BC admin although it is all working. It looks like none have been created - just totally empty. So if it looks like nothing happened when you created the token and hit Save give it a go before you try creating one again. It might work anyway like it did for me although you can't see it in the admin.

P4ulJC avatar Dec 16 '21 23:12 P4ulJC

Not an answer, but at least maybe a temporary workaround. I backed Stencil-CLI back to 3.6.2, and that seems to have resolved the error for me.

I to got resolved when I downgraded the stencil-CLI back to 3.6.2, This may be a problem for stores that have multiple languages while using v3.7.1(latest at the time) v3.7.1 works well with the store that doesn't have multiple languages

Dev05-Telnet avatar Dec 21 '21 11:12 Dev05-Telnet

We ran into this issue as well. Basically, stencil-cli 3.7 appears to require an additional scope that was not required previously. Seemingly, BigCommerce is adding these requirements without telling anyone. You now need the following scopes to run stencil:

  • Information & Settings: Modify (previously not required)
  • Themes: Modify (or read-only if not publishing)
  • Sites & routes: read-only

Because API accounts cannot be modified, you will need to create a new one. If you are not the store owner, you will need to ask the store owner to do this.

A temporary fix is to revert to an older version of stencil-cli: npm install -g @bigcommerce/[email protected]

However, it is expected that this version of stencil-cli will become deprecated at some point, so it's probably best to just get the new API token as soon as possible.

mattcoy-arcticleaf avatar Dec 21 '21 21:12 mattcoy-arcticleaf

@liamxtensive For me, the solution was to generate a new Stencil-CLI token and update the accessToken in secrets.stencil.json.

alexmosk-miracommerce avatar Jan 11 '22 11:01 alexmosk-miracommerce

Just be careful with the approach of generating a Stencil CLI token. If you have the new API Accounts admin interface, it does not generate with the required scopes. Basically, just make sure the token has "Information & Settings" scope after you create it!

mattcoy-arcticleaf avatar Jan 11 '22 15:01 mattcoy-arcticleaf

Why is this still a problem with version 5.0.0? It's not closed yet and still have the same not ok -- StoreSettingsLocaleError: Request failed with status code 403

FredvanRijswijk avatar Jun 21 '22 08:06 FredvanRijswijk