Skip to content

[BUG] crc setup fails to get current user ID on Fedora CSB #4194

Open
@ebensh

Description

@ebensh

General information

OS: Fedora Linux 39 (CSB)

  • Hypervisor: KVM / Hyper-V / hyperkit / vfkit

KVM, I think

  • Did you run crc setup before starting it (Yes/No)?

crc setup is actually the part that is failing

  • Running CRC on: Laptop / Baremetal-Server / VM

Laptop

CRC version

CRC version: 2.34.1+b470b5f6
OpenShift version: 4.15.3
Podman version: 4.4.4

CRC status

DEBU CRC version: 2.34.1+b470b5f6                 
DEBU OpenShift version: 4.15.3                    
DEBU Podman version: 4.4.4                        
DEBU Running 'crc status'                         
crc does not seem to be setup correctly, have you run 'crc setup'?

CRC config

- consent-telemetry                     : no
- preset                                : microshift

Host Operating System

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /etc/os-release
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ NAME="Fedora Linux"
   2   │ VERSION="39 (Workstation Edition)"
   3   │ ID=fedora
   4   │ VERSION_ID=39
   5   │ VERSION_CODENAME=""
   6   │ PLATFORM_ID="platform:f39"
   7   │ PRETTY_NAME="Fedora Linux 39 (Workstation Edition)"
   8   │ ANSI_COLOR="0;38;2;60;110;180"
   9   │ LOGO=fedora-logo-icon
  10   │ CPE_NAME="cpe:/o:fedoraproject:fedora:39"
  11   │ DEFAULT_HOSTNAME="fedora"
  12   │ HOME_URL="https://fedoraproject.org/"
  13   │ DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f39/system-administrators-guide/"
  14   │ SUPPORT_URL="https://ask.fedoraproject.org/"
  15   │ BUG_REPORT_URL="https://bugzilla.redhat.com/"
  16   │ REDHAT_BUGZILLA_PRODUCT="Fedora"
  17   │ REDHAT_BUGZILLA_PRODUCT_VERSION=39
  18   │ REDHAT_SUPPORT_PRODUCT="Fedora"
  19   │ REDHAT_SUPPORT_PRODUCT_VERSION=39
  20   │ SUPPORT_END=2024-11-12
  21   │ VARIANT="Workstation Edition"
  22   │ VARIANT_ID=workstation
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Steps to reproduce

  1. Run crc setup

Expected

Proceed with crc setup

Actual

$ crc setup
INFO Using bundle path /home/ebenshet/.crc/cache/crc_microshift_libvirt_4.15.3_amd64.crcbundle 
INFO Checking if running as non-root              
INFO Checking if running inside WSL2              
INFO Checking if crc-admin-helper executable is cached 
INFO Checking if running on a supported CPU architecture 
INFO Checking if crc executable symlink exists    
INFO Checking minimum RAM requirements            
INFO Check if Podman binary exists in: /home/ebenshet/.crc/bin/oc 
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 Adding user to libvirt group                 
Failed to get current user id

Logs

Before gather the logs try following if that fix your issue

$ crc delete -f
Machine does not exist. Use 'crc start' to create it
 
$ crc cleanup
INFO Removing vsock configuration                 
INFO Removing 'crc' network from libvirt          
INFO Removing /etc/NetworkManager/dispatcher.d/99-crc.sh file 
INFO Removing crc daemon systemd socket units     
INFO Removing crc daemon systemd service          
INFO Removing crc's virtual machine               
INFO Removing crc libvirt storage pool            
INFO Removing CRC Specific entries from user's known_hosts file 
INFO Removing hosts file records added by CRC     
INFO Removing pull secret from the keyring        
INFO Removing older logs                          
Cleanup finished

$ crc setup --log-level debug
DEBU CRC version: 2.34.1+b470b5f6                 
DEBU OpenShift version: 4.15.3                    
DEBU Podman version: 4.4.4                        
DEBU Running 'crc setup'                          
INFO Using bundle path /home/ebenshet/.crc/cache/crc_microshift_libvirt_4.15.3_amd64.crcbundle 
DEBU Checking if systemd-resolved.service is running 
DEBU Running 'systemctl status systemd-resolved.service' 
DEBU systemd-resolved.service is already running  
INFO Checking if running as non-root              
INFO Checking if running inside WSL2              
INFO Checking if crc-admin-helper executable is cached 
DEBU Running '/home/ebenshet/.crc/bin/crc-admin-helper-linux --version' 
DEBU Found crc-admin-helper-linux version 0.5.2   
DEBU crc-admin-helper executable already cached   
INFO Checking if running on a supported CPU architecture 
DEBU GOARCH is amd64 GOOS is linux                
INFO Checking if crc executable symlink exists    
INFO Checking minimum RAM requirements            
DEBU Total memory of system is 67110907904 bytes  
INFO Check if Podman binary exists in: /home/ebenshet/.crc/bin/oc 
INFO Checking if Virtualization is enabled        
DEBU Checking if the vmx/svm flags are present in /proc/cpuinfo 
DEBU CPU virtualization flags are good            
INFO Checking if KVM is enabled                   
DEBU Checking if /dev/kvm exists                  
DEBU /dev/kvm was found                           
INFO Checking if libvirt is installed             
DEBU Checking if 'virsh' is available             
DEBU 'virsh' was found in /usr/bin/virsh          
DEBU Checking 'virsh capabilities' for libvirtd/qemu availability 
DEBU Running 'virsh --readonly --connect qemu:///system capabilities' 
DEBU Found x86_64 hypervisor with 'hvm' capabilities 
INFO Checking if user is part of libvirt group    
DEBU Checking if current user is part of the libvirt group 
DEBU user.Current() failed: user: unknown userid 4200659
DEBU Failed to get current user id                
INFO Adding user to libvirt group                 
DEBU Adding current user to the libvirt group     
DEBU user.Current() failed: user: unknown userid 4200659
Failed to get current user id

This seems to be related to Fedora CSB using Kerberos users, not /etc/passwd type local users.

Golang method failing: https://pkg.go.dev/os/user#Current
Source: https://cs.opensource.google/go/go/+/master:src/os/user/user.go;l=70?q=user.go

Maybe this helps: https://cs.opensource.google/go/go/+/master:src/os/user/user.go;l=14-17?q=user.go , where they mention that cgo would use a different library to do the user lookup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions