Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3 error when using Telescope "Cancellation failed because no search found" #115

Open
InsaneZulol opened this issue Jul 27, 2023 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@InsaneZulol
Copy link

InsaneZulol commented Jul 27, 2023

This error is occuring on 0.3, pretty much 100% of the time. Sometimes - rarely - the search results do load, albeit super slowly and without a preview window.
It's possible that my config is incorrect.
I understand that you already refactored the plugin since it's checkbox is ticked - sorry if I'm making an issue too early while it's still WIP.

WindowsTerminal_KYKHNLYuQN.mp4
Error executing vim.schedule lua callback: ...istant.nvim/lua/telescope/_extensions/distant/finder.lua:127: (other) [Query 2652474811] Cancellation failed because no search found
stack traceback:
        [C]: in function 'assert'
        ...istant.nvim/lua/telescope/_extensions/distant/finder.lua:127: in function 'cb'
        ...istant.nvim/lua/telescope/_extensions/distant/finder.lua:195: in function 'cb'
        ...er/start/distant.nvim/lua/distant-core/api/transport.lua:220: in function 'cb'
        ...er/start/distant.nvim/lua/distant-core/api/transport.lua:478: in function '__handle_response'
        ...er/start/distant.nvim/lua/distant-core/api/transport.lua:138: in function '__on_stdout_line'
        .../pack/packer/start/distant.nvim/lua/distant-core/job.lua:296: in function 'cb'
        .../pack/packer/start/distant.nvim/lua/distant-core/job.lua:200: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Distant-server.log

[2023-07-27 11:13:23.173245 +02:00] DEBUG [distant-net/src/server/connection.rs:511] [Conn 1731928838] New request 4139276815_9868
[2023-07-27 11:13:23.173315 +02:00] DEBUG [distant-local/src/api.rs:364] [Conn 1731928838] Reading metadata for "/var/fpwork/akaluza/project/" {canonicalize: true, resolve_file_type: true}
[2023-07-27 11:13:23.235822 +02:00] DEBUG [distant-net/src/server/connection.rs:511] [Conn 1731928838] New request 4139276815_9520
[2023-07-27 11:13:23.235900 +02:00] DEBUG [distant-local/src/api.rs:619] [Conn 1731928838] Reading system information
[2023-07-27 11:13:23.297480 +02:00] DEBUG [distant-net/src/server/connection.rs:511] [Conn 1731928838] New request 4139276815_9477
[2023-07-27 11:13:23.297560 +02:00] DEBUG [distant-local/src/api.rs:125] [Conn 1731928838] Reading directory "/var/fpwork/akaluza/project" {depth: 1, absolute: false, canonicalize: false, include_root: false}
[2023-07-27 11:13:27.483223 +02:00] DEBUG [distant-net/src/server/connection.rs:511] [Conn 1731928838] New request 4139276815_7896
[2023-07-27 11:13:27.483356 +02:00] DEBUG [distant-local/src/api.rs:364] [Conn 1731928838] Reading metadata for "/var/fpwork/akaluza/project/log_description/" {canonicalize: true, resolve_file_type: true}
[2023-07-27 11:13:27.548091 +02:00] DEBUG [distant-net/src/server/connection.rs:511] [Conn 1731928838] New request 4139276815_6818
[2023-07-27 11:13:27.548151 +02:00] DEBUG [distant-local/src/api.rs:125] [Conn 1731928838] Reading directory "/var/fpwork/akaluza/project/log_description" {depth: 1, absolute: false, canonicalize: false, include_root: false}                                                                                                                                         

.cache/distant/client.log

   [2023-07-27 11:13:24.264433 +02:00] INFO [distant-net/src/common/connection.rs:273] [Conn 1509300341] Connect com
    pleted successfully!
   [2023-07-27 11:13:24.264583 +02:00] INFO [src/cli/common/client.rs:79] Connected to unix socket @ "/home/akaluza/
    .cache/nvim/distant.nvim/nvim-2983.sock"
   [2023-07-27 11:14:52.146250 +02:00] ERROR [src/cli/commands/client.rs:246] data did not match any variant of unta
    gged enum Msg at line 1 column 47
   [2023-07-27 11:14:57.101728 +02:00] ERROR [src/cli/commands/client.rs:246] data did not match any variant of unta
    gged enum Msg at line 1 column 47

Config

// lua/akaluza/packer.lua:
//
 use {
      'chipsenkbeil/distant.nvim',
      branch = 'v0.3',
      config = function()
          -- local actions = require('distant.nav.actions')
          require('distant'):setup {
              ['network.private'] = true,
              keymap = {
 
              },
              -- ['*'] = require('akaluza.distant_conf').alan_default()
 
              servers = {
                  ["*"] = {
                      lsp = {
                          ['project'] = {
                              cmd = { '/5/tools/llvm/15.0_042/bin/clangd'},
                              filetypes = {'c', 'cpp'},
                              root_dir = '/var/fpwork/akaluza/project/',
                              on_attach = function ()
                              end,
                              opts = { log_file = '/var/fpwork/akaluza/distant-server/lsp.log', verbose = 3 }
                          }
                      },
                      cwd = "/var/fpwork/akaluza/project/",
                  }
              }
          }
      end
  }

// after/plugin/telescope.lua:
//
  vim.keymap.set('n', '<leader>t', function()
      require('telescope').extensions.distant.search({
          paths = {'/var/fpwork/akaluza/project/'},
          pagination = 1,
      })
  end)

Local machine: Ubuntu 22.04.1 LTS on WSL
Remote machine: Red Hat Enterprise Linux Server 7.5 (Maipo)
Distant version: 0.20 musl.
Distant.nvim version: 0.3 on latest commit 17bcd37.

@InsaneZulol InsaneZulol changed the title 0.3 Distant search error when using Telescope "Cancellation failed because no search found" 0.3 error when using Telescope "Cancellation failed because no search found" Jul 27, 2023
@InsaneZulol
Copy link
Author

InsaneZulol commented Jul 28, 2023

Btw. what format are the traces in? I need their symbols decoded :)

@chipsenkbeil
Copy link
Owner

I understand that you already refactored the plugin since it's checkbox is ticked - sorry if I'm making an issue too early while it's still WIP.

No need for apologies! I'm grateful for the bug report! This feature might have gotten broken during the refactoring. It's why I haven't switched the repository over to v0.3 yet, but it's very close to being completed. I'll need to debug this to see what is going on, but my guess is you can expect either an update to the distant binary (i.e. 0.20.1) or some commits to the plugin or both.

[2023-07-27 11:14:52.146250 +02:00] ERROR [src/cli/commands/client.rs:246] data did not match any variant of unta
gged enum Msg at line 1 column 47
[2023-07-27 11:14:57.101728 +02:00] ERROR [src/cli/commands/client.rs:246] data did not match any variant of unta
gged enum Msg at line 1 column 47

This is concerning. This shows a bug in the distant client or server, which has been difficult to track down. I'll have to tried to reproduce your search scenario to see if I encounter it. Essentially, the server is sending data to the client that it does not recognize. In the past, this happened because the server and client were different versions, but if you're using 0.20 for both (no alphas), then I'm surprised to see this error message.

Btw. what format are the traces in? I need their symbols decoded :)

Can you clarify here? What traces are you referring to?

@chipsenkbeil chipsenkbeil added the bug Something isn't working label Jul 28, 2023
@chipsenkbeil chipsenkbeil added this to the v0.3.0 milestone Jul 28, 2023
@InsaneZulol
Copy link
Author

InsaneZulol commented Jul 31, 2023

Can you clarify here? What traces are you referring to?

Trace level logs in my server.log looks like this:

[2023-07-31 15:43:40.676964 +02:00] TRACE [distant-net/src/server/connection.rs:572] [Conn 704532122] Sending ��id12698853156878825901origin_id172922703_6629�payload��typesearch_resultsidΟU^Bmatches���typecontentspath�./var/fpwork/akaluza/project/README.mdlineso**NOTE** for reference: 
�line_number^Yabsolute_offset^C��submatches���matchtesstartiendl

So I'm unsure on what do I need to do to read that data.

@InsaneZulol
Copy link
Author

InsaneZulol commented Jul 31, 2023

I've double checked now that I've installed the musl binary on both local and remote.

Installation

Local

I've installed distant on locally by running
./install.sh --distant-host 'x86_64-unknown-linux-musl'

~ via 📦 v12.22.9
✗  distant -V
distant 0.20.0

Remote

on remote:
./install.sh --install-dir '/var/fpwork/akaluza/distant-server/' --distant-host 'x86_64-unknown-linux-musl'

(1.0.4) [akaluza@server distant-server]$ pwd
/var/fpwork/akaluza/distant-server
(1.0.4) [akaluza@server distant-server]$ ./distant -V
distant 0.20.0

Launch

:DistantLaunch ssh://server.net distant.args="--shutdown lonely=240 --log-level trace --log-file /var /fpwork/akaluza/distant-server/server.log" distant.bin="/var/fpwork/akaluza/distant-server/distant"

@chipsenkbeil
Copy link
Owner

Can you clarify here? What traces are you referring to?

Trace level logs in my server.log looks like this:

[2023-07-31 15:43:40.676964 +02:00] TRACE [distant-net/src/server/connection.rs:572] [Conn 704532122] Sending ��id12698853156878825901origin_id172922703_6629�payload��typesearch_resultsidΟU^Bmatches���typecontentspath�./var/fpwork/akaluza/project/README.mdlineso**NOTE** for reference: 
�line_number^Yabsolute_offset^C��submatches���matchtesstartiendl

So I'm unsure on what do I need to do to read that data.

Oh, I understand now. There isn't actually anything you need to do in order to read the data. The trace log you're seeing is an attempt to convert a response in msgpack binary format to text that can be read. The question mark symbols are just parts of the binary message that don't translate.

What this actually is showing is

  • id: 12698853156878825901
  • origin_id: 172922703_6629
  • payload
    • type: search_results
    • id: (some binary data)
    • matches
      • type: contents
      • path: ./var/fpwork/akaluza/project/README.md
      • lines: NOTE for reference:
      • line_number: (some binary data)
      • absolute_offsite: (some binary data)
      • submatches
        • match: (some binary data)
        • start: (some binary data)
        • end: (some binary data)

You don't really need to be able to read the whole thing. It's printed out at the trace level so we can confirm data is sent and received, not to necessarily see the exact information.

@InsaneZulol
Copy link
Author

InsaneZulol commented Jul 31, 2023

Thanks.

I've got a bit more clues. I've executed :lua require('telescope').extensions.distant.search({paths = {'/var/fpwork/akaluza/project/'} }) without the pagination = 1 field and while the error still pops up, by immediately dismissing it and retyping the query - the results do load and show up.

@chipsenkbeil chipsenkbeil modified the milestones: v0.3.0, v0.3.x Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants