`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
Thanks for reporting, we'll look into this!
How did you get pscale CLI installed in WSL?
EDIT: ah never mind, I figured out to download the .deb file in windows from github, drag it over into my WSL directory and install using dpkg.
Just to be thorough I used these instructions. I used wget to grab the latest release and followed the rest of the instructions.
And yeah, the issue is still present and behaves in the same way, as described above.
Let me know if I can be of any more help.
Facing this as well.
Me too, for more context :
I installed the CLI in WSL by downloading the deb from the releases with wget and using dpkg -i.
Hello, I tried this today and it worked no problem, unless there is any objection I think this can be closed.
Tried it a week ago and it was still not working... Unless you changed anything, I doubted it's fixed.
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).
Still encountering this as well, any news on a fix?
It might be a different problem, but when I used on WSL I could only make it work when I used pscale with sudo. Without sudo, it was hanging for quite long and then showed that it was not able to write access tokens to the filesystem.
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
I experience similar issues on WSL2 (Ubuntu):
I manually open the browser window, confirm, and I'm met with the following error. Can I get the output of the access-token so that I can atleast write this file manually?
Thanks in advance
ridds@DESKTOP-5PLDNPK:~$ sudo pscale auth login
[sudo] password for ridds:
Failed to open a browser: xdg-open resolves to executable in current directory (./xdg-open)
Confirmation Code: 97V4NKKI
If something goes wrong, copy and paste this URL into your browser: https://auth.planetscale.com/oauth/device?user_code=97V4NKKI
Error: error logging in: error writing token: open /root/.config/planetscale/access-token: no such file or directory```
@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.
https://github.com/planetscale/cli/issues/449#issuecomment-1407645556
With the super user's access token saved, pscale can be run without the sudo by doing the following.
$ mkdir $HOME/.config/planetscale
$ sudo cp /root/.config/planetscale/* $HOME/.config/planetscale
$ sudo chown $USER:$USER $HOME/.config/planetscale/*
$ pscale database create sample
$ pscale database list
NAME CREATED AT UPDATED AT NOTES
--------------- --------------- --------------- -------
sample 5 minutes ago 4 minutes ago
You can get a list of planetscale databases.
If the access token has expired, you will need to sudo pscale auth login again and copy the access-token.
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
I was facing the same problem, even as root with
sudocommand but I fixed:Just create the planetscale folder before do auth:
mkdir ~/.config/planetscale pscale auth login
this worked, thanks!
I've faced this issue today on a fresh Amazon Linux server when installing pscale. It appears the auth directory is not created for the user, when it tries to write the access-token file it fails:
$ sudo rpm -i https://github.com/planetscale/cli/releases/download/v0.138.0/pscale_0.138.0_linux_amd64.rpm
$ pscale login
Failed to open a browser: exec: "xdg-open": executable file not found in $PATH
Confirmation Code: <redacted_code>
If something goes wrong, copy and paste this URL into your browser: https://auth.planetscale.com/oauth/device?user_code=<redacted_code>
Error: error logging in: error writing token: open /home/ec2-user/.config/planetscale/access-token: no such file or directory
Once I created the directory from the error message above, I was able to login successfully.
$ ls /home/ec2-user/.config/planetscale/
ls: cannot access '/home/ec2-user/.config/planetscale/': No such file or directory
$ mkdir -p /home/ec2-user/.config/planetscale/
$ pscale login
Failed to open a browser: exec: "xdg-open": executable file not found in $PATH
Confirmation Code: <redacted_code>
If something goes wrong, copy and paste this URL into your browser: https://auth.planetscale.com/oauth/device?user_code=<redacted_code>
Successfully logged in.
This should now be fixed with the change in https://github.com/planetscale/cli/pull/670