crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.25k stars 236 forks source link

Pre-flight check fails when checking for group membership of the user #110

Closed jeffmaury closed 5 years ago

jeffmaury commented 5 years ago

Tried crc start without the bundle downloaded yet and got a panic error:

jeffmaury@localhost crc-0.85.0-linux-amd64]$ ./crc start
crc - Local OpenShift 4.x cluster
INFO  Checking if Virtualization is enabled       
INFO  Checking if KVM is enabled                  
INFO  Checking if Libvirt is installed            
INFO  Checking if user is part of libvirt group   
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x884e68]

goroutine 1 [running]:
github.com/code-ready/crc/pkg/crc/preflight.preflightCheckSucceedsOrFails(0x9a6300, 0x9bb8f8, 0x9ab201, 0x29, 0x0)
    /home/prkumar/work/github/crc/pkg/crc/preflight/preflight_common.go:26 +0x188
github.com/code-ready/crc/pkg/crc/preflight.StartPreflightChecks()
    /home/prkumar/work/github/crc/pkg/crc/preflight/preflight_linux.go:25 +0x201
github.com/code-ready/crc/cmd/crc/cmd.runStart(0xddadb8, 0x0, 0x0)
    /home/prkumar/work/github/crc/cmd/crc/cmd/start.go:41 +0xce
github.com/code-ready/crc/cmd/crc/cmd.glob..func6(0xdb3b00, 0xddadb8, 0x0, 0x0)
    /home/prkumar/work/github/crc/cmd/crc/cmd/start.go:25 +0x3f
github.com/spf13/cobra.(*Command).execute(0xdb3b00, 0xddadb8, 0x0, 0x0, 0xdb3b00, 0xddadb8)
    /home/prkumar/work/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0xdb3640, 0xdb3fc0, 0xc00017df68, 0xc00017df88)
    /home/prkumar/work/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xdb3640, 0x1, 0xdb3fc0)
    /home/prkumar/work/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x2b
github.com/code-ready/crc/cmd/crc/cmd.Execute()
    /home/prkumar/work/github/crc/cmd/crc/cmd/root.go:59 +0x2d
main.main()
    /home/prkumar/work/github/crc/cmd/crc/main.go:8 +0x20
[jeffmaury@localhost crc-0.85.0-linux-amd64]$ 
jeffmaury commented 5 years ago

Please not that I did not run crc setup before. After crc setup run, the error is more explicit:

[jeffmaury@localhost crc-0.85.0-linux-amd64]$ ./crc start
crc - Local OpenShift 4.x cluster
INFO  Checking if Virtualization is enabled       
INFO  Checking if KVM is enabled                  
INFO  Checking if Libvirt is installed            
INFO  Checking if user is part of libvirt group   
INFO  Checking if Libvirt is enabled              
INFO  Checking if Libvirt daemon is running       
INFO  Checking if crc-driver-libvirt is installed 
INFO  Checking if Libvirt crc network is available 
INFO  Checking if Libvirt crc network is active   
INFO  Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
INFO  Extracting the Bundle tarball ...           
ERRO Error to get bundle Metadata Error during extraction : open crc_libvirt_v4.1.0-rc0.tar.xz: no such file or directory 
INFO                                              
ERRO Error during extraction : open crc_libvirt_v4.1.0-rc0.tar.xz: no such file or directory 
gbraad commented 5 years ago

You need to obtain the image bundle from the location as described in the email. This is only offered for internal purposes via gdrive now.

gbraad commented 5 years ago

Which platform are you on?

@praveenkumar I guess this is due to the alternative method to get the group info.

jeffmaury commented 5 years ago

I'm on Fedora29 running in an Hyper-V VM on a Win10 Pro laptop

gbraad commented 5 years ago

Will test a litte but more, but on my F29 (running in the same way from Hyper-V using nested) I did not see this. It might be an issue with the group check code, and not really the virtualization stack itself.

what is the UID? and does this user have sudo rights or part of wheel?

On Mon, May 6, 2019 at 4:16 PM Jeff MAURY notifications@github.com wrote:

I'm on Fedora29 running in an Hyper-V VM on a Win10 Pro laptop

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/code-ready/crc/issues/110#issuecomment-489542589, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAOZT6WZRZGFRLPPNN2HTPT7SNXANCNFSM4HKVLSYA .

--

Gerard Braad | http://gbraad.nl [ Doing Open Source Matters ]

jeffmaury commented 5 years ago

Here is the output of the id command:

uid=1000(jeffmaury) gid=1000(jeffmaury) groups=1000(jeffmaury),10(wheel),983(libvirt) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

gbraad commented 5 years ago

The issue is actually refering to two different things. There is a panic when there is no bundle specified for the start command (this also happens on a restart), and the issue related to the user check. Can we break this up, or at least verify if the user ID check still applies? @tsedmik can you try something around the user checks and see if you can reproduce this?


Note: this issue is a duplicate for the bundle issue of #104. Modifying this to be just about the User ID.

gbraad commented 5 years ago

The bundle issue is a duplicate of #104

tsedmik commented 5 years ago

@gbraad I'm able to reproduce the issue with the user check with the latest crc (builded from master branch ed1fd10).

[fedora@tsedmik-cdk bin]$ ./crc start -b ~/Downloads/crc_libvirt_4.1.0-rc.5.tar.xz 
crc - Local OpenShift 4.x cluster
INFO  Checking if Virtualization is enabled       
INFO  Checking if KVM is enabled                  
INFO  Checking if Libvirt is installed            
INFO  Checking if user is part of libvirt group   
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8c6a08]

goroutine 1 [running]:
github.com/code-ready/crc/pkg/crc/preflight.preflightCheckSucceedsOrFails(0x9fd100, 0xa14c40, 0xa026bc, 0x29, 0x0)
    /home/fedora/crc/pkg/crc/preflight/preflight_common.go:26 +0x188
github.com/code-ready/crc/pkg/crc/preflight.StartPreflightChecks()
    /home/fedora/crc/pkg/crc/preflight/preflight_linux.go:25 +0x201
github.com/code-ready/crc/cmd/crc/cmd.runStart(0xc00000dd80, 0x0, 0x2)
    /home/fedora/crc/cmd/crc/cmd/start.go:44 +0x4e
github.com/code-ready/crc/cmd/crc/cmd.glob..func6(0xe49e80, 0xc00000dd80, 0x0, 0x2)
    /home/fedora/crc/cmd/crc/cmd/start.go:30 +0x3f
github.com/spf13/cobra.(*Command).execute(0xe49e80, 0xc00000dd60, 0x2, 0x2, 0xe49e80, 0xc00000dd60)
    /home/fedora/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0xe499c0, 0x14, 0x0, 0x0)
    /home/fedora/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xe499c0, 0xc000197f68, 0x8c9a62)
    /home/fedora/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x2b
github.com/code-ready/crc/cmd/crc/cmd.Execute()
    /home/fedora/crc/cmd/crc/cmd/root.go:57 +0x2d
main.main()
    /home/fedora/crc/cmd/crc/main.go:10 +0x25

I'm not a member of libvirt group:

[fedora@tsedmik-cdk bin]$ id fedora
uid=1000(fedora) gid=1000(fedora) groups=1000(fedora),4(adm),10(wheel),190(systemd-journal)