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

Error: Could not fetch a list of the store channels: Request failed with status code 401

Open harnerdesigns opened this issue 2 years ago • 6 comments

Expected behavior

stencil start starts the stencil CLI.

Actual behavior

stencil start starts the stencil CLI, tries to fetch the store channels and fails with:

not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 401

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.

Steps to reproduce behavior

Environment

Stencil-cli version stencil --version: 5.0.0

Node version node -v: v14.18.1

NPM version npm -v: 6.14.15

OS: Ubuntu 18.04.6 LTS

This was working like 2 days ago, and nothing has changed in the theme, dependencies or anything since. I'm reaching out to the Store Owner to get them to generate a new Stencil CLI Token, which will hopefully resolve the issue, but it'd be nice if the Token system for the CLI wasn't so fragile.

harnerdesigns avatar Jul 07 '22 16:07 harnerdesigns

Update: New API Key worked. Actually, at first it didn't. I ran stencil start and it gave me some error about config. I ran it again and it worked. I am so grateful. This has been an absolute emotional roller coaster of a process.

I am having a similar issue, but mine says Error 404. Did getting a new Stencil Token solve the issue? So frustrating..

Stencil - 5.0.0

Node - v14.20.0

NPM - 6.14.16

I am having this same issue except the status code is 403 I downloaded the default theme that is used for a new store in my sandbox that I have made no changes to - just go to the new store, download the theme, unzip it, 'stencil init', 'npm install', 'stencil start':

"not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 403"

Theme: Cornerstone-6.6.1 Stencil Version: 5.3.3 Node Version: 14.20.0 (I am unable to install stencil with any version of node higher than this) NPM Version: 6.14.17

Again, I have made zero changes to the default theme. I download it and tried to stand it up locally with stencil and am receiving this error.

I've searched for any relevant information about how to fix it including:

  • creating a new API token - did not work
  • downgrading the version of stencil to 3.1.1 - wouldn't even install without errors

The reason that I'm doing this with a unchanged default theme is that I'm having trouble standing up a custom theme from a client and am running into problems, so I thought if I could get the default them, unchanged, to work, then that might give me some idea why the custom theme isn't working, but I can't even get the default them to work - this is VERY frustrating!

cliffvick avatar Nov 05 '22 05:11 cliffvick

@cliffvick I worked through this issue today and hope this can help you as well!

  • Uninstall the version(s) of Node you are having Stencil issues with (nvm uninstall vXXX) - this clears out any version of Stencil that is tied to that version of Node on your machine
  • nvm ls to make sure the Node version(s) are no longer listed as installed
  • Reinstall the same version or just the latest of that version (nvm install v14) and check that you are on that node version with nvm -v
  • Make sure your npm version is < 7 as Stencil seems to install more compatibly with this version (npm -v)
  • Check your stencil version with stencil -V
  • If you want to install a specific version of Stencil you know works with your version of Node, use something like this for installing version 3.6.3: npm install -g @bigcommerce/[email protected] (3.6.3 works with Node v12.22.12 if you're looking for a compatible version)
  • Otherwise just run npm install -g @bigcommerce/stencil-cli to install the latest Stencil version
  • Close your terminal and open a new one
  • Switch back to the version of Node you just installed Stencil on (nvm use XX)
  • Check Stencil version with stencil -V and it should be the version you just installed
  • If all looks good, run stencil start and you will hopefully be on your way!

cmegalo avatar Nov 15 '22 23:11 cmegalo

Hi @cmegalo.. I followed your steps but no luck, I still have not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 403.. any advice?

@cliffvick did you successfully run stencil start?

Dwiga avatar Nov 28 '22 00:11 Dwiga

Hi, I am getting still same Issue not resolve node --version v14.21.3 npm --version 8.19.4 stencil --version 7.0.0 nvm --version 0.31.0

When I run stencil start

No api host found in config file, falling back to https://api.bigcommerce.com. You may need to run 'stencil init' again.
not ok -- Error: Could not fetch a list of the store channels: Request failed with status code 401

amanuser avatar Apr 05 '23 14:04 amanuser

I have issue

pkpawan460 avatar Dec 22 '23 08:12 pkpawan460