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

ENAMETOOLONG error when attempting to install packages with .luac files #1796

Closed
2 tasks done
wmcknig opened this issue Sep 27, 2024 · 2 comments
Closed
2 tasks done

Comments

@wmcknig
Copy link

wmcknig commented Sep 27, 2024

I've searched open issues for similar requests

  • Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

Initially I thought this was a problem with kickstart.nvim, I was getting told at startup that stylua and lua-language-server failed to install (the former consistently, the latter only sometimes but it appears to remain uninstalled). After trying installing some items shown as missing by :checkhealth that they may have depended on I tried using Mason directly, and installing the packages there. This gave the errors shown for Mason output.

I got similar errors with a few other packages, and had others that did not because they did not write a .luac file; the issue seems to be entirely one of auto-generated filename length. I am using an encrypted EXT4 partition, which limits filenames to 143 characters, so my case isn't necessarily typical, but either there is a configuration setting I'm missing to resolve this or this could bite someone else too.

Expected behavior

I expected the packages to install, or failing that indicate that I needed to install dependencies.

Affected packages

stylua, lua-language-server, haskell-language-server

Mason output

Failed
    ◍ stylua
      ▶ # [2/2] vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac

Likewise for lua-language-server

    Failed
    ◍ lua-language-server
      ▶ # [2/2] vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac

Installation log

[INFO  Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=lua-language-server) {}
[INFO  Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=stylua) {}
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:58: Attempting to lock package Package(name=lua-language-server)
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:58: Attempting to lock package Package(name=stylua)
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:70: Wrote lockfile Package(name=lua-language-server)
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:71: fs: mkdirp /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:149: Compiling installer. lua-language-server {}
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:141: Failed to parse spec spec lua-language-server vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server.lock
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:70: Wrote lockfile Package(name=stylua)
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:47: fs: rmrf /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:71: fs: mkdirp /home/myname/.local/share/nvim-kickstart/mason/staging/stylua
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:39: Building receipt for Package(name=lua-language-server)
[ERROR Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=lua-language-server) error="vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac"
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:149: Compiling installer. stylua {}
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:141: Failed to parse spec spec stylua vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink /home/myname/.local/share/nvim-kickstart/mason/staging/stylua.lock
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:47: fs: rmrf /home/myname/.local/share/nvim-kickstart/mason/staging/stylua
[DEBUG Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:39: Building receipt for Package(name=stylua)
[ERROR Thu 26 Sep 2024 08:02:58 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=stylua) error="vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac"
[DEBUG Thu 26 Sep 2024 08:03:00 PM EDT] .../nvim-kickstart/lazy/mason.nvim/lua/mason-core/fetch.lua:37: Fetching URL "https://api.mason-registry.dev/api/github/mason-org/mason-registry/releases/latest"
[DEBUG Thu 26 Sep 2024 08:03:00 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="curl", spawn_opts={
  args = { "-H", "Accept: application/vnd.mason-registry.v1+json; q=1.0, application/json; q=0.8", "-H", "User-Agent: mason.nvim v1.10.0 (+https://github.com/williamboman/mason.nvim)", "-fsSL", "-X", "GET", "--connect-timeout", 30, "https://api.mason-registry.dev/api/github/mason-org/mason-registry/releases/latest" }
}
[DEBUG Thu 26 Sep 2024 08:03:00 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 990535
[DEBUG Thu 26 Sep 2024 08:03:01 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=990535 exited with exit_code=0, signal=0
[DEBUG Thu 26 Sep 2024 08:03:01 PM EDT] .../nvim-kickstart/lazy/mason.nvim/lua/mason-core/fetch.lua:37: Fetching URL "https://github.com/mason-org/mason-registry/releases/download/2024-09-26-tidy-bar/registry.json.zip"
[DEBUG Thu 26 Sep 2024 08:03:01 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="curl", spawn_opts={
  args = { "-H", "User-Agent: mason.nvim v1.10.0 (+https://github.com/williamboman/mason.nvim)", "-fsSL", "-X", "GET", "-o", "/home/myname/.local/share/nvim-kickstart/mason/registries/github/mason-org/mason-registry/registry.json.zip", "--connect-timeout", 30, "https://github.com/mason-org/mason-registry/releases/download/2024-09-26-tidy-bar/registry.json.zip" }
}
[DEBUG Thu 26 Sep 2024 08:03:01 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 990537
[DEBUG Thu 26 Sep 2024 08:03:02 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=990537 exited with exit_code=0, signal=0
[DEBUG Thu 26 Sep 2024 08:03:02 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink /home/myname/.local/share/nvim-kickstart/mason/registries/github/mason-org/mason-registry/registry.json.zip
[DEBUG Thu 26 Sep 2024 08:03:02 PM EDT] .../nvim-kickstart/lazy/mason.nvim/lua/mason-core/fetch.lua:37: Fetching URL "https://github.com/mason-org/mason-registry/releases/download/2024-09-26-tidy-bar/checksums.txt"
[DEBUG Thu 26 Sep 2024 08:03:02 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:116: Spawning cmd="curl", spawn_opts={
  args = { "-H", "User-Agent: mason.nvim v1.10.0 (+https://github.com/williamboman/mason.nvim)", "-fsSL", "-X", "GET", "--connect-timeout", 30, "https://github.com/mason-org/mason-registry/releases/download/2024-09-26-tidy-bar/checksums.txt" }
}
[DEBUG Thu 26 Sep 2024 08:03:02 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:162: Spawned with pid 990543
[DEBUG Thu 26 Sep 2024 08:03:04 PM EDT] ...vim-kickstart/lazy/mason.nvim/lua/mason-core/process.lua:148: Job pid=990543 exited with exit_code=0, signal=0
[INFO  Thu 26 Sep 2024 08:03:09 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=lua-language-server) {}
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:58: Attempting to lock package Package(name=lua-language-server)
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:70: Wrote lockfile Package(name=lua-language-server)
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:71: fs: mkdirp /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:149: Compiling installer. lua-language-server {}
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...zy/mason.nvim/lua/mason-core/installer/registry/init.lua:141: Failed to parse spec spec lua-language-server vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:59: fs: unlink /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server.lock
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...are/nvim-kickstart/lazy/mason.nvim/lua/mason-core/fs.lua:47: fs: rmrf /home/myname/.local/share/nvim-kickstart/mason/staging/lua-language-server
[DEBUG Thu 26 Sep 2024 08:03:09 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:39: Building receipt for Package(name=lua-language-server)
[ERROR Thu 26 Sep 2024 08:03:09 PM EDT] ...kstart/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=lua-language-server) error="vim/loader.lua:0: ENAMETOOLONG: name too long: /home/myname/.cache/nvim-kickstart/luac/%2fhome%2fmyname%2f.local%2fshare%2fnvim-kickstart%2flazy%2fmason.nvim%2flua%2fmason-core%2finstaller%2fregistry%2fproviders%2fgithub%2finit.luac"

Neovim version (>= 0.7)

NVIM v0.10.1
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

Operating system/version

Linux myname 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux

Healthcheck

==============================================================================
mason: require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers: 
    mason.providers.registry-api
    mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-09-26-tidy-bar` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.`
- OK wget: `GNU Wget 1.21.3 built on linux-gnu.`
- OK curl: `curl 7.88.1 (x86_64-pc-linux-gnu) libcurl/7.88.1 OpenSSL/3.0.14 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 libpsl/0.21.2 (+libidn2/2.3.3) libssh2/1.10.0 nghttp2/1.52.0 librtmp/2.3 OpenLDAP/2.5.13`
- OK gzip: `gzip 1.12`
- OK tar: `tar (GNU tar) 1.34`
- OK bash: `GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem failed with exit code - and signal -. gem is not executable
- WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. javac is not executable
- OK node: `v18.19.0`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK python: `Python 3.11.2`
- OK cargo: `cargo 1.81.0 (2dbb1af80 2024-08-20)`
- OK luarocks: `/usr/bin/luarocks 3.8.0`
- OK java: `openjdk version "17.0.12" 2024-07-16`
- OK pip: `pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)`
- OK python venv: `Ok`
- OK npm: `9.2.0`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Thu 26 Sep 2024 09:08:34 PM EDT.
  Install and authenticate via gh-cli to increase rate limit.

Screenshots

No response

@wmcknig
Copy link
Author

wmcknig commented Oct 20, 2024

I took another look at the problematic cases and found they might be fixable if the percent-encoding were removed, i.e. instances of %2f were just replaced with spaces; would there be a way to provide this as an option?

@wmcknig
Copy link
Author

wmcknig commented Oct 23, 2024

Closing this as I (too long after initially submitted this) found some reports about this same issue occurring with Neovim's core plugin system; this is not a problem with Mason itself. Hopefully this will at least help someone who, too, came here after having troubles installing LSP's through Mason. It is worth noting that this issue also seems to have happened under NTFS, with a considerably longer filename limit.

neovim/neovim#25008

neovim/neovim#29372

@wmcknig wmcknig closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant