crc-org / crc-extension

Red Hat OpenShift Local Extension for integration of OpenShift Local clusters with Podman Desktop
Apache License 2.0
19 stars 21 forks source link

[BUG] Error: Powershell script for running the daemon does not exist when initializing and starting OpenShift local resource in podman desktop #175

Closed odockal closed 1 year ago

odockal commented 1 year ago

General information

Error: Powershell script for running the daemon does not exist when initializing and starting OpenShift local resource in podman desktop OSLocal-error-powershellscript

If I check the extension under Settings -> Extensions, I see the activation failed: OSlocal-extension-activation-timeout

CRC version

CRC version: 2.26.0+233df0
OpenShift version: 4.13.9
Podman version: 4.4.4

# Put `crc version` output here

CRC status

Machine does not exist. Use 'crc start' to create it
# Put `crc status --log-level debug` output here

CRC config

- consent-telemetry                     : no

# Put `crc config view` output here

Host Operating System

Host Name:                 DESKTOP-BDDQV3I
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Ondrej
Registered Organization:
Product ID:                00330-80000-00000-AA049
Original Install Date:     2/10/2023, 10:15:11 AM
System Boot Time:          9/14/2023, 10:00:29 PM
System Manufacturer:       LENOVO
System Model:              20LAS3NJ0U
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~1910 Mhz
BIOS Version:              LENOVO N27ET29W (1.15 ), 8/8/2018
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             cs;Czech
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
Total Physical Memory:     32,383 MB
Available Physical Memory: 26,148 MB
Virtual Memory: Max Size:  37,247 MB
Virtual Memory: Available: 31,075 MB
Virtual Memory: In Use:    6,172 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\DESKTOP-BDDQV3I
Hotfix(s):                 16 Hotfix(s) Installed.
                           [01]: KB5029919
                           [02]: KB5028853
                           [03]: KB5011048
                           [04]: KB5011052
                           [05]: KB5012170
                           [06]: KB5015684
                           [07]: KB5020683
                           [08]: KB5030211
                           [09]: KB5014032
                           [10]: KB5016705
                           [11]: KB5023794
                           [12]: KB5025315
                           [13]: KB5026879
                           [14]: KB5028318
                           [15]: KB5028380
                           [16]: KB5029709
Network Card(s):           4 NIC(s) Installed.
                           [01]: Intel(R) Ethernet Connection (4) I219-LM
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [02]: Intel(R) Dual Band Wireless-AC 8265
                                 Connection Name: Wi-Fi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.50.1
                                 IP address(es)
                                 [01]: 192.168.50.136
                                 [02]: fe80::8b80:6dfd:d1d0:dbd3
                           [03]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (Default Switch)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 172.27.144.1
                                 [02]: fe80::c9df:88a2:3371:d61b
                           [04]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (WSL)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 172.23.48.1
                                 [02]: fe80::d020:912e:11a4:eeab
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

# Put the output of `cat /etc/os-release` in case of Linux
# put the output of `sw_vers` in case of Mac
# Put the output of `systeminfo` in case of Windows

Steps to reproduce

  1. Install OS local extension
  2. Install the crc via extension -> Enable Hyperv, pick up openshift preset, once it was set I have restarted the pc
  3. Open Podman Desktop, on dashboard under OS local press initialize and start

Expected

OS local is starting, and eventually started

Actual

Error dialog appears: Error: Powershell script for running the daemon does not exist, See above picture.

Logs

VM5:2 main ↪️ [openshift-local] Error: Powershell script for running the daemon does not exist

    at DaemonCommander.start (C:\Users\Ondrej\.local\share\containers\podman-desktop\plugins\quayioredhatdeveloperopenshiftlocalextension\dist\extension.js:9367:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async startCrc (C:\Users\Ondrej\.local\share\containers\podman-desktop\plugins\quayioredhatdeveloperopenshiftlocalextension\dist\extension.js:25386:24)
    at async createCrcVm (C:\Users\Ondrej\.local\share\containers\podman-desktop\plugins\quayioredhatdeveloperopenshiftlocalextension\dist\extension.js:26661:24)
    at async Object.initialize (C:\Users\Ondrej\.local\share\containers\podman-desktop\plugins\quayioredhatdeveloperopenshiftlocalextension\dist\extension.js:26637:13)
    at async C:\Users\Ondrej\AppData\Local\Programs\podman-desktop\resources\app.asar\packages\main\dist\index.cjs:329:390967
    at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:89452)
console.<computed> @ VM5:2

Before gather the logs try following if that fix your issue

$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug

Please consider posting the output of crc start --log-level debug on http://gist.github.com/ and post the link in the issue.

anjannath commented 1 year ago

I was able to reproduce this, for some reason when podman desktop is started and openshift local extension is started and it run crc setup, the powershell script created for the daemon at ~\.crc\bin\hidden_daemon.ps1 which contains the path to the crc executable, the path starts with the drive letter c:\ lower case

and i observed that when crc setup is directly run the drive letter in the script is uppercase

this causes crc setup to think the script is not present since its content is not matching because of the different case drive letter at the start of the path to crc executable

@odockal can you please verify this on your side as well, thanks!

odockal commented 1 year ago

@anjannath Hi there, when I look at ~\.crc\bin\hidden_daemon.ps1 there truly is (at the end of the script), c:\Program Files\... - c in lowercase.

odockal commented 1 year ago

And crc setup fixes this. So there is a discrepance between crc setup called from cli and from crc-extension.

thanks for figuring this out!

vilcapomaparejaca1998 commented 1 year ago

Finally, i solved this issue by installing to a different drive like D drive. And issue was solved like a charm.

odockal commented 1 year ago

@anjannath Seems like here is the problem: https://github.com/crc-org/crc/blob/45831b0e1410205465e33f477dd1fc4c5c724582/pkg/crc/preflight/preflight_daemon_task_check_windows.go#L220

Matching for the exact content simply do not take into account that even a path with lower case c works.

anjannath commented 1 year ago

@anjannath Seems like here is the problem: https://github.com/crc-org/crc/blob/45831b0e1410205465e33f477dd1fc4c5c724582/pkg/crc/preflight/preflight_daemon_task_check_windows.go#L220

Matching for the exact content simply do not take into account that even a path with lower case c works.

yeah, this matches the byte representation of the content, so even a different case will not match, i am not sure if we should relax this. I'd prefer to add a step in between to normalize the path to the executable so that its always uppercase