When I run a command like npx hs fetch --overwrite my-theme my-theme, the terminal shows the following error. Although I was able to fetch before, now it doesn’t work.
How should I proceed to fix this issue?
[ERROR] The post in account XXX was not found. The account XXX doesn’t exist. Enter a valid ID and try again.
Even though I’m sure the account exists, why does the above fetch command appear?
Also, is it possible for something like this to happen even though I haven’t made any changes recently?
Hi @TMisuna, thanks for getting back to us and thanks so much for your help @Anton!
Let’s see if we can get you some help: Hi @sylvain_tirreau, @SteveHTM and @Anton do you have suggestions to help @TMisuna, please?
Have a great day and thanks so much!
Bérangère
Hi @TMisuna, getting back to you on this, thanks for your patience.
The error “The account doesn’t exist” with npx hs fetch means the CLI can’t authenticate your HubSpot account.
Can you please try the following steps:
1. Re-authenticate:
Run hs account auth, generate a new Personal Access Key, and set this account as default when prompted.
2. Verify:
Run hs accounts to confirm which accounts are authenticated. Use hs accounts use [accountName] to select the correct default.
3. Retry your fetch:
hs fetch --overwrite my-theme my-theme
Please note that npm install -g @hubspot/cli && hs init installs the CLI globally and starts authentication, but hs account auth is now the preferred method.
If still failing, check your Personal Access Key:
- Navigate to your HubSpot account settings
- Verify the Personal Access Key hasn’t expired
- Regenerate if necessary and re-run hs account auth
The error can occur even without recent changes if your access token expired or if there’s a mismatch between the CLI configuration and HubSpot’s authentication system.
Also, here are some resources that might help you:
- Install the HubSpot CLI
- HubSpot CLI commands (v7.6.0)
Let me know if that helped.
Have a great weekend!
Bérangère