Skip to content

Pipeline fails during 'dump' phase if UserProfile path contains non-ASCII characters #996

Closed

Description

@meszkee

Version

codebase-memory-mcp --0.9.0

Platform

Windows (x64)

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

Describe the bug

When running index_repository on Windows, the pipeline consistently fails during the dump phase. This happens because my Windows user profile path contains non-ASCII characters (for example: C:\Users\Kovács János).
The SQLite/storage engine seems to fail when attempting to write the graph.db artifact to ~/.codebase-memory due to character encoding issues with accented letters in the path.

Expected behavior

The server should properly handle UTF-8/non-ASCII characters in Windows file paths when resolving the cache or storage directories.

Reproduction

  1. Use a Windows machine where the USERPROFILE path contains non-ASCII characters (e.g. C:\Users\Kovács János).

  2. Install the MCP server using the official PowerShell installer.

  3. Run the index_repository MCP tool on any project.

  4. The extraction and resolution phases complete successfully.

  5. It crashes exactly at the end with level=error msg=pipeline.err phase=dump.

  6. The code being indexed:
    This is not related to the codebase itself. Any standard project (e.g. an empty Laravel or Node.js project) will trigger this if the Windows USERPROFILE path contains non-ASCII characters (e.g. C:\Users\Kovács János).

  7. The exact command or MCP tool call:
    Via MCP tool call (index_repository):

{
  "repo_path": "c:\\xampp\\htdocs\\myproject",
  "mode": "fast"
}

### Logs

```text
level=error msg=pipeline.err phase=dump
{"project":"C-xampp-htdocs-myproject","status":"error","hint":"Pipeline failed. Check repo_path exists and contains source files. Try mode='fast' for a quicker diagnostic run."}

Diagnostics trajectory (memory / performance / leak issues)


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. added
    editor/integrationEditor compatibility and CLI integration
    parsing/qualityGraph extraction bugs, false positives, missing edges
    stability/performanceServer crashes, OOM, hangs, high CPU/memory
    windowsWindows-specific issues
    on Jul 10, 2026
  2. added
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 10, 2026
  3. added this to the 0.9.1-rc milestone on Jul 10, 2026
  4. DeusData commented on Jul 10, 2026

    @DeusData
    Owner

    Thanks for reporting this. I have triaged it into 0.9.1-rc as a high-priority Windows/non-ASCII path stability issue. It looks related to the broader non-ASCII path class, but I am keeping this issue separate until the exact failing path is confirmed. If you have the full stderr or pipeline dump failure line, that would help us verify the fix against the right layer.

  5. DeusData commented on Jul 12, 2026

    @DeusData
    Owner

    Fixed on main by d9adfeb + faf5160 (merged in 8f3ee08, PR #1058), shipping in v0.9.1 — and it took two layers, which the new Windows guard proved empirically:

    1. The dump writer (cbm_writer_open) used a raw ANSI-code-page fopen — the one file-creating call on the dump chain without UTF-8→wide conversion (the hand-rolled SQLite writer bypasses SQLite's own filename handling). That alone produced your exact pipeline.err phase=dump: extract/resolve fine, mkdir (already wide) fine, then graph.db creation fails under the profile-derived cache dir.
    2. Environment reads: with (1) fixed, the guard still failed on the Windows CI leg — because _environ holds ANSI-code-page bytes, a non-ASCII USERPROFILE (or CBM_CACHE_DIR) arrives mojibake'd or with unrepresentable characters replaced by ?, which is invalid in Windows paths, so every downstream wide-safe file API fails no matter how correct it is. cbm_safe_getenv now reads values via GetEnvironmentVariableW and converts to genuine UTF-8.

    The regression guard (test_non_ascii_cache_dump.py) indexes into a mixed Latin-1/Greek/CJK cache dir and requires a real query readback from the reopened DB — it now runs green on the Windows CI leg, which is as close to your C:\Users\Kovács János setup as CI gets. A retest on v0.9.1 with your actual profile would still be welcome confirmation.

  6. added a commit that references this issue on Jul 12, 2026
    d9adfeb
  7. added 3 commits that reference this issue on Jul 15, 2026
    c679b08
    bba2310
    5eeb126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationparsing/qualityGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memorywindowsWindows-specific issues

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions