Skip to content

Windows: Server fails to start when username contains spaces (EPIPE error) #2

@DaniMughal371

Description

@DaniMughal371

Bug Description

The CodeGraph Language Server fails to start on Windows when the
username contains spaces. The server binary path is not quoted,
causing Windows to split the path at the space.

Environment

  • OS: Windows 11
  • VS Code Version: (your version)
  • CodeGraph Extension Version: 0.14.0
  • Username path: C:\Users\Muhammad Daniyal\

Error Message

From the CodeGraph Language Server output panel:

'c:\Users\Muhammad' is not recognized as an internal or external command,
operable program or batch file.

[Error] Client CodeGraph Language Server: connection to server is erroring.
write EPIPE
[Error] Server initialization failed.
Message: write EPIPE
Code: -32099
[Error] The CodeGraph Language Server server crashed 5 times in the last
3 minutes. The server will not be restarted.

Root Cause

In extension.js, the function S_() resolves the binary path using
r.asAbsolutePath() which returns:

C:\Users\Muhammad Daniyal.vscode\extensions\astudioplus.codegraph-0.14.0\bin\codegraph-server-win32-x64.exe

When this path is passed to the shell without quotes, Windows treats
Muhammad as the command and Daniyal\... as a separate argument,
causing the EPIPE crash.

Proof

The binary works perfectly when called with quotes:

& "C:\Users\Muhammad Daniyal.vscode\extensions\astudioplus.codegraph-0.14.0\bin\codegraph-server-win32-x64.exe" --version
// Output: codegraph-server 0.14.0

Suggested Fix

In the server launch configuration, ensure the binary path is quoted:

// Current (broken)
command: a // unquoted path with spaces

// Fixed
command: "${a}" // quoted path

OR set shell: true with proper escaping:
options: { shell: true }
// and ensure the command string wraps the path in quotes

Impact

This affects ALL Windows users whose username contains a space,
which is extremely common (e.g. "John Doe", "Muhammad Daniyal").
The extension is completely non-functional for these users.

Workarounds Attempted

  • codegraph.serverPath setting — ignored by extension
  • Directory junction to no-space path — Windows resolves
    real path through junction, same error
  • --extensions-dir flag — ignored by extension
    None of these work because the path is hardcoded via
    r.asAbsolutePath() internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions