sql-language-server icon indicating copy to clipboard operation
sql-language-server copied to clipboard

how to solve Error NO_RESULT_CALLBACK_FOUND

Open EdmundsEcho opened this issue 2 years ago • 9 comments

When I open nvim to a .sql file, I get the following error:

LSP[sqlls]: Error NO_RESULT_CALLBACK_FOUND: {
  id = 1,
  jsonrpc = "2.0",
  result = {
    capabilities = {
      codeActionProvider = true,
      completionProvider = {
        resolveProvider = true,
        triggerCharacters = { "." }
      },
      executeCommandProvider = {
        commands = { "sqlLanguageServer.switchDatabaseConnection", "sqlLanguageServer.fixAllFixable
Problems" }
      },
      renameProvider = true,
      textDocumentSync = 1
    }
  }

I suspect it is related to connecting to my db? (seems like the easiest place for things to go wrong?)

I have the following project configuration located in the project root (I don't have a personal config):

{
  "name": "dev-db",
  "adapter": "postgres",
  "host": "db-postgresql-ondigitalocean.com",
  "port": 25060,
  "database": "db_v2",
  "user": "admin",
  "password": "secret",
  "sslmode": "require"
}

Note the sslmode is not documented, but is used to connect to digital ocean.

Question

What does the above error suggest for how to solve it?

Thank you!

EdmundsEcho avatar Apr 14 '22 15:04 EdmundsEcho

I'm also getting this error, did you ever figure out how to solve this? @EdmundsEcho

avegancafe avatar Jun 09 '22 16:06 avegancafe

@keyboard-clacker Paused the idea of using it... the feature/plugin seems useful but beyond the "risk benefit" ratio for getting it to work :( I went with having a pdf of the db schema displayed nearby; works every time :))

EdmundsEcho avatar Jun 15 '22 00:06 EdmundsEcho

Hahah fair enough @EdmundsEcho

avegancafe avatar Jun 16 '22 01:06 avegancafe

I just have the same problem and I spent a lot of hours trying to find the way to resolve it in the documentation. And then, I find this issue hahahaha ):

carrichi avatar Jul 09 '22 23:07 carrichi

Got that Problem too.

Did install sqlls via williamboman/nvim-lsp-installer. I really tried the minimal configuration with a Project configuration file, but no success.

{
  "name": "local_project_config",
  "adapter": "postgres",
  "host": "localhost",
  "port": 5432,
  "user": "its_me",
  "database": "db_its_me"
}

Afterwards, I tried to config the neovim/nvim-lspconfig, but no success

require('lspconfig')['sqlls'].setup({
    -- LSP-default-keymaps
    on_attach = on_attach,
    flags = lsp_flags,
    -- languageserver = {
    --     sql = {
    -- cmd = { "sql-language-server", "up", "--method", "stdio" },
    -- filetypes = { "sql", "mysql" },
    -- settings = {
    --     -- sqlLanguageServer = {
    --     --     connections =
    --     --     {
    --     --         name = "local_project_config",
    --     --         adapter = "postgres",
    --     --         host = "localhost",
    --     --         port = 5432,
    --     --         user = "its_me",
    --     --         database = "db_its_me"
    --     --
    --     --         -- name = "mysql_project",
    --     --         -- adapter = "mysql",
    --     --         -- host = "127.0.0.1",
    --     --         -- port = 3306,
    --     --         -- user = "sqlls",
    --     --         -- password = "sqlls",
    --     --         -- database = "mysql_db",
    --     --         -- -- projectPaths = ["/Users/joe_re/src/MysqlProject"],
    --     --         -- ssh = {
    --     --         --     user = "ubuntu",
    --     --         --     remoteHost = "xxx-xx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com",
    --     --         --     dbHost = "127.0.0.1",
    --     --         --     port = 3306
    --     --         -- }
    --     --     },
    --     --     -- lint = {
    --     --     --   rules = {
    --     --     --     align-column-to-the-first = "error",
    --     --     --     column-new-line = "error",
    --     --     --     linebreak-after-clause-keyword = "off",
    --     --     --     reserved-word-case = ["error", "upper"],
    --     --     --     space-surrounding-operators = "error",
    --     --     --     where-clause-new-line = "error",
    --     --     --     align-where-clause-to-the-first = "error"
    --     --     --   }
    --     --     -- }
    --     -- }
    -- }
    -- --     }
    -- -- }
})

But there is one thing, where it should work in the minimal config: If you enter psql, you can switch to your default editor (neovim) with \e. But there is not happening anything, none the keyboard-shortcuts of the neovim/nvim-lspconfig are working (like formatting).

In this case, the adapter-configuration must be set globally and not in a project dir. Or is there another way? 2022-07-14_20-43_sqlls

theCollectiv avatar Jul 14 '22 18:07 theCollectiv

Got that Problem too.

wuziqiu666 avatar Sep 13 '22 21:09 wuziqiu666

I have this problem too

wongjiahau avatar Sep 28 '22 09:09 wongjiahau

me too, I've got the following log:

[WARN][2022-09-29 23:18:23] .../lua/vim/lsp.lua:812	"server_request: no handler found for"	"workspace/diagnostic/refresh"
[WARN][2022-09-29 23:18:23] .../lua/vim/lsp.lua:812	"server_request: no handler found for"	"workspace/diagnostic/refresh"
[START][2022-09-29 23:17:15] LSP logging initiated
[START][2022-09-29 23:23:29] LSP logging initiated
[START][2022-09-29 23:28:26] LSP logging initiated
[ERROR][2022-09-29 23:28:27] .../vim/lsp/rpc.lua:534	"No callback found for server response id 1"
[ERROR][2022-09-29 23:28:27] .../lua/vim/lsp.lua:824	"LSP[sqlls]"	"on_error"	{  code = "NO_RESULT_CALLBACK_FOUND",  err = {    id = 1,    jsonrpc = "2.0",    result = {      capabilities = {        codeActionProvider = true,        completionProvider = {          resolveProvider = true,          triggerCharacters = { "." }        },        executeCommandProvider = {          commands = { "sqlLanguageServer.switchDatabaseConnection", "sqlLanguageServer.fixAllFixableProblems" }        },        renameProvider = true,        textDocumentSync = 1      }    }  }}

aparently it's correctly configurated but something is not working properly.

image

mmngreco avatar Sep 29 '22 21:09 mmngreco

Same issue here

ignamartinoli avatar Oct 20 '22 01:10 ignamartinoli

Same story here.

raymon-roos avatar Oct 22 '22 10:10 raymon-roos

Same here!

psteinroe avatar Nov 06 '22 09:11 psteinroe

Same here

florentsorel avatar Nov 21 '22 15:11 florentsorel

Same.

ls-devs avatar Dec 08 '22 15:12 ls-devs

bump

felsel avatar Jan 13 '23 04:01 felsel

At the moment there are no solutions to this problem?

andvarfolomeev avatar Feb 16 '23 11:02 andvarfolomeev

At the moment there are no solutions to this problem?

See @timabdulla, he pointed out the underlying cause and his pull request is still in queue (https://github.com/joe-re/sql-language-server/pull/150).

theCollectiv avatar Feb 16 '23 12:02 theCollectiv

Hi, all. Sorry for our late response. We've released a new version(v1.13.1) and the problem should be fixed. Please update sql-language-server to the latest and try again. Thanks.

joe-re avatar Mar 14 '23 23:03 joe-re