Hello,
I am starting local development with HubSpot CLI, but I am running into an issue authenticating my account. When I try to authenticate, I get the corresponding output/errors after providing my personal access key (which is copy/pasted, so it should be correct):
$ hs account auth--------------------------------------------------HubSpot Personal Access Key SetupA personal access key is required to authenticate the CLI to interact with your HubSpot account.--------------------------------------------------? Choose your preferred method of authentication Enter existing personal accesskey? [--personal-access-key] Enter your personal access key: <masked-key-here>[ERROR] Failed to update the configuration file. Please try again.
Any guidance here would be much appreciated. I’d love to get in here to start learning and setting up a new project, but this is blocking me from moving forward.
Hey @Kevin_Hill - thanks for posting in the Community!
I’d like to tag in a few developer experts to assist here! @dsmarion, @Syeda_Fatima, and @MadisonMoniz - any insight that may be able to assist @Kevin_Hill with authenticating their account?
Your personal access key is found in your developer account.
Thanks for the reply, maybe I wasn’t clear. I found my personal access key just fine - my question is why I get the above error when I enter it in the CLI
Oh, I see. Hmmm. Well the placement of the config file has recently changed to a new global location. Check out this video in the HubSpot Developer’s Youtube which explains all that and see if that helps.
Hi Scott,
I just followed along that video, and I still get the same result. Could this be prompted by firewall settings (on my company’s side) blocking the auth verification call after the personal key is submitted? It’d be helpful if it’s known what causes this particular error to appear, but it’s pretty generic and I couldn’t find it searching around.
For additional context: When I run hs account auth it generates the .hscli directory, and the config.yml file within it. But if I open that YAML file, all that’s inside is
accounts: []
Instead of hs account auth try running just hs auth
No luck with hs auth either. I’m going to connect with my company’s networking team and see if they can spot activity being blocked by our firewall. If that ends up being the issue, I’ll update here.
At this point I am not sure but that may be a possibity. I had an issue back a while ago where my VPN would not allow ui extensions to run. I am sorry you’re having this problem and I don’t really have any other suggestions other than maybe try it on a personal device not connected to your company if you can.
Hi @Kevin_Hill
that error usually isn’t the key itself, it’s the CLI failing to write your config.
Since April 2025 the CLI uses a single global file at ~/.hscli/config.yml, so if that path is read-only, synced, or owned by another user you’ll see “Failed to update the configuration file” and end up with accounts: []. First, update the CLI and verify version, then check permissions/ownership on ~/.hscli and config.yml.
On macOS/Linux, ls -ld ~/.hscli ~/.hscli/config.yml should show your user; if not, chown it back and set perms to 700 on the folder and 600 on the file, then re-run hs account auth (New Global Configuration )
Next, confirm you’re creating and pasting a Personal CMS Access Key from your HubSpot account (not an OAuth token or Private App token). Personal Access Keys are the supported method for local tools and the doc walks through generation and usage, including scope and rotation notes
(https://developers.hubspot.com/docs/cms/start-building/introduction/developer-environment/personal-access-key )
Two quick gotchas I see in corporate environments: OneDrive/Desktop sync on Windows or a managed macOS profile can make ~ effectively read-only try setting HOME to a non-synced path or authenticate on an unmanaged user profile.
Company VPNs or SSL inspection don’t typically block writing the file, but they can block the follow-up validation; you can prove it’s a local write problem by running hs account list immediately after the error if it shows zero accounts, the write failed before any network call. If you can share: are you on Windows/WSL or macOS, and is your home directory under a sync/MDM policy? That helps narrow whether it’s file permissions vs. network.
Hi!
I had the same issue and it was our firewall blocking the connections. Some suggestions:
1. Run the command with debug enabled:
hs account auth --debug
2. Look for the error, in my case it was:
[DEBUG] Sending usage event to unauthenticated endpoint[DEBUG] Failed to send usage event to unauthenticated endpoint[ERROR] Failed to update the configuration file. Please try again.
3. If it is indeed a firewall issue, you can try to disable (temporarily) the SSL certificate validation with this command:
$env:NODE_TLS_REJECT_UNAUTHORIZED=0
4. Run "hs account auth" again
It should now work (at least it did for me
)
Thanks for your suggestion @LuisEstrada !!
Best, Victor