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

CLI gives 403 on MacOS when given valid credentials #150

Open
larsyencken opened this issue Mar 12, 2024 · 3 comments
Open

CLI gives 403 on MacOS when given valid credentials #150

larsyencken opened this issue Mar 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@larsyencken
Copy link

Problem

On my Mac the CLI fails with 403 Invalid Application-ID or API key when doing algolia indices list, or most operations, when given correct credentials.

The credentials were verified on a comparison Linux system (Ubuntu 22.04.04 LTS amd64) with identical Algolia CLI release version and everything worked smoothly.

Params

  • Algolia CLI: 1.6.3
  • System: MacOS Sonoma 14.2.1

Side notes

  • Although most operations 403, algolia profile list works and correctly lists the number of indices alongside the credentials
@clemfromspace
Copy link
Collaborator

Hello @larsyencken and thanks for your report,

In both case, are you passing the Algolia credentials to the CLI through the flags (--api-key / --application-id) or using a profile? If you are using a profile, could you check the profile file content on the MacOS system?
I suspect a bug in the retro-compatibility of the profile format, since we recently changed some fields name in the profile (api_key vs admin_api_key).
Thanks!

@clemfromspace clemfromspace added the bug Something isn't working label Mar 25, 2024
@tonlam
Copy link

tonlam commented Apr 30, 2024

I change admin_api_key to api_key in config.toml and it works

@SvenDowideit
Copy link

SvenDowideit commented Jun 6, 2024

I'm getting the same thing from a "just brew installed algolia-cli", and from building from source here:

algolia-cli dowideit.sven$ ./algolia profile list
NAME        APPLICATION ID     NUMBER OF INDICES  DEFAULT
sandbox     8<----snip  15                 
production  8<----snip         62                 ✓
algolia-cli dowideit.sven$ ./algolia indices list
Algolia API error [403] Invalid Application-ID or API key

my ~/.config/algolia/config.toml file only has api_key entries, and adding an admin_api_key value doesn't help either

is there something I can do quickly to debug, or should I start reading the code?

I do get the same issue when I use the two cli params, and the same values work fine for some go code i've been using for other purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants