Unable to Authenticate Cody in WSL2 – “Not Logged In” Error

Hello everyone,

I’m trying to use Cody in WSL2 (Windows Subsystem for Linux), but I keep getting a “Not logged in” message when running cody chat. Here’s what I’ve tried so far:

  1. Ran cody auth login --web
  • The command either doesn’t open a browser automatically, or when I log in, nothing changes in the WSL2 environment.
  1. Checked cody auth whoami
  • It shows no active account.
  1. Generated a fresh access token on Sourcegraph and attempted to log in again.
  • Still no success; Cody continues to say I’m not logged in.
  1. Checked WSL2 DNS/Network
  • I updated /etc/resolv.conf with reliable DNS servers, and I can ping external sites, so basic networking seems fine.
  1. Restarted WSL2
  • Ran wsl --shutdown in Windows PowerShell, reopened my WSL2 shell, and retried. The same authentication error remains.

Has anyone else experienced this? I’d appreciate any advice on diagnosing the issue or any specific settings to configure. I’m using the latest version of Cody in WSL2 on Windows 10/11 (include version if known).

Thank you!



Hey @DanielNeris

I already answered you on GitHub.

Thank you

For context: Unable to Authenticate Cody in WSL2 – “Not Logged In” Error · Issue #7519 · sourcegraph/cody · GitHub

1 Like