cli: `pscale auth login` only showing output after `ctrl+c` - not able to log in

When running pscale auth login on WSL2 - Ubuntu, there is no output, nor redirect to any new windows for authentication. Output of the command only shows up after I cancel the execution of the command (by pressing ctrl + c) then it outputs (probably) the expected things:

pscale auth login
^CFailed to open a browser: signal: interrupt

Confirmation Code: YMHOSZCP

If something goes wrong, copy and paste this URL into your browser: https://auth.planetscale.com/oauth/device?user_code=YMHOSZCP

Error: error performing http request: Post "https://auth.planetscale.com/oauth/token": context canceled

When I do try the provided URL it does surprisingly redirect me to the confirmation page with the code, where I can accept it. When I do, it does go through, but obviously this token is not active anymore so the auth in the pscale cli does not register me as logged in.

I did upgrade all the packages in ubuntu I downloaded and installed the newest release of the cli I gave it quite a long time to run

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 18 (2 by maintainers)

Most upvoted comments

I was facing the same problem, even as root with sudo command but I fixed:

Just create the planetscale folder before do auth:

mkdir ~/.config/planetscale
pscale auth login

@blakecannell I’m in almost the same environment.The following methods work well.

$ sudo mkdir -p /root/.config/planetscale

$ sudo pscale auth login
Confirmation Code: <CODE>

If something goes wrong, copy and paste this URL into your browser: https://auth.planetscale.com/oauth/device?user_code=<CODE>

Successfully logged in.

I face this problem to. using WSL 2. it’s not showing anything.

This is my machine, and I download pscale_0.126.0_linux_amd64.deb

Linux RioChndr-Lenovo-Legion 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

For me at least this seemed to be caused by xdg-open which would hang no matter what I tried to do with it. Figured I’d reinstall it to see if anything would change, but simply leaving xdg-utils uninstalled fixed the issue for me (I have no other use for it).