gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Critical error on Windows 11 after updating to 0.3.0 (wmic process command fails)

Open m1nuzz opened this issue 1 year ago • 13 comments

What happened?

After updating gemini-cli to 0.3.0 on Windows 11, the application crashes with the following error when starting a second time:

An unexpected critical error occurred:
Error: Command failed: wmic process where "ProcessId=47792" get Name,ParentProcessId,CommandLine /value
ERROR:
Description = The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at ChildProcess.exithandler (node:child_process:414:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

If I downgrade back to 0.22.0, the problem disappears completely.

What did you expect to happen?

I expected gemini-cli to run normally on Windows 11 after the update without throwing a wmic error.

Client information

Login information

Logging in with Google Account.

Anything else we need to know?

It seems the error is related to the use of wmic, which is deprecated/disabled by default on some versions of Windows 11. This might explain why the process command fails in 0.3.0 but not in 0.22.0:

m1nuzz avatar Sep 04 '25 18:09 m1nuzz

This is a critical bug on Windows 11 caused by the use of a deprecated wmic command, preventing the application from starting. This makes it an area/platform bug with priority/p1.

gemini-cli[bot] avatar Sep 04 '25 18:09 gemini-cli[bot]

Same issue here

YAYLOLDEV avatar Sep 04 '25 18:09 YAYLOLDEV

@skeshive, please backport #7087 to v3. You cannot wait v4 for this, Gemini CLI will be unusable for Windows users. This is not a feature, it's a critical bug.

dracic avatar Sep 04 '25 18:09 dracic

Yes can confirm this version is completely unusable on windows

jreoka avatar Sep 04 '25 18:09 jreoka

Getting same error, updated gemini-cli just now to v0.3.0.

An unexpected critical error occurred: Error: Command failed: wmic process where "ProcessId=14780" get Name,ParentProcessId,CommandLine /value 'wmic' is not recognized as an internal or external command, operable program or batch file.

at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:417:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)

arpankanwer avatar Sep 04 '25 19:09 arpankanwer

just when i thought this issue happens on my device only, didnt know its a global issue now

magdiemad5s avatar Sep 04 '25 19:09 magdiemad5s

How do you release an update without even a little testing?

corzel avatar Sep 04 '25 19:09 corzel

i just tested the nightly build and it seems to work fine for now as a temp solution(it worked for me at least) npm install -g @google/gemini-cli@nightly

magdiemad5s avatar Sep 04 '25 19:09 magdiemad5s

Oh my god. You introduce a PR with a bug, and then the bug is fixed in main with another PR. Then you release a stable version without a second PR, and then you are making a hotfix for a bug, that is already in main branch.

dracic avatar Sep 04 '25 19:09 dracic

#7076

dracic avatar Sep 04 '25 19:09 dracic

@skeshive what are you doing?

dracic avatar Sep 04 '25 19:09 dracic

In the nightly version, when launching gemini-cli through PowerShell, the following error now occurs:

[WARN] Skipping unreadable directory: C:\WINDOWS\system32\WebThreatDefSvc (EPERM: operation not permitted, scandir 'C:\WINDOWS\system32\WebThreatDefSvc')
An unexpected critical error occurred:
Error: Command failed: powershell "$p = Get-CimInstance Win32_Process -Filter 'ProcessId=49000' -ErrorAction SilentlyContinue; if ($p) { @{Name=$p.Name;ParentProcessId=$p.ParentProcessId;CommandLine=$p.CommandLine} | ConvertTo-Json }"

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at ChildProcess.exithandler (node:child_process:414:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)
⠹ Connecting to MCP servers... (0/2)

When running it through CMD, the program just enters an endless loading state.

m1nuzz avatar Sep 04 '25 19:09 m1nuzz

Stable version 0.3.2 fixed this npm install -g @google/gemini-cli

m1nuzz avatar Sep 05 '25 03:09 m1nuzz