You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub CLI command "gh repo create" slow to respond in wsl2
gh version 2.24.3
Steps to reproduce the behavior
Type this 'gh repo create '
View the output ' interactive menu do not appear (some time takes up 10 min)'
Expected vs actual behavior
Expected behavior : interactive menu should appear as soon as command is pressed
Actual Behavior : it takes upto 10 min to open interactive menu
While it is not working on wsl2 but it is working perfectly on windows command prompt
Logs
Paste the activity from your command line. Redact if needed.
@vikaspoddar Sorry you are having this trouble. We have not had reports in the past of gh being slow inside wsl2. Are you seeing slowness for commands that do not have interactive prompts? Did this issue start recently?
@vikaspoddar As the team has not been able to reproduce this issue I am not sure there is much else we can do to help without more information to go on. The only idea I have left is to update gh to the latest version as there were a couple bug fixes since version 2.24.3.
By default, dbus (which gh tries to use to communicate to Secret Service on linux) is not running under WSL2, and an attempt to retrieve an encrypted token should immediately fail and the lookup should fall back to gh's config file instead.
However, for you and apparently for @mbates and some other users the operation seems to hang for a long time or indefinitely. I'm not sure what circumstances lead to this, but @vilmibm was guessing that this might be affecting users who have taken steps to explicitly enable dbus in their WSL2 instances. Does this describe you?
In any case, I'm considering adding some debugging to token lookups so that the user at least gets an indication where the gh process is stuck.
For what it's worth, I just had this issue and wsl --shutdown followed by wsl fixed it. (It worked the first time - I made an error and had to cancel the auth, then I was getting this problem the second time.)
Can confirm this is slow for me too. I restarted wsl2 and first command is super fast then slows down again.
What information about my system will be helpful?
gh version 2.28.0 (2023-04-25)
https://github.com/cli/cli/releases/tag/v2.28.0
Linux DESKTOP-TLURRUM 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
I tried looking at strace output of gh status and found a lot of the following. Waiting to read and then timing out, my assumption is this could be the endless loop somewhere?
By default, dbus (which gh tries to use to communicate to Secret Service on linux) is not running under WSL2, and an attempt to retrieve an encrypted token should immediately fail and the lookup should fall back to gh's config file instead.
However, for you and apparently for @mbates and some other users the operation seems to hang for a long time or indefinitely. I'm not sure what circumstances lead to this, but @vilmibm was guessing that this might be affecting users who have taken steps to explicitly enable dbus in their WSL2 instances. Does this describe you?
In any case, I'm considering adding some debugging to token lookups so that the user at least gets an indication where the gh process is stuck.
Im not a strace exprt but i see a lot of dbus output running sudo strace -p <PID> -s 512 -ewrite 2> /tmp/strace.log and no further progress. I had this running close to 10 minutes with continuous dbus calls and no progress.
I think there is enough evidence here that this is related to dbus and encrypted token storage. Right now we are waiting for the dbus process to timeout when we should probably have our own timeout in gh. @mislav what do you think about adding a timeout to the retrieval of encrypted tokens?
I think there is enough evidence here that this is related to dbus and encrypted token storage. Right now we are waiting for the dbus process to timeout when we should probably have our own timeout in gh. @mislav what do you think about adding a timeout to the retrieval of encrypted tokens?
@samcoe Can (probably) confirm this is correct since the workaround here: #7145 fixes the issue.
Is anyone still experiencing this issue with the latest release v2.30.0? We bumped the library we use for accessing secure token storage and it had a couple of bug fixes in it.
@samcoe Can confirm this is still an issue with WSL2 (Ubuntu) for me. Followed the linux install instructions and gh auth login is hanging indefinitely.
I'm having this issue on Arch Linux. dbus is running:
● dbus.service - D-Bus System Message Bus
Loaded: loaded (/usr/lib/systemd/system/dbus.service; static)
Active: active (running) since Tue 2023-06-06 16:15:51 PDT; 5 days ago
Activity
samcoe commentedon Mar 22, 2023
@vikaspoddar Sorry you are having this trouble. We have not had reports in the past of
ghbeing slow inside wsl2. Are you seeing slowness for commands that do not have interactive prompts? Did this issue start recently?vilmibm commentedon Mar 22, 2023
I use gh on wsl2 daily and can't reproduce this, FWIW. ran in both Alacritty and Windows Terminal.
vikaspoddar commentedon Mar 22, 2023
@samcoe This issue started recently in wsl2 environment for interactive command and other commands like
But no problem are occurring in powershell environment.
I have reinstalled gh CLI but this condition occured again
samcoe commentedon Mar 22, 2023
@vikaspoddar As the team has not been able to reproduce this issue I am not sure there is much else we can do to help without more information to go on. The only idea I have left is to update
ghto the latest version as there were a couple bug fixes since version 2.24.3.vikaspoddar commentedon Mar 22, 2023
@samcoe Okay sir, I will reinstall the gh CLI tool
And will inform you
mislav commentedon Mar 28, 2023
By default, dbus (which gh tries to use to communicate to Secret Service on linux) is not running under WSL2, and an attempt to retrieve an encrypted token should immediately fail and the lookup should fall back to gh's config file instead.
However, for you and apparently for @mbates and some other users the operation seems to hang for a long time or indefinitely. I'm not sure what circumstances lead to this, but @vilmibm was guessing that this might be affecting users who have taken steps to explicitly enable dbus in their WSL2 instances. Does this describe you?
In any case, I'm considering adding some debugging to token lookups so that the user at least gets an indication where the gh process is stuck.
benjlevesque commentedon Apr 21, 2023
@vikaspoddar maybe related to #7145?
vikaspoddar commentedon Apr 21, 2023
@benjlevesque I will take a look at it. Thank you
wrenna-robson commentedon May 3, 2023
For what it's worth, I just had this issue and
wsl --shutdownfollowed bywslfixed it. (It worked the first time - I made an error and had to cancel the auth, then I was getting this problem the second time.)JayJamieson commentedon May 9, 2023
Can confirm this is slow for me too. I restarted wsl2 and first command is super fast then slows down again.
I tried looking at strace output of
gh statusand found a lot of the following. Waiting to read and then timing out, my assumption is this could be the endless loop somewhere?Im not a strace exprt but i see a lot of dbus output running
sudo strace -p <PID> -s 512 -ewrite 2> /tmp/strace.logand no further progress. I had this running close to 10 minutes with continuous dbus calls and no progress.samcoe commentedon May 9, 2023
I think there is enough evidence here that this is related to
dbusand encrypted token storage. Right now we are waiting for thedbusprocess to timeout when we should probably have our own timeout ingh. @mislav what do you think about adding a timeout to the retrieval of encrypted tokens?Shahaed commentedon May 28, 2023
@samcoe Can (probably) confirm this is correct since the workaround here: #7145 fixes the issue.
samcoe commentedon Jun 7, 2023
Is anyone still experiencing this issue with the latest release v2.30.0? We bumped the library we use for accessing secure token storage and it had a couple of bug fixes in it.
RobertGemmaJr commentedon Jun 7, 2023
@samcoe Can confirm this is still an issue with WSL2 (Ubuntu) for me. Followed the linux install instructions and
gh auth loginis hanging indefinitely.Arinerron commentedon Jun 12, 2023
I'm having this issue on Arch Linux. dbus is running:
It's also hanging here:
simenandre commentedon Aug 25, 2025
Did we ever create an issue for this in https://github.com/zalando/go-keyring?