Authorization always hangs and then you can't quit copilot (might be related to not being able to launch browser in SSH session)
Describe the bug
When I attempt to authorize, I'm doing so on a linux arm64 machine that I'm ssh'd into. I get the device code and go to the URL specified on my main browser and then I I hit enter to say I've copied the device code manually. I then authorize on the website successfully, and then copilot hangs with this screen:
I've tried varying the order of authenticating and hitting enter and I've tried authenticating a total of 6 times now over several days. I have no problems with my internet connection and the machine I'm logged into has no problem talking to copilot more generally (I'm using the VS code copilot on there).
Additionally, when I try to ctrl-c out of the "Waiting for authorization", that also hangs giving me this:
Affected version
0.0.328
Steps to reproduce the behavior
When I attempt to authorize, I'm doing so on a linux arm64 machine that I'm ssh'd into. I get the device code and go to the URL specified on my main browser and then I I hit enter to say I've copied the device code manually. I then authorize on the website successfully, and then copilot hangs with this screen:
I've tried varying the order of authenticating and hitting enter and I've tried authenticating a total of 6 times now over several days. I have no problems with my internet connection and the machine I'm logged into has no problem talking to copilot more generally (I'm using the VS code copilot on there).
Additionally, when I try to ctrl-c out of the "Waiting for authorization", that also hangs giving me this:
Expected behavior
I should be able to authenticate
Additional context
OS: Debian Trixie Linux on ARM64 Raspberry Pi 5
I have the same error in the latest stabel release.
im also sshd into a raspi...
I can shutdown if i havent done /login yet but after being in the loop it doesnt
Same here, im using ubuntu server 24.
Did you guys try the authentication adding the env as documentation says?
Even tho that authentication process isn't working, I solved it that way.
@despinozap Thanks, that's a good workaround! For some reason that particular permission is only available in the "public repositories" scope, so I've had to create a second PAT token specifically for copilot. However, it works.
The following alias helps use it without trampling my regular github PAT.
alias copilot='GH_TOKEN=$COPILOT_PAT /usr/local/bin/copilot'
@benstaniford Cool! I also created a new token for that. I'd like to be using that auth process but that's still broken in the callback flow or something like that I guess. Well.. at least we can start playing around with the cli meanwhile it's fixed ๐
@benstaniford the workaround doesnt work on my machine... maybe im just to dumb:
(venv) bennet@raspberrypi:~ $ alias copilot='GH_TOKEN=ghp_(my github pat) /usr/local/bin/copilot' (venv) bennet@raspberrypi:~ $ copilot Welcome to GitHub Copilot CLI Version 0.0.331 ยท Commit eb0ae04
Copilot can write, test and debug code right from your terminal. Describe a task to get started or enter ? for help. Copilot uses AI, check for mistakes.
Please use /login to sign in to use Copilot ~ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Enter @ to mention files or / for commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Ctrl+c Exit ยท Ctrl+r Expand Recent
Thank you for youre help!
@joan-code6 That looks ok.. Does your PAT token have the correct "Copilot Requests" permission?
We should have a page that looks like this when we can't get your clipboard/can't launch your browser:
today I'll look into why this might not be firing correctly on SSH sessions -- ~~I wonder if it's relevant that you're both on Raspberry Pi, too~~ nevermind, saw the Ubuntu Server report as well
Question: are you folks all SSH'd using VSCode remote? And can you still reproduce this bug if you SSH outside of VSCode?
@RyanHecht Thanks for looking into it!
are you folks all SSH'd using VSCode remote? And can you still reproduce this bug if you SSH outside of VSCode?
No, I'm using plain old Windows Terminal and the SSH version that comes with Git for Windows.
@RyanHecht I've just tried PuTTY as well, and I can reproduce the same issue with that.
Thanks for trying that for me @benstaniford! One more thing to try: If you manually go to https://github.com/login/device and enter your code, does it continue to hang, or does it eventually complete after ~30 seconds?
(Sorry to keep sending you on fetch quests, but I haven't been able to reproduce this via SSH-ing into any of my machines thus far!)
@RyanHecht It hangs indefinitely, here's me waiting for about a minute:
EDIT: Ah, looks like I can't upload video, anyway it does.
Thank you! Going to work on an improved experience for this edge case in the absence of knowing the root cause
@RyanHecht Do you want me to dump the process or anything? That's probably what I'd do in this situation, but I'm not a node guy so I'm unsure if it helps you.
@RyanHecht I collected a dump of node process when it had been stuck like this for about a minute:
https://www.dropbox.com/scl/fi/xlfzcapsj536fdxa70oqx/node_dump.zip?rlkey=cgi441g01dc8zuohhdbb7pp43&dl=0
I understand you could look at the stack traces in llnode (https://github.com/nodejs/llnode)
This is fixed in 0.0.335!
Hi @RyanHecht ,
I just gave 0.0.335 a try and unfortunately the behavior is pretty much the same as before. (Although it may be flickering more on reauth?)
Oh no! And even after manually visiting the the page and entering the code, it still hangs there? @benstaniford
@RyanHecht I'm afraid so yeh :-(
Do you want me to collect any further dumps or anything? I'm happy to get stack traces or whatever of what the program is doing during that hang.