Getting 404 upon coder login

Hi all, I've just installed coder on k8s and wanted to create my first template. The server is accessible from an https endpoint but when running coder login https://coder-server.example I get a 404 for the token url. (the internal-auth?show_token=true path) Am I missing something obvious here? Image
No description
25 Replies
Phorcys
Phorcys3y ago
hey, this issue occurs because you are using an outdated CLI, can you post the output of coder version ?
tfishler
tfishlerOP3y ago
# coder --version
coder version v1.36.0 go1.16.7 darwin/amd64 4c585c65b518dd3ad41391360af456fe573d8b1e
# coder --version
coder version v1.36.0 go1.16.7 darwin/amd64 4c585c65b518dd3ad41391360af456fe573d8b1e
Installed with brew.
Phorcys
Phorcys3y ago
yeah, that's the wrong package, this is the CLI for Coder Classic (v1) but your server is using Coder OSS (v2) I don't know if brew has a package for it but here's the right CLI : https://github.com/coder/coder
tfishler
tfishlerOP3y ago
🤦‍♂️ Thanks.
Phorcys
Phorcys3y ago
I was confused too at first since the repo for the Coder v1 CLI is called coder-cli, so this doesn't help lol you can mark this post as resolved by using /resolve when it works for you
tfishler
tfishlerOP3y ago
So I just install coder itself and don't run the server? Or is there a specific cli only installation script? I mean curl -L https://coder.com/install.sh | sh ?
Phorcys
Phorcys3y ago
yes for that first question, the architecture of Coder OSS is that the CLI is also the server and vice-versa, which took me a bit of time to understand yup, that's the one
tfishler
tfishlerOP3y ago
Cool. Thanks. The docs are not clear enough there.. Thanks for the quick response! I'll give it a try.
Phorcys
Phorcys3y ago
I definitely agree, I had the same first-use experience than you :)
tfishler
tfishlerOP3y ago
Something is off.. :/
~ coder login https://coder.example
build info: do: Get "https://coder.example/api/v2/buildinfo": context deadline exceeded
Failed to check server "https://coder.example" for first user, is the URL correct and is coder accessible from your browser? Error - has initial user: do: Get "https://coder.example": dial tcp 75.2.18.233:443: i/o timeout
Run 'coder login --help' for usage.
~ coder login https://coder.example
build info: do: Get "https://coder.example/api/v2/buildinfo": context deadline exceeded
Failed to check server "https://coder.example" for first user, is the URL correct and is coder accessible from your browser? Error - has initial user: do: Get "https://coder.example": dial tcp 75.2.18.233:443: i/o timeout
Run 'coder login --help' for usage.
Running
curl https://coder.example {"external_url":"https://github.com/coder/coder/commit/165b6fbc6a23fd5f58ed459ea50f42e642c2f696","version":"v0.12.5+165b6fb"}
curl https://coder.example {"external_url":"https://github.com/coder/coder/commit/165b6fbc6a23fd5f58ed459ea50f42e642c2f696","version":"v0.12.5+165b6fb"}
Looks fine. Not sure why it resolves to this IP address. My server is on private subnets, custom certificate (CA trusted locally) (Sorry for masking the real url here)
Phorcys
Phorcys3y ago
hmm what does it show if you visit https://coder.example in your browser ?
tfishler
tfishlerOP3y ago
No description
Phorcys
Phorcys3y ago
I posted about it in #feedback, feel free to add anything are you sure this is curl https://coder.example's output ? my server responds with HTML, I'm thinking your reverse-proxy might not be treating the CLI and the browser in the same way.
tfishler
tfishlerOP3y ago
I've copy / pasted the url. It's too long 🙂 hmm..
Phorcys
Phorcys3y ago
oh okay, so you're not requesting the root ?
tfishler
tfishlerOP3y ago
no no..
Phorcys
Phorcys3y ago
okay lol, I thought your / was returning json
tfishler
tfishlerOP3y ago
I tried to reach the buildinfo path as the coder cli complained.
Phorcys
Phorcys3y ago
you said it's not resolving to the right IP, so it's very likely that it's a DNS issue now maybe the CLI isn't using your system DNS or something like that what if you tried hardcoding coder.example's IP using the hosts file just to see if that does the trick as a workaround
tfishler
tfishlerOP3y ago
I can try. It points to an ingress.
Phorcys
Phorcys3y ago
I'm not really familiar with k8s so maybe I won't be able to help
tfishler
tfishlerOP3y ago
Well.. that strangely worked... got a browser and a token. I guess something with cli resolving issues.
> Paste your token here:
> Welcome to Coder, talf! You're authenticated.
> Paste your token here:
> Welcome to Coder, talf! You're authenticated.
tfishler
tfishlerOP3y ago
No description
tfishler
tfishlerOP3y ago
Thank you again!
Codercord
Codercord3y ago
Marked the thread as unresolved. Marked the thread as resolved.
Want results from more Discord servers?
Add your server