sourcegraph / sg.nvim

Experimental Sourcegraph + Cody plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Invalid authentication" error using an enterprise account

guillemaru opened this issue · comments

I am trying to set up Cody with an enterprise account.

My goal is to have Cody inside Neovim so I can use (mainly) the autocomplete functionalities, but also others such as “:CodyAsk”.

I have been trying to follow the instructions in the GitHub README page.

WHAT I HAVE DONE

  • Download the Sourcegraph CLI
  • Obtain an access token from the sourcegraph enteprise website
  • Set the env variables SRC_ENDPOINT and SRC_ACCESS_TOKEN
githubissueimage2 githubissueimage1
  • Check that I am logged in with the "src login" command: the result is good, it says "Authenticated as..."

  • Install the plugin using Neovim “lazy”. When doing “:checkhealth sg”, I get:

githubissueimage4
  • Following the instructions shown in “:help cody.complete”, I added “cody” to my nvim-cmp sources. In my init.lua, after installing “nvim-cmp”:
cmp.setup({  
  sources = cmp.config.sources({  
    { name = "cody" },  
    { name = "nvim_lsp" }  
  })  
})

THE ISSUES I AM SEEING

Every time I open a file with neovim, I see:

githubissueimage5

Having the endpoint and access token env variables should be enough, but if I do “:SourcegraphLogin” as suggested alternative in the help message:

githubissueimage6

But I have the env variables set up…

A similar error if I do “:CodyAsk ”:
githubissueimage7

And there is no autocompletion of code either.

The official Sourcegraph support was not useful, only suggested me to do ":CodyRestart", but that did not seem to have any effect, still see the same issue.

Therefore, I am opening an issue here to see if this could hopefully get picked up.
Let me know if I could help with anything.
Thanks!

I am happy to report that this is now working.
The only things I seem to have changed from my original message is:
-Updating to the last commit of the repo
-Changing my shell to bash

Closing the issue.