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

Basic setup fails in containers #5

Closed
alourie opened this issue Jan 12, 2023 · 33 comments
Closed

Basic setup fails in containers #5

alourie opened this issue Jan 12, 2023 · 33 comments

Comments

@alourie
Copy link

alourie commented Jan 12, 2023

Using either the clean system or running the example docker command fails as a bunch of repos can't be cloned:

image

@luxus
Copy link

luxus commented Jan 12, 2023

have you really did a clean install? maybe you forgot a folder.. and do you really run your system as root?

rm -rf ~/.local/share/nvim ~/.config/nvim ~/.cache/nvim

@alourie
Copy link
Author

alourie commented Jan 12, 2023

have you really did a clean install? maybe you forgot a folder.. and do you really run your system as root?

rm -rf ~/.local/share/nvim ~/.config/nvim ~/.cache/nvim

Yeah, the above run is a clean docker run, meaning there's nothing in the root system....supposedly. The default root setup in alpine edge should not be having nvim folder in ~/.local/share ;-)

@luxus
Copy link

luxus commented Jan 12, 2023

tested by creating a dockerfile

FROM alpine:edge
RUN apk add --no-cache neovim git bash
RUN git clone https://github.com/LazyVim/starter ~/.config/nvim
CMD ["/bin/bash"]
podman build -f dockerfile -t lazy
podman run --rm -it lazy

and started nvim. the whole installation went perfectly

@alourie
Copy link
Author

alourie commented Jan 12, 2023

tested with

FROM alpine:edge
RUN apk add --no-cache neovim git bash
RUN 
CMD ["/bin/bash"]

after running i cloned starter git clone https://github.com/LazyVim/starter ~/.config/nvim and started nvim. the whole installation went perfectly

I just did absolutely the same thing and it failed with the above error.

@luxus
Copy link

luxus commented Jan 12, 2023

you could try again... i even add a little more info to my comment, and here is a video if you need more help to follow the steps https://asciinema.org/a/zYvFVP5bIPaowVKPiMe6yIMet

good luck

@folke
Copy link
Contributor

folke commented Jan 12, 2023

@alourie that's just not possible. Can you give me the exact docker/podman command you use that fails for you?

@alourie
Copy link
Author

alourie commented Jan 13, 2023

https://asciinema.org/a/1WvclBADVrdnLQlyamXIzpNJg

Just repeated the steps from @luxus

@alourie
Copy link
Author

alourie commented Jan 13, 2023

Updated the container to include gcc/g++, it only affects the compiler warnings, all the rest remains unchanged

@folke
Copy link
Contributor

folke commented Jan 13, 2023

Please try with the exact command from the README:

podman run -w /root -it --rm alpine:edge sh -uelic '
  apk add git lazygit neovim ripgrep alpine-sdk --update
  git clone https://github.com/LazyVim/starter ~/.config/nvim
  cd ~/.config/nvim
  nvim
'

Is there anything special about your system/network I should know?

It seems that everything gets cloned/installed, but after that lazy doesn't seem to be able to detect it is installed.

After the installation fails, can you press <cr> on one of the failed entries and show me what it says?

@folke
Copy link
Contributor

folke commented Jan 13, 2023

I just pushed some changes to lazy.nvim that will no longer show those weird stack traces with nvim_set_option, but that probably doesn't fix whatever is happening here.

Can you run the exact podman command I posted and see what :mess shows now? A screencast would be very useful too.

@alourie
Copy link
Author

alourie commented Jan 13, 2023

@folke I have no idea what's going on: https://asciinema.org/a/IvfY87myVelZ3TBfjVsOzQbgL

I have no strange networking setup, all normal. It's fairly basic arch install, nothing out of the ordinary

@folke
Copy link
Contributor

folke commented Jan 13, 2023

And are the plugins effectively cloned? And those dirs are not empty?

@alourie
Copy link
Author

alourie commented Jan 13, 2023

And are the plugins effectively cloned? And those dirs are not empty?

Yes, all are appropriately cloned.

As a test, I've tried the same on a VM with PopOS running, and it worked fine, without any issues. So what would be different on a basic Arch install to cause it to fail???..... It runs in a container!! so I'm pretty stocked and don't understand what could go wrong.

@folke
Copy link
Contributor

folke commented Jan 13, 2023

I really don't understand as well. You're also the only person that reported this issue.

Did you do any custom configuration for podman on your system?

Maybe try updating podman?

But you say that the exact same thing happens when not running in a container right?

@folke
Copy link
Contributor

folke commented Jan 13, 2023

The problem you seem to have is that the internal lazy state doesn't think it is installed, which is superweird. It looks as if the spawned git process does not trigger the exit callback in libuv for some super weird reason. Or at least it doesn't return OK

@alourie
Copy link
Author

alourie commented Jan 13, 2023

I really don't understand as well. You're also the only person that reported this issue.

Did you do any custom configuration for podman on your system?

Maybe try updating podman?

But you say that the exact same thing happens when not running in a container right?

Now I think I've mischaracterized it ...I haven't tried running it natively on my system (for obvious reasons), all is in the containers. However, I tried multiple containers (alpine, ubuntu) with the same result, yes.

I'll try updating podman, however I don't think I have any custom configuration...

@alourie alourie changed the title Basic setup fails on a clean system Basic setup fails in containers Jan 13, 2023
@folke
Copy link
Contributor

folke commented Jan 13, 2023

I was wrong about what failed.

It must be this part of the code that fails: https://github.com/folke/lazy.nvim/blob/666ed7bf73eb5895253c1155bd29270b066cbdac/lua/lazy/core/plugin.lua#L297

No idea why that would fail though

@alourie
Copy link
Author

alourie commented Jan 13, 2023

I'll try to follow that ....doesn't maybe root path is not properly detected, but why?

@folke
Copy link
Contributor

folke commented Jan 13, 2023

It is correctlt detected, since that same path is used to for the directory where the git clone happens and those files are there.

It looks as if the vim.loop.fs_scandir fails or does not return a type for the items.

Now that I think about it, another user did have something similar at some point and that was due to apparmor.

But of course aparrmor doesn't do anything in containers....

@folke
Copy link
Contributor

folke commented Jan 13, 2023

related: libuv/libuv#3555

This might be a luv issue

@folke
Copy link
Contributor

folke commented Jan 13, 2023

Can you disable selinux and try again? $ setenforce 0, you can obviously put it back after testing.

It seems that selinux is active for containers

@alourie
Copy link
Author

alourie commented Jan 16, 2023

Can you disable selinux and try again? $ setenforce 0, you can obviously put it back after testing.

It seems that selinux is active for containers

FWIW, I don't use selinux nor have it enabled. I'll see if I need to do it inside the container.

@Uzaaft
Copy link

Uzaaft commented Jan 16, 2023

Could you try and run:

$ sudo podman run -it alpine ping 8.8.8.8

and

$ sudo podman run -it alpine wget https://github.com/containers/libpod

To check if internet and dns is working properly from your pod man setup.

@folke
Copy link
Contributor

folke commented Jan 16, 2023

Internet is definately wworking for him. It's the Util.ls that fails for some reason after installing everything.

@alourie
Copy link
Author

alourie commented Jan 17, 2023

Yeah, there's no issue with "internet" in the container, as can be seen from the screen recordings above. I also don't run podman as sudo (and just to make sure, I did run it with sudo to test, still the same issue)

@alourie
Copy link
Author

alourie commented Jan 17, 2023

Internet is definately wworking for him. It's the Util.ls that fails for some reason after installing everything.

Utils.ls() is indeed incorrectly fetching some directories without the type. And it goes downhill from there.

What strange is that it behaves different on different hosts.

@folke
Copy link
Contributor

folke commented Jan 17, 2023

So it only has an empty type for some directories? So odd...

Most likely a bug in luv then, since type should always be available. Although one other user had similar issues, but that was with AppArmor.

Util.ls also seems to work for listing lazyvim.plugins, but seems to fail for listing the directories in the lazy data directory.

@alourie
Copy link
Author

alourie commented Jan 17, 2023

Phew.

I experimented a bit with the directories structure, and I have no idea why it doesn't work by default. However, if I mount a local directory for /root in the container, it works fine. 🤦

So....no issue?

@folke
Copy link
Contributor

folke commented Jan 17, 2023

Was the type file for those directories? I totally forgot I added smoething that returns file if it is nil. Think I'll just remove that and show an error instead.

@folke
Copy link
Contributor

folke commented Jan 17, 2023

I just added a work-around for the luv issue. Would be great if you could test one more time with podman. I think it should work now even when type is nil

@alourie
Copy link
Author

alourie commented Jan 18, 2023

I just added a work-around for the luv issue. Would be great if you could test one more time with podman. I think it should work now even when type is nil

It's alive!

Yeah, it works now. Tested in alpine and ubuntu containers.

Thanks so much for the effort!

@alourie
Copy link
Author

alourie commented Jan 18, 2023

Was the type file for those directories? I totally forgot I added smoething that returns file if it is nil. Think I'll just remove that and show an error instead.

yes, the type was nil. For some unclear reason, as the docs for uv say it should be (string, string) or nil or fail. So go figure.

@folke
Copy link
Contributor

folke commented Jan 18, 2023

good to know it works now. It's not ideal, since the fix is to to extra fs_stat calls when type is nil, but at least it will work now in those situations. Hpefully it will evenyually be fixed in libuv

@folke folke closed this as completed Jan 18, 2023
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

4 participants