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

Bug: fails to load #1226

Closed
3 of 6 tasks
mhanberg opened this issue May 30, 2024 · 11 comments
Closed
3 of 6 tasks

Bug: fails to load #1226

mhanberg opened this issue May 30, 2024 · 11 comments
Labels
invalid This doesn't seem right

Comments

@mhanberg
Copy link

mhanberg commented May 30, 2024

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

macOS 14.5

Shell

zsh

Neovim version (nvim --version)

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1693350652 Run "nvim -V1 -v" for more info

Fzf version (fzf --version)

0.52.1 (brew)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

nil

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

local actions = require("fzf-lua.actions")
      require("fzf-lua").setup {
        winopts = {
          height = 0.6, -- window height
          width = 0.9,
          row = 0, -- window row position (0=top, 1=bottom)
        },
        actions = {
          files = {
            ["default"] = actions.file_edit_or_qf,
            ["ctrl-x"] = actions.file_split,
            ["ctrl-v"] = actions.file_vsplit,
            ["ctrl-t"] = actions.file_tabedit,
            ["alt-q"] = actions.file_sel_to_qf,
            ["alt-l"] = actions.file_sel_to_ll,
          },
        },
        lsp = {
          symbols = {
            symbol_icons = {
              File = "󰈙",
              Module = "",
              Namespace = "󰦮",
              Package = "",
              Class = "󰆧",
              Method = "󰊕",
              Property = "",
              Field = "",
              Constructor = "",
              Enum = "",
              Interface = "",
              Function = "󰊕",
              Variable = "󰀫",
              Constant = "󰏿",
              String = "",
              Number = "󰎠",
              Boolean = "󰨙",
              Array = "󱡠",
              Object = "",
              Key = "󰌋",
              Null = "󰟢",
              EnumMember = "",
              Struct = "󰆼",
              Event = "",
              Operator = "󰆕",
              TypeParameter = "󰗴",
            },
          },
        },
      }

Describe the bug / steps to reproduce

I just start up nvim in some projects and get the following

CleanShot 2024-05-30 at 16 16 11@2x

Error detected while processing /private/var/folders/tq/mth3_ts165lgksvbpbzsqd9w0000gn/T/tmp.80MAmkOLln/tmp.PZ5YAEPWdE/nix-shell.pDLybQ/fzf-lua.tmp/nv
im/site/pack/vendor/start/fzf-lua/scripts/init.lua:
E5113: Error while calling lua chunk: Vim:Failed to start server: address already in use
stack traceback:
        [C]: in function 'serverstart'
        ...nvim/site/pack/vendor/start/fzf-lua/lua/fzf-lua/init.lua:40: in main chunk
        [C]: in function 'require'
        ...tmp/nvim/site/pack/vendor/start/fzf-lua/scripts/init.lua:8: in main chunk
Press ENTER or type command to continue
@mhanberg mhanberg added the bug Something isn't working label May 30, 2024
@ibhagwan
Copy link
Owner

I just start up nvim in some projects and get the following

  • Is it consistently failing on some specific projects? If so, what's unique about these specific projects?
  • Are you opening neovim in quick succession on multiple projects (i.e. within the same second)?

@mhanberg
Copy link
Author

Is it consistently failing on some specific projects? If so, what's unique about these specific projects?

not sure what is unique about the times it has happened, it works until it seems to happen randomly and then I think the only way i have figured out how to fix it is to restart my computer.

Are you opening neovim in quick succession on multiple projects (i.e. within the same second)?

I am not

@ibhagwan
Copy link
Owner

It seems to me this might be an upstream issue and neovim unable to start new RPC services.

Next time this fails can you run:

:= pcall(vim.fn.serverstart, "test")

If everything works succesfully you should be seeing something like this in :messages:

true
/run/user/1000/test.25946.5

But I suspect you'll be seeing this:

false
Vim:Failed to start server: address already in use

@mhanberg
Copy link
Author

Actually, I think I have determined a unique thing, and might indicate this is not your problem.

It seems to trigger when I am inside a nix shell that is triggered via direnv's use flake function.


I ran your test here := pcall(vim.fn.serverstart, "test") and your hypothesis is correct. When i am inside the nix shell via direnv, it doesn't work and the test fails, when i'm outside of the nix shell, fzf-lua works and the test succeeds

@ibhagwan
Copy link
Owner

ibhagwan commented May 30, 2024

The named pipe should be created in the runtime dir, check if you have access to the output of the below folder inside the nix shell:

:= vim.fn.stdpath("run")

Also check in the shell:

echo $XDG_RUNTIME_DIR

@ibhagwan ibhagwan added invalid This doesn't seem right and removed bug Something isn't working labels May 30, 2024
@mhanberg
Copy link
Author

/var/folders/tq/mth3_ts165lgksvbpbzsqd9w0000gn/T/tmp.80MAmkOLln/tmp.PZ5YAEPWdE/nix-shell.Wl0tzf/nvim.mitchell/aP048l for the stdpath inside the nix shell

it appears to be /var/folders/tq/mth3_ts165lgksvbpbzsqd9w0000gn/T/tmp.YCNJG9vFd8/nvim.mitchell/vfREoC in other nvim instance not in the nix shell

@mhanberg
Copy link
Author

I have access to that directory, but there is nothing in it

@ibhagwan
Copy link
Owner

Ty for the update @mhanberg, though I’m not sure what I can do to help with this, as long as serverstart won’t work fzf-lua won’t be able to function properly.

This is either an issue with neovim or direnv/nix, there is not much I can do to fix this from my end as it should be handled either in your environment or upstream of it’s a bug in neovim.

@mhanberg
Copy link
Author

Thanks, I appreciate the time!

I'll update if I figure something out on my end.

@mhanberg mhanberg closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
@ibhagwan
Copy link
Owner

Thanks, I appreciate the time!

I'll update if I figure something out on my end.

Ty @mhanberg, please do update when you find the solution in case somebody else encounters this.

@craigmac
Copy link
Contributor

I just ran into this error, and the line what's unique about these specific projects helped me pinpoint the issue - when nvim is started in a folder in root owned folder, I would get this error about serverstart() failing, probably to do with write permissions, as I would see this error when starting nvim in folders I cannot write to, but wouldn't see the error when starting nvim from home folder, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants