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

Fedora 40 error, certain module not found #42

Open
B-Divyesh opened this issue Sep 2, 2024 · 27 comments
Open

Fedora 40 error, certain module not found #42

B-Divyesh opened this issue Sep 2, 2024 · 27 comments

Comments

@B-Divyesh
Copy link

B-Divyesh commented Sep 2, 2024

I have tried to install NvChad both through the package manager installation of nvim and building from source (thus error occured with both versions 0.10.1 and 0.11.0), here is the error I got, I have tried reinstalling multiple timed cleaned the config file etc.

Error detected while processing /home/[retracted]/.config/nvim/init.lua:
No specs found for module "nvchad.plugins"
Plugin NvChad is not installed
E5113: Error while calling lua chunk: cannot open /home/[retracted]/.local/share/nvim/nvchad/base46/defaults: No such file or directory
stack traceback:
[C]: in function 'dofile'
/home/[retracted]/.config/nvim/init.lua:29: in main chunk

@siduck
Copy link
Member

siduck commented Sep 3, 2024

have you done rm -rf .local/share/nvim?

@B-Divyesh
Copy link
Author

B-Divyesh commented Sep 3, 2024

yep I have executed those commands (rm -rf ~/.config/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim)

I get this issue from time to time, I have observed that in the init.lua page changing lazy = true allows the install of the first 3 plugins i.e NvChad etc, but then the installatoin of base46 cmp-buffer etc results in this error:-

Error detected while processing /home/[retracted]/.config/nvim/init.lua:
Plugin ui is not installed
E5113: Error while calling lua chunk: cannot open /home/[retracted]/.local/share/nvim/nvchad/base46/defaults: No such file or directory
stack traceback:
[C]: in function 'dofile'
/home/[retracted]/.config/nvim/init.lua:29: in main chunk

@siduck
Copy link
Member

siduck commented Sep 3, 2024

such a weird issue, no one has faced this ever :/
idk how to debug it, the config code is 100 % correct, can you please try in a VM so we could know fedora's not messing around

i hope this isnt those immutable distro issues 😂

@B-Divyesh
Copy link
Author

I will definitely go through it, but I urge you to also start up a VM and see what you can do ,Thank you.

@siduck
Copy link
Member

siduck commented Sep 4, 2024

can you uninstall nvim and try this? https://github.com/MordechaiHadad/bob

@B-Divyesh
Copy link
Author

B-Divyesh commented Sep 5, 2024

So I did, bob install 0.10.1, this time around 2 plugins installed unlike last time(none were able to install), those were conform.nvim and nvim-lspconfig, but NVChad plugin failed to install with this error

Error detected while processing /home/[redacted]/.config/nvim/init.lua:
No specs found for module "nvchad.plugins"
Plugin NvChad is not installed
E5113: Error while calling lua chunk: cannot open /home/[redacted]/.local/share/nvim/nvchad/base46/defaults: No such file or directory
stack traceback:
[C]: in function 'dofile'
/home/[redacted]/.config/nvim/init.lua:29: in main chunk

Maybe because the pluign is trying to access base46 before its even installed

@siduck
Copy link
Member

siduck commented Sep 5, 2024

can you please show me a video?

rm -rf ~/.local/share/nvim
then clone nvchad dir

@B-Divyesh
Copy link
Author

sure I will take some time to send the video, but for nowI have disabled

commented these lines out
--dofile(vim.g.base46_cache .. "defaults")
--dofile(vim.g.base46_cache .. "statusline")

most problems get fixed but during the install of the remaining 21 packages it says
error plugin UI not installed

@B-Divyesh
Copy link
Author

B-Divyesh commented Sep 5, 2024

ok I apologise, but the weirdest thing is happening during a feodra installation, that I think you should try this on a VM yourself or install the distro, so I manually made a directory i.e ~/.local/share/nvim/nvchad/base46/, now this installs everything and fixes itself but results in this error where the lazy.nvim checkout fails

  ✔ [task] checkout 120004.78ms
    Previous HEAD position was 077102c chore(main): release 11.14.1 (#1680)

    Process was killed because it reached the timeout
  ✔ [task] checkout 148.71ms
    fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': Unable to create '/home/[redacted]/.local/share/nvim/lazy/lazy.nvim/.git/HEAD.lock': File exists.

    Another git process seems to be running in this repository, e.g.
    an editor opened by 'git commit'. Please make sure all processes
    are terminated then try again. If it still fails, a git process
    may have crashed in this repository earlier:
    remove the file manually to continue.
    M	lua/lazy/community/_generated.lua
    M	lua/lazy/core/config.lua
    M	lua/lazy/core/loader.lua
    M	lua/lazy/pkg/rockspec.lua

along with luaSnip plugin error:
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

@B-Divyesh
Copy link
Author

B-Divyesh commented Sep 5, 2024

Now I closed all instances of git clones and deleted all .cloning files and restarted, LuaSnip kept failing so I manually cloned it into the lazy directory, So it is pretty much fixed, but ofcourse, we still need to find the solution to why it isn't happening automatically
My suggestions would be that whenever the error occurs you can write the script to delete all .cloning files and clone again, to avoid the HEAD error or file exists error, or I can commit it for you if I have time

@siduck
Copy link
Member

siduck commented Sep 5, 2024

thats so weird, you shouldnt be manually adding base46 dir... or removing it :/

@siduck
Copy link
Member

siduck commented Sep 5, 2024

is your internet slow?

@B-Divyesh
Copy link
Author

B-Divyesh commented Sep 5, 2024

Well I am getting 60 Mbps, you tell me

and if you look at all the errors it keeps claiming that that directory of file wasn't found
also check the other issue here the Windows hiccup one, its the same error there too, someone claims that the same error happens in their manjaro distro.

@siduck
Copy link
Member

siduck commented Sep 6, 2024

ok i will try in fedora vm today

https://fedoraproject.org/spins/xfce/download this one

@siduck
Copy link
Member

siduck commented Sep 6, 2024

Also try asking on our discord server, you'll get help quicker there

@B-Divyesh
Copy link
Author

sure, thank you, I use gnome btw but I dont know if that makes a difference

@siduck
Copy link
Member

siduck commented Sep 8, 2024

simplescreenrecorder-2024-09-08_08.09.31.mp4

Unable to reproduce in fedora vm, used the xfce spin

@B-Divyesh
Copy link
Author

well I am at a loss for words, I am certain that this error does exist as observed in the same issue raised in this repo, I reckon it might be due to file privileges that is is not getting but I am not sure, can you uninstall nvim and install the nightly version, I think that broke something along the way so any subsequent installs were subject to the same problem

@siduck
Copy link
Member

siduck commented Sep 9, 2024

@B-Divyesh we dont support nightly, try with stable

@B-Divyesh
Copy link
Author

I think you misunderstood, I was saying that after installing nightly or installing nightly and running nvchad, even after deleting it, some issues persist so I asked you to check if it was that

@siduck
Copy link
Member

siduck commented Sep 9, 2024

provide a video so I could believe!!

@B-Divyesh
Copy link
Author

I will provide video if I happen to encounter it, but I do believe this is an existing issue, which is more about the package rather than the distro, maybe git being funky due to a config, but for now, I have provided some sort of rag-tag solution so I will close this issue for now, thank you for the help so far.

@siduck siduck reopened this Sep 12, 2024
@siduck
Copy link
Member

siduck commented Sep 12, 2024

this is the weirdest issue i've seen so far, does it work on other distros?

@therealthingy
Copy link

therealthingy commented Sep 27, 2024

I'm facing the exact same issue on my Apple Silicone MacBook

Screen.Recording.2024-09-27.at.7.28.03.PM.mov

The directory nvchad isn't even created:

❯ tree -L2 ~/.local/share/nvim/
/Users/gary/.local/share/nvim/
`-- lazy
    |-- LuaSnip
    |-- NvChad
    |-- base46
    |-- cmp-buffer
    |-- cmp-nvim-lsp
    |-- cmp-nvim-lua
    |-- cmp-path
    |-- cmp_luasnip
    |-- conform.nvim
    |-- friendly-snippets
    |-- gitsigns.nvim
    |-- indent-blankline.nvim
    |-- lazy.nvim
    |-- mason.nvim
    |-- nvim-autopairs
    |-- nvim-cmp
    |-- nvim-colorizer.lua
    |-- nvim-lspconfig
    |-- nvim-tree.lua
    |-- nvim-treesitter
    |-- nvim-web-devicons
    |-- plenary.nvim
    |-- telescope.nvim
    |-- ui
    `-- which-key.nvim

@siduck
Copy link
Member

siduck commented Sep 28, 2024

vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "

-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

if not vim.uv.fs_stat(lazypath) then
  local repo = "https://github.com/folke/lazy.nvim.git"
  vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end

vim.opt.rtp:prepend(lazypath)

local lazy_config = require "configs.lazy"

-- load plugins
require("lazy").setup({
  "nvim-lua/plenary.nvim",

  {
    "nvchad/base46",
    build = function()
      require("base46").load_all_highlights()
    end,
  },

  {
    "nvchad/ui",
    config = function()
      require "nvchad"
    end,
  },

  {
    "NvChad/NvChad",
    lazy = false,
    branch = "v2.5",
    import = "nvchad.plugins",
  },

  { import = "plugins" },
}, lazy_config)

-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")

require "options"
require "nvchad.autocmds"

vim.schedule(function()
  require "mappings"
end)

try this as your main init.lua

@therealthingy
Copy link

vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "

-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

if not vim.uv.fs_stat(lazypath) then
  local repo = "https://github.com/folke/lazy.nvim.git"
  vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end

vim.opt.rtp:prepend(lazypath)

local lazy_config = require "configs.lazy"

-- load plugins
require("lazy").setup({
  "nvim-lua/plenary.nvim",

  {
    "nvchad/base46",
    build = function()
      require("base46").load_all_highlights()
    end,
  },

  {
    "nvchad/ui",
    config = function()
      require "nvchad"
    end,
  },

  {
    "NvChad/NvChad",
    lazy = false,
    branch = "v2.5",
    import = "nvchad.plugins",
  },

  { import = "plugins" },
}, lazy_config)

-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")

require "options"
require "nvchad.autocmds"

vim.schedule(function()
  require "mappings"
end)

try this as your main init.lua

Thank you, that's what I'll try next

I've done some further testing and I suspect it's a permission issue:

Screen.Recording.2024-09-28.at.12.03.52.PM.mov

( The installation succeeds when I run nvim as root for the first time. )

Interestingly, when I run nvim as root in my Ubuntu 24.04 LTS VM, I get the "normal nvim" screen (despite having cloned the repo into ~/.config/nvim).

Screen.Recording.2024-09-28.at.12.15.57.PM.mov

I.e., nvim running as root in Ubuntu looks in /root/.config.
But in macOS, it seems to be looking into ~/.config/nvim (of the "real user"), even when running as root.

And I remember (accidentally) running NvChad the 1st time as root.
Maybe there are files (besides ~/.config/nvim, ~/.local/share/nvim, ~/.cache/nvim) w/ wrong permissions causing the issue?

@therealthingy
Copy link

therealthingy commented Sep 28, 2024

I THINK I've fixed it:

❯ gfind . -user root
./.local/state/nvim/lazy/readme/doc/friendly-snippets.md
./.local/state/nvim/lazy/readme/doc/base46.md
./.local/state/nvim/lazy/readme/doc/cmp-path.md
./.local/state/nvim/lazy/readme/doc/cmp_luasnip.md
./.local/state/nvim/lazy/readme/doc/cmp-nvim-lua.md
./.local/state/nvim/lazy/readme/doc/cmp-buffer.md
./.local/state/nvim/lazy/readme/doc/nvim-web-devicons.md
./.local/state/nvim/lazy/pkg-cache.lua
[…]

❯ sudo rm -rf  ~/.local/state/nvim/

❯ nvim

image

So it's indeed a permission issue
and deleting aforesaid directory seems to fix it;
and it's probably caused by running NvChad as root for the 1st time.

THUS my question: Is it possible to check and refuse the installation when EUID != RUID?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants