cody icon indicating copy to clipboard operation
cody copied to clipboard

bug: VSCode remote - can't log in

Open Miaourt opened this issue 2 years ago • 20 comments

Version

1.85.2

Describe the bug

I'm working on a remote VSCode instance, on Linux from a MacOS host, and every time I try to log in (with the "sign in with *" buttons) I get greeted by a

Authentication failed. Please ensure Cody is enabled for sourcegraph.com and verify your email address if required.

Output logs:

█ CodyIgnore:updateCodyIgnoreCodespaceMap:codebase: gitlab.infra.online.net/storage/storage
█ CommandsController:fileWatcherInit: watchers created
█ AuthProvider:init:lastEndpoint: https://sourcegraph.com/
█ CodyIgnore:refresh:workspace: /root/storage
█ LocalEmbeddingsController: constructor
█ ChatManager:constructor: init has local embeddings controller
█ ChatPanelsManager:constructor: init
█ symf: downloading symf from https://github.com/sourcegraph/symf/releases/download/v0.0.2/symf-x86_64-linux-musl.zip
█ Symf: downloading from URL https://github.com/sourcegraph/symf/releases/download/v0.0.2/symf-x86_64-linux-musl.zip
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ SidebarViewController:onDidReceiveMessage: initialized
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed VSCode {"opts":{"agent":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth/failed: {"parameters":{"version":0},"timestamp":"2024-01-23T12:52:43.815Z"}
█ symf: downloaded symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.2-x86_64-linux.tmp
█ symf: extracted symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.2-x86_64-linux
█ symf: creating index /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/indexroot/root/storage
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:simplifiedSignInGitHubClick VSCode {}
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:fromCallback VSCode {"properties":{"type":"callback","from":"web","success":false,"hasV2Event":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth.fromCallback.web/succeeded: {"parameters":{"version":0,"metadata":[{"key":"success","value":0}]},"timestamp":"2024-01-23T12:53:06.036Z"}
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed VSCode {"opts":{"agent":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth/failed: {"parameters":{"version":0},"timestamp":"2024-01-23T12:53:06.076Z"}
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ ContextProvider:onConfigurationChange: using codebase 
█ LocalEmbeddingsController: setAccessToken is dotcom
█ LocalEmbeddingsController: setAccessToken is dotcom
█ CodyCompletionProvider:notSignedIn: You are not signed in.

@jdorfman tried to help me on the Discord server and he suggested trying to log in via a Token, and using https://sourcegraph.com + a newly generated Token led me to the same error and same log output.

Expected behavior

Being able to use Cody on a remote session (VSCode running on a Linux VM and interface running on my local mac)

Additional context

No response

Miaourt avatar Jan 25 '24 08:01 Miaourt

hey @Miaourt can you confirm your version #? We're currently on v1.2

kalanchan avatar Jan 31 '24 00:01 kalanchan

I'm facing the same issue Authentication failed. Please ensure Cody is enabled for sourcegraph.com and verify your email address if required. I'm running VS code in remote Machine which unable to authenticate.

rajkumarj-git avatar Mar 05 '24 11:03 rajkumarj-git

Helo @kalanchan , sorry for late reply, can confirm it's still happening on v1.8.0

█ AuthProvider:init:lastEndpoint: https://sourcegraph.com/
█ LocalEmbeddingsController: constructor
█ ChatManager:constructor: init has local embeddings controller
█ ChatPanelsManager:constructor: init
█ SymfRunner: unsafeEnsureIndex file:///root/storage
█ symf: downloading symf from https://github.com/sourcegraph/symf/releases/download/v0.0.7/symf-x86_64-linux-musl.zip
█ Symf: downloading from URL https://github.com/sourcegraph/symf/releases/download/v0.0.7/symf-x86_64-linux-musl.zip
█ CommandsController:init: watchers created
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ symf: downloaded symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.7-x86_64-linux.tmp
█ symf: extracted symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.7-x86_64-linux
█ symf: creating index file:///root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/indexroot/root/storage
█ featureflag: refreshed
█ featureflag: refreshed
█ featureflag: refreshed
█ SidebarViewController:onDidReceiveMessage: initialized
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed 
█ telemetry-v2: recordEvent: cody.auth/failed 
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:simplifiedSignInGitHubClick 
█ simplified-onboarding: picked new onboarding experiment branch selection {"branch":0,"excludeFromExperiment":false,"setByTestingOverride":false}
█ logEvent (telemetry disabled): CodyVSCodeExtension:experiment:removeAuthenticationStep:exposed 
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:simplifiedSignInGitHubClick 
█ logEvent (telemetry disabled): CodyVSCodeExtension:experiment:removeAuthenticationStep:exposed 
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:simplifiedSignInGitHubClick 
█ logEvent (telemetry disabled): CodyVSCodeExtension:experiment:removeAuthenticationStep:exposed 
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:fromCallback 
█ telemetry-v2: recordEvent: cody.auth.fromCallback.web/succeeded 
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed 
█ telemetry-v2: recordEvent: cody.auth/failed 
█ ContextProvider:onConfigurationChange: using codebase 
█ LocalEmbeddingsController: setAccessToken is dotcom
█ LocalEmbeddingsController: setAccessToken is dotcom
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ featureflag: refreshed
█ featureflag: refreshed

Miaourt avatar Mar 07 '24 12:03 Miaourt

I'm trying to use it on VS Code in WSL2, and am also getting the following error on trying to install the latest stable version of the extension:

Failed to download symf: Error: ENOENT: no such file or directory, open '/home/dickson/.vscode-server-insiders/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.7-x86_64-linux.tmp/symf-v0.0.7-x86_64-linux.zip'

Neurrone avatar Mar 18 '24 04:03 Neurrone

Version

1.85.2

Describe the bug

I'm working on a remote VSCode instance, on Linux from a MacOS host, and every time I try to log in (with the "sign in with *" buttons) I get greeted by a

Authentication failed. Please ensure Cody is enabled for sourcegraph.com and verify your email address if required.

Output logs:

█ CodyIgnore:updateCodyIgnoreCodespaceMap:codebase: gitlab.infra.online.net/storage/storage
█ CommandsController:fileWatcherInit: watchers created
█ AuthProvider:init:lastEndpoint: https://sourcegraph.com/
█ CodyIgnore:refresh:workspace: /root/storage
█ LocalEmbeddingsController: constructor
█ ChatManager:constructor: init has local embeddings controller
█ ChatPanelsManager:constructor: init
█ symf: downloading symf from https://github.com/sourcegraph/symf/releases/download/v0.0.2/symf-x86_64-linux-musl.zip
█ Symf: downloading from URL https://github.com/sourcegraph/symf/releases/download/v0.0.2/symf-x86_64-linux-musl.zip
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ SidebarViewController:onDidReceiveMessage: initialized
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed VSCode {"opts":{"agent":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth/failed: {"parameters":{"version":0},"timestamp":"2024-01-23T12:52:43.815Z"}
█ symf: downloaded symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.2-x86_64-linux.tmp
█ symf: extracted symf to /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.2-x86_64-linux
█ symf: creating index /root/.vscode-server/data/User/globalStorage/sourcegraph.cody-ai/symf/indexroot/root/storage
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:simplifiedSignInGitHubClick VSCode {}
█ logEvent (telemetry disabled): CodyVSCodeExtension:auth:fromCallback VSCode {"properties":{"type":"callback","from":"web","success":false,"hasV2Event":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth.fromCallback.web/succeeded: {"parameters":{"version":0,"metadata":[{"key":"success","value":0}]},"timestamp":"2024-01-23T12:53:06.036Z"}
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent (telemetry disabled): CodyVSCodeExtension:Auth:failed VSCode {"opts":{"agent":true}}
█ telemetry-v2: recordEvent (no-op): cody.auth/failed: {"parameters":{"version":0},"timestamp":"2024-01-23T12:53:06.076Z"}
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ ContextProvider:onConfigurationChange: using codebase 
█ LocalEmbeddingsController: setAccessToken is dotcom
█ LocalEmbeddingsController: setAccessToken is dotcom
█ CodyCompletionProvider:notSignedIn: You are not signed in.

@jdorfman tried to help me on the Discord server and he suggested trying to log in via a Token, and using https://sourcegraph.com + a newly generated Token led me to the same error and same log output.

Expected behavior

Being able to use Cody on a remote session (VSCode running on a Linux VM and interface running on my local mac)

Additional context

No response

I encountered the same Authentication failed issue in VSCode in WSL2.

Freedom-Blue avatar Mar 21 '24 09:03 Freedom-Blue

Me too VS Code remote linux

Cody AI Version: v1.10.0

VS Code v1.82.0

Authentication failed. Please ensure Cody is enabled for sourcegraph.com and verify your email address if required.

jon-ccc avatar Mar 22 '24 02:03 jon-ccc

Same issue for me with VS Code remote linux.

Cody AI Version: v1.15.1713453164 (pre-release) VS Code: 1.88 Local mac version: 23.4.0 Darwin Remote linux version: 22.04.1-Ubuntu

Authentication failed. Please ensure Cody is enabled for sourcegraph.com and verify your email address if required.

Log

█ logEvent: CodyVSCodeExtension:auth:clickOtherSignInOptions 
█ AuthProvider:signinMenu: signin
█ logEvent: CodyVSCodeExtension:login:clicked 
█ telemetry-v2: recordEvent: cody.auth.login/clicked 
█ GraphQLTelemetryExporter: evaluated export mode: legacy
█ logEvent: CodyVSCodeExtension:auth:selectSigninMenu 
█ telemetry-v2: recordEvent: cody.auth.signin.menu/clicked 
█ logEvent: CodyVSCodeExtension:auth:fromToken 
█ telemetry-v2: recordEvent: cody.auth.signin.token/clicked 
█ Cody:publishConfig: configForWebview 
█ ContextProvider:onConfigurationChange: using codebase 
█ logEvent: CodyVSCodeExtension:Auth:failed 
█ telemetry-v2: recordEvent: cody.auth/failed 
█ featureflag: refreshed
█ CodyCompletionProvider:notSignedIn: You are not signed in.

ltrottier-yelp avatar Apr 18 '24 20:04 ltrottier-yelp

I have same issue with our enterprise Cody.

Authentication failed. Please ensure Cody is enabled for sourcegraph.cooking.com and verify your email address if required.

in the log i can see this:

█ EventLogger: Error logging event Error: accessing Sourcegraph GraphQL API: FetchError: request to https://sourcegraph.cooking.com/.api/graphql?LogEventMutation failed, reason: Client network socket disconnected before secure TLS connection was established (https://sourcegraph.cooking.com/.api/graphql?LogEventMutation)

ThePlenkov avatar May 15 '24 08:05 ThePlenkov

Hi, @ThePlenkov, a support engineer is/has reached out.

jdorfman avatar May 15 '24 15:05 jdorfman

@jdorfman It's the same for our enterprise Cody too: sourcegraph.yelpcorp.com .

ltrottier-yelp avatar May 15 '24 16:05 ltrottier-yelp

Thanks @ltrottier-yelp going to get you fixed up!

jdorfman avatar May 15 '24 20:05 jdorfman

I just wanted to follow up with @ltrottier-yelp; I see that a support ticket is open on our side.

jdorfman avatar May 16 '24 00:05 jdorfman

@ltrottier-yelp Could you please send us a quick email on [email protected] for us to troubleshoot and help resolve this issue

airamare01 avatar May 16 '24 10:05 airamare01

Ok I will contact you [email protected]

ltrottier-yelp avatar May 16 '24 13:05 ltrottier-yelp

Turned out the company did not have a subscription, that's why I could not log.

ltrottier-yelp avatar May 16 '24 17:05 ltrottier-yelp

Thanks for confirming @ltrottier-yelp

airamare01 avatar May 16 '24 17:05 airamare01

This issue is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.

github-actions[bot] avatar Jul 18 '24 01:07 github-actions[bot]

I am still observing this behaviour with Cody 1.26.7 in Code OSS running in a Docker container and self-hosted Sourcegraph Free (version 5.5.1337) instance with a single user.

The following command in Code OSS container executes successfully returning username of the user to whom the token belongs to, so the Sourcegraph instance appears to be accessible from the Code OSS container:

> curl \
  -H 'Authorization: token <token>' \
  -d '{"query":"query { currentUser { username } }"}' \
  https://sourcegraph.domain/.api/graphql
{"data":{"currentUser":{"username":"<username>"}}}

Cody is enabled on the self-hosted Sourcegraph instance and the email address is verified.

Nothing special in extension's output:

█ AuthProvider:signinMenu: signin
█ telemetry-v2: recordEvent: cody.auth.login/clicked 
█ telemetry-v2: recordEvent: cody.auth.signin.menu/clicked 
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ featureflag: refreshed
█ SimpleChatPanelProvider: updateViewConfig 
█ openctx: OpenCtx is enabled in Cody
█ openctx: Failed to load OpenCtx client: Error: command 'openctx.toggleEnable' already exists
█ telemetry-v2: recordEvent: cody.auth/failed 
█ featureflag: refreshed
█ CodyCompletionProvider:notSignedIn: You are not signed in.
█ openctx: OpenCtx is enabled in Cody
█ openctx: Failed to load OpenCtx client: Error: command 'openctx.toggleEnable' already exists
█ telemetry-v2: recordEvent: cody.auth/failed 
█ SimpleChatPanelProvider: updateViewConfig 

diedgarsa avatar Jul 23 '24 15:07 diedgarsa

Thanks @diedgarsa

I will make sure the product team sees this in the weekly community feedback report (every Monday).

jdorfman avatar Jul 24 '24 04:07 jdorfman

The issue persists with cody v1.34.3 (also pre-release 1.35) and vscode 1.93.1.

Authentication failed. Please ensure Cody is enabled and verify your email address if required.

taqen avatar Sep 24 '24 20:09 taqen

Hey @taqen

Does the issue still persist with the newest version of Cody or can it be closed?

Thank you

PriNova avatar Nov 26 '24 12:11 PriNova

Not reproducible anymore for us

ThePlenkov avatar Nov 26 '24 18:11 ThePlenkov

In my case it was caused by vs code proxy settings

ThePlenkov avatar Nov 26 '24 18:11 ThePlenkov