Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme kit access app - Invalid API key or access token #954

Closed
hugos opened this issue Aug 25, 2021 · 13 comments
Closed

Theme kit access app - Invalid API key or access token #954

hugos opened this issue Aug 25, 2021 · 13 comments

Comments

@hugos
Copy link

hugos commented Aug 25, 2021

Describe the bug
When using the new theme kit access app it always gives me this error: [API] Invalid API key or access token (unrecognized login or wrong password)

To Reproduce
Steps to reproduce the behavior:

  1. run command 'theme get --password=[themeki tapp generated password] --store=store.myshopify.com'

Environment (please complete the following information):

  • OS: Mac os big sur
  • Themekit version (run theme version to check): 1.3.0

Additional context
Of all the times that I've tried using it it has only worked once. This is also happening to a lot of my colleagues.

@denisinla
Copy link

@hugos Your current command does not work since it contains unknown flag --name. If you're trying to create a new theme the proper command is theme new --password=[your-password] --store="[your-store.myshopify.com]" --name=[theme name]

@hugos
Copy link
Author

hugos commented Aug 31, 2021

@denisinla My bad that's just a typo on I don't actually write it like that lol. I spoke to Shopify, this is known issue there they are trying to fix it.

@robertjmcinnis
Copy link

I have what seems to be the similar issue.

Theme Kit was working fine on our development store. Then, I started getting this error whenever I tried to run any theme commands, for example:

Steps:

  • Using Theme Kit 1.3
  • OS: Mac os big sur
  • Run any themekit commant (eg/ theme watch)
  • After about a minute an error would appear:
    request failed after 5 retries with error: Get https://theme-kit-access.shopifyapps.com/cli/meta.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  • Follow the JSON in the error message, https://theme-kit-access.shopifyapps.com/cli/meta.json. The JSON reads like this: {“errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"
  • I’ve tried several things to remedy but all unsuccessful - Updating Theme kit, Homebrew, switching between Theme Kit Access App / Private App, Updating OS, different shopify stores.
  • The only thing that fixed it was switching to a different internet connection. After switching to a different IP theme kit works like normal.

@hugos
Copy link
Author

hugos commented Apr 3, 2022

It's unbelievable that this is still happening.

@fibonacid
Copy link

fibonacid commented Apr 11, 2022

I've found that you can bypass this problem by creating a custom app and configure the Admin API permission to
read_themes,write_themes.

Anyone who is experiencing issues using the Theme Kit Access app can simply add this section into their README.md

### Bypassing \[API\] Invalid API key or access token

Sometimes the passwords generated with the Theme Kit Access app don't work. When that happens, it's pretty simple to create an access role manually:

- Log into your store dashboard 
- Click on _Apps_
- Click on _Develop apps_
- Click on _Create an app_
- Give it a name and click on _Create app_
- Click on _Configure Admin API scopes_
- Find the _Themes_ section inside _Admin API access scopes_ and select the following: `write_themes`, `edit_themes`.
- Click on _Save_
- Navigate to the _API credentials_ tab and click on _Install app_
- Install the app, then create an Admin API access token.
- Reveal access token and use it as themekit password

@hugos
Copy link
Author

hugos commented Apr 11, 2022

That's the "old way" and frankly, the one that works flawlessly all the time.

Shopify came with the theme kit access app so devs would stop using the private apps way.
So yeah, your solution is essentially what every dev has been doing since the beginning, unfortunately.

@fibonacid
Copy link

Yeah, alternatively you can include source code in the repo and use the Github integration.
There are a few options for this, but currently the best one i tried is using git subtrees.

  1. Create repo for source code
  2. Create repo for compiled code
  3. Connect a branch of the compiled repo to a Shopify Theme
  4. Build code from src to dist (include dist in version control)
  5. Push contents of dist on the source repo to the root of the compiled repo with:
git subtree push --prefix dist compiled-repo-url $(git branch --show-current)
  1. Pull contents of compiled repo into dist with:
git subtree pull --prefix dist compiled-repo-url $(git branch --show-current) --squash

You can abstract the process of keeping the dist folder always in sync with the subtree by using git hooks:

flowchart TD
    subgraph pre_commit_hook[pre-commit]
        stash_unchanged[git stash -q --keep-index]-->build_theme
        build_theme[yarn build]-->stage_changed[git add -u]
        stage_changed-->apply_stashed_changes=[git stash pop -q]
    end
    subgraph pre_push_hook[pre-push]
        pull_subtree[yarn subtree:pull]
    end
    subgraph post_push_hook[post-push]
        push_subtree[yarn subtree:push]
    end
    pre_commit_hook-->git_commit[git commit]
    git_commit-->pre_push_hook
    pre_push_hook-->git_push[git push]
    git_push-->post_push_hook
Loading

@chippleh1392
Copy link

I had this issue with Theme Kit Access and was able to fix it by updating Theme Kit to the latest version.

@colinwolf911
Copy link

[API] Invalid API key or access token (unrecognized login or wrong password) :(

@laimoh
Copy link

laimoh commented Nov 19, 2022

I'm on the latest version and still having this error....

@hugos
Copy link
Author

hugos commented Nov 21, 2022

It's still happening to me to this day as well. I just use the private apps method.
I'll be closing this for now as this as been happening for too long and a solution does not seem to be coming any time soon.

@hugos hugos closed this as completed Nov 21, 2022
@leobaixinxin
Copy link

leobaixinxin commented Oct 1, 2023

I have what seems to be the similar issue.

Theme Kit was working fine on our development store. Then, I started getting this error whenever I tried to run any theme commands, for example:

Steps:

  • Using Theme Kit 1.3
  • OS: Mac os big sur
  • Run any themekit commant (eg/ theme watch)
  • After about a minute an error would appear:
    request failed after 5 retries with error: Get https://theme-kit-access.shopifyapps.com/cli/meta.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  • Follow the JSON in the error message, https://theme-kit-access.shopifyapps.com/cli/meta.json. The JSON reads like this: {“errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"
  • I’ve tried several things to remedy but all unsuccessful - Updating Theme kit, Homebrew, switching between Theme Kit Access App / Private App, Updating OS, different shopify stores.
  • The only thing that fixed it was switching to a different internet connection. After switching to a different IP theme kit works like normal.

it works, thanks a lot

@PaulAShortt
Copy link

Hi everyone,

I just wanted to add that I came across another instance of this issue: https://shopify.zendesk.com/agent/tickets/51939910

Store: https://app.shopify.com/services/internal/shops/59198537794

In this instance, the issue was caused by the merchant plugging in the store's BrandedDomain instead of the Permanent Domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants