axiomhq / cli

The power of Axiom on the command line.
https://axiom.co
MIT License
41 stars 11 forks source link

First install & authentication can result in an `API Error 404: Not Found` #230

Closed boomskats closed 6 months ago

boomskats commented 6 months ago

What happened

I just installed the cli and followed the basic initial steps to get going:

The moment the oauth callback returned to localhost the CLI returned gave me a 404. Screenshot shows full context.

image

OS/versions

~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) took 3s 
❯ uname -a
Linux b7 6.8.8-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Apr 27 17:53:31 UTC 2024 x86_64 GNU/Linux

~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) 
❯ getenforce
Enforcing

~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) 
❯ google-chrome --version
Google Chrome 126.0.6452.3 dev
boomskats commented 6 months ago

Adding -o [org-id] to axiom auth login resolves this. Might be docs issue or user error, feel free to close.

lukasmalkmus commented 6 months ago

Hi @boomskats, thanks for the in depth report. This is definitely not just a docs error, I'll take a look.

lukasmalkmus commented 6 months ago

@boomskats I just pushed a new release, please give that a try :)

boomskats commented 6 months ago

It gives me an error now. Not sure if this is expected behaviour looking at auth_login.go?


~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) 
❯ go install github.com/axiomhq/cli/cmd/axiom@latest
go: downloading github.com/axiomhq/cli v0.12.2

~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) took 3s 
❯ axiom auth login
? You need to login to Axiom. Should I open your default browser? Yes
Waiting for authentication...
β£·Error: missing organization id

~ via 🐹 v1.22.2 via  v20.11.1 on ☁️  (eu-west-2) took 11s 
❯ 
lukasmalkmus commented 6 months ago

@boomskats Sorry for the inconvenience. Now you should be good with the latest release.

We're evolving our APIs and it turned out there was a slight hack in place in CLI to circumvent a shortcoming with the client library it uses (axiom-go). I initially just dropped that as I thought it isn't required anymore with the new API but in reality, Axiom Go was causing the problem and was missing a slight detail when used with the new API.

Should be all good, now :)

Thanks again for your continuous reports <3