sourcegraph / sg.nvim

Experimental Sourcegraph + Cody plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CheckHealth Reports "Cody Auth Failed: nil"

alexAtSourcegraph opened this issue · comments

sg.nvim report ~
- Machine: x86_64, sysname: Darwin
- OK Valid nvim version: table: 0x010900ba98
- WARNING Unable to find valid cargo executable. Trying to build sg.nvim locally will fail. Instead use `:SourcegraphDownloadBinaries`
- OK Found `sg-nvim-agent`: "/Users/[REDACTED/.local/share/nvim/lazy/sg.nvim/dist/sg-nvim-agent"
- OK Found `node` (config.node_executable) is executable.
  Version: '18.19.0'
- OK Found `cody-agent`: /Users/REDACTED/.local/share/nvim/lazy/sg.nvim/dist/cody-agent.js
- OK   Authentication setup correctly
- OK     endpoint set to: https://REDACTED.sourcegraph.com
- OK Found correct binary versions: "1.0.5" = "1.0.5"
- OK   Sourcegraph Connection info: {
  access_token_set = true,
  endpoint = "https://REDACTED.sourcegraph.com",
  sg_nvim_version = "1.0.5",
  sourcegraph_version = {
  build = "5.2.5",
  product = "5.2.5"
  }
  }
- ERROR Cody Auth Failed: nil
- ERROR sg.nvim has issues that need to be resolved

This issue persists even though Cody is running and available. This state has occurred after the following issue resolved.

Running into a similar issue running Neovim v0.9.5

sg.nvim report ~
- Machine: x86_64, sysname: Linux
- OK Valid nvim version: table: 0x7f8658360ea8
- OK Found `cargo` (cargo 1.46.0) is executable
-     Use `:SourcegraphDownloadBinaries` to avoid building locally.
- OK Found `sg-nvim-agent`: "/home/username/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/sg-nvim-agent"
- OK Found `node` (config.node_executable) is executable.
  Version: '18.18.2'
- OK Found `cody-agent`: /home/username/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/cody-agent.js
- OK   Authentication setup correctly
- OK     endpoint set to: https://codyendpoint.sourcegraph.com
- OK Found correct binary versions: "1.0.5" = "1.0.5"
- OK   Sourcegraph Connection info: {
  access_token_set = true,
  endpoint = "https://codyendpoint.sourcegraph.com",
  sg_nvim_version = "1.0.5",
  sourcegraph_version = {
  build = "5.2.5",
  product = "5.2.5"
  }
  }
- ERROR Cody Auth Failed: nil
- ERROR sg.nvim has issues that need to be resolved

I am getting the same error on sg 1.0.6 as well.

sg: require("sg.health").check()

sg.nvim report ~
- Machine: arm64, sysname: Darwin
- OK Valid nvim version: table: 0x0100e00840
- OK Found `cargo` (cargo 1.68.2 (6feb7c9cf 2023-03-26)) is executable
-     Use `:SourcegraphDownloadBinaries` to avoid building locally.
- OK Found `sg-nvim-agent`: "/Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/sg-nvim-agent"
- OK Found `node` (config.node_executable) is executable.
  Version: '20.11.0'
- OK Found `cody-agent`: /Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/cody-agent.js
- OK   Authentication setup correctly
- OK     endpoint set to: https://sourcegraph.internal.url.net
- OK Found correct binary versions: "1.0.6" = "1.0.6"
- OK   Sourcegraph Connection info: {
  access_token_set = true,
  endpoint = "https://sourcegraph.internal.url.net",
  sg_nvim_version = "1.0.6",
  sourcegraph_version = {
  build = "5.1.9",
  product = "5.1.9"
  }
  }
- ERROR Cody Auth Failed: nil
- ERROR sg.nvim has issues that need to be resolved

The report above seems to have all the relevant info, but please let me know if there is additional information that would be helpful.

Latest version I think will have a fix for this (checked with other server and solved the problem). Not all of the graphql query params I was using were live on all other servers (non-dotcom) which caused an error. Hopefully works now!

Unfortunately, I'm still seeing the same error log on sg.nvim 1.0.7

Same, still seeing the error. Will this require a server update if we're self-hosting our Sourcegraph instance?

sg: require("sg.health").check()

sg.nvim report ~
- Machine: arm64, sysname: Darwin
- OK Valid nvim version: table: 0x01032b8768
- OK Found `cargo` (cargo 1.68.2 (6feb7c9cf 2023-03-26)) is executable
-     Use `:SourcegraphDownloadBinaries` to avoid building locally.
- OK Found `sg-nvim-agent`: "/Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/sg-nvim-agent"
- OK Found `node` (config.node_executable) is executable.
  Version: '18.15.0'
- OK Found `cody-agent`: /Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/cody-agent.js
- OK   Authentication setup correctly
- OK     endpoint set to: https://sourcegraph.eng.qops.net
- OK Found correct binary versions: "1.0.7" = "1.0.7"
- OK   Sourcegraph Connection info: {
  access_token_set = true,
  endpoint = "https://sourcegraph.eng.qops.net",
  sg_nvim_version = "1.0.7",
  sourcegraph_version = {
  build = "5.1.9",
  product = "5.1.9"
  }
  }
- ERROR Cody Auth Failed: nil
- ERROR sg.nvim has issues that need to be resolved

Let me check when we added the Cody flag, perhaps it's more recent than I thought.

Do you have access to the API Console on your instance? Usually it's at https://sourcegraph.com/api/console I think.

Could you run this query:

query EnterpriseUserQuery {
  currentUser {
    id
    username
    codyProEnabled
  }
}

Maybe I just need to remove the codyProEnabled -- I'll test that right now

image
Looks like that field isn't available.

Ah, makes sense. Sorry about that. The new release is building right now and should be available in the next ~10 minutes or so. I removed that and hopefully the rest should work for you.

OK, I think you can try now -- hopefully this should work now! Thanks for the patience

That did the trick. Thanks TJ!

sg: require("sg.health").check()

sg.nvim report ~
- Machine: arm64, sysname: Darwin
- OK Valid nvim version: table: 0x0103d5b3b8
- OK Found `cargo` (cargo 1.68.2 (6feb7c9cf 2023-03-26)) is executable
-     Use `:SourcegraphDownloadBinaries` to avoid building locally.
- OK Found `sg-nvim-agent`: "/Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/sg-nvim-agent"
- OK Found `node` (config.node_executable) is executable.
  Version: '20.11.0'
- OK Found `cody-agent`: /Users/jmaxwell/.local/share/nvim/site/pack/packer/start/sg.nvim/dist/cody-agent.js
- OK   Authentication setup correctly
- OK     endpoint set to: https://sourcegraph.eng.qops.net
- OK Found correct binary versions: "1.0.8" = "1.0.8"
- OK   Sourcegraph Connection info: {
  access_token_set = true,
  endpoint = "https://sourcegraph.eng.qops.net",
  sg_nvim_version = "1.0.8",
  sourcegraph_version = {
  build = "5.1.9",
  product = "5.1.9"
  }
  }
- To manage your Cody Account, navigate to: https://sourcegraph.com/cody/manage
- OK Cody Account Information: {
  cody_pro_enabled = false,
  username = "jmaxwell"
  }
- OK sg.nvim is ready to run

Great!! Thanks for your patience, let me know if anything else comes up!