okd-project / okd

The self-managing, auto-upgrading, Kubernetes distribution for everyone
https://okd.io
Apache License 2.0
1.67k stars 289 forks source link

crc start cannot enable dnsmasq service because it's masked #1939

Open mlei opened 1 month ago

mlei commented 1 month ago

Describe the bug When using the current crc release and the okd preset (crc config set preset okd), the CoreOS image that it uses, crc_okd_libvirt_4.15.0-0.okd-2024-02-23-163410_amd64.crcbundle, has the dnsmasq.service systemd unit masked by default.

When executing crc start for the first time, the start will eventually fail with this error:

INFO Loading bundle: crc_okd_libvirt_4.15.0-0.okd-2024-02-23-163410_amd64... 
INFO Creating CRC VM for OKD 4.15.0-0.okd-2024-02-23-163410... 
INFO Generating new SSH key pair...               
INFO Generating new password for the kubeadmin user 
INFO Starting CRC VM for okd 4.15.0-0.okd-2024-02-23-163410... 
INFO CRC instance is running with IP 192.168.130.11 
INFO CRC VM is running                            
INFO Updating authorized keys...                  
INFO Configuring shared directories               
Error running post start: Executing systemctl action failed:  ssh command error:
command : sudo systemctl enable dnsmasq.service
err     : Process exited with status 1
: Failed to enable unit: Unit file /etc/systemd/system/dnsmasq.service is masked.

At this point, you can ssh into the instance and work around this manually:

mlei@fedora40:~$ ssh core@192.168.130.11 -i /home/mlei/.crc/machines/crc/id_ecdsa -i /home/mlei/.crc/cache/crc_okd_libvirt_4.15.0-0.okd-2024-02-23-163410_amd64/id_ecdsa_crc
Fedora CoreOS 39.20240128.3.0
Tracker: https://github.com/coreos/fedora-coreos-tracker
Discuss: https://discussion.fedoraproject.org/tag/coreos

[systemd]
Failed Units: 1
  qemu-guest-agent.service
core@crc:~$ sudo systemctl unmask dnsmasq
Removed "/etc/systemd/system/dnsmasq.service".
core@crc:~$ sudo systemctl status dnsmasq
○ dnsmasq.service - DNS caching server.
     Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
core@crc:~$ 
logout

After doing this, crc stop and then crc start, the start process proceeds normally from here.

Version

4.15.0-0.okd-2024-02-23-163410_amd64

Installed via crc

How reproducible Always

Log bundle

N/A

braisF commented 1 month ago

Hi! just say I had the same problem and @mlei workwaround worked (thanks!).

I've downgraded to 2.33 and worked out-of-the-box (my downgrade was for other reasons, not this issue, and didn't try to install the intermediate versions).

bdlink commented 2 weeks ago

I had same problem as @mlei and the work around cleared up the issue. Would be nice to see some movement on this. We in OKD-land are referring users interested in crc/openshift local to this okd plugin.

Anything we might do to help?

SamBarker commented 6 days ago

The workaround also worked for me but to make things a little easier for future users I'd suggest:

ssh core@$(crc ip) -i ${HOME}/.crc/machines/crc/id_ecdsa \
 -i ${HOME}/.crc/cache/crc_okd_libvirt_4.15.0-0.okd-2024-02-23-163410_amd64/id_ecdsa_crc \
 "sudo systemctl status dnsmasq"