Written by Gemini 3.1 pro:
Description
Running pituitary index --rebuild on Windows fails consistently with a sqlite3: unable to open database file error during the Stroma staging index creation phase.
The issue appears to be related to how the internal Go SQLite driver parses or constructs paths on Windows (likely an issue with URI connection strings and Windows drive letters like C:), as the target directories exist, are fully writable, and have no permission issues.
Steps to Reproduce
- Initialize a repository on a Windows machine.
- Ensure a valid pituitary.toml is present (either via pituitary init or manually created).
- Run the indexing command:
1 pituitary index --rebuild
Expected Behavior
The index rebuilds successfully and creates the .pituitary/pituitary.db SQLite file.
Actual Behavior
The chunking and embedding phases complete, but the process fails when attempting to open the staging index:
1 pituitary index: chunking 9/9 doc doc://README (10 chunk(s))
2 pituitary index: embedding 9/9 doc doc://README (10 chunk(s))
3 pituitary index: rebuild failed:
4 build stroma snapshot: open staging index: enable foreign keys: sqlite3: unable to open database file
Environment
- OS: Windows (win32)
- Pituitary Version: 1.0.0-beta.12
- Go Version: go1.25.10
- Commit: 9504834
Additional Context / Troubleshooting Performed
To rule out local environmental issues, we systematically tested the following index_path configurations in
pituitary.toml, all of which failed:
- Default relative path: .pituitary/pituitary.db (Directory manually created and confirmed writable).
- Absolute Windows path: C:\Users....pituitary\pituitary.db
- Short root path: C:\temp\pituitary.db (To rule out path length or user-profile permission issues).
- In-memory: :memory: (This yielded a different path parsing error: The filename, directory name, or volume label syntax is incorrect.).
- URI format: file:///C:/temp/pituitary.db
The fact that the error occurs specifically during build stroma snapshot: open staging index suggests that the code constructing the temporary/staging database path might be prefixing a URI scheme (file:) to a Windows absolute path (C:...), causing the underlying SQLite driver to interpret the drive letter as an invalid URI scheme.
Written by Gemini 3.1 pro:
Description
Running pituitary index --rebuild on Windows fails consistently with a sqlite3: unable to open database file error during the Stroma staging index creation phase.
The issue appears to be related to how the internal Go SQLite driver parses or constructs paths on Windows (likely an issue with URI connection strings and Windows drive letters like C:), as the target directories exist, are fully writable, and have no permission issues.
Steps to Reproduce
1 pituitary index --rebuild
Expected Behavior
The index rebuilds successfully and creates the .pituitary/pituitary.db SQLite file.
Actual Behavior
The chunking and embedding phases complete, but the process fails when attempting to open the staging index:
1 pituitary index: chunking 9/9 doc doc://README (10 chunk(s))
2 pituitary index: embedding 9/9 doc doc://README (10 chunk(s))
3 pituitary index: rebuild failed:
4 build stroma snapshot: open staging index: enable foreign keys: sqlite3: unable to open database file
Environment
Additional Context / Troubleshooting Performed
To rule out local environmental issues, we systematically tested the following index_path configurations in
pituitary.toml, all of which failed:
The fact that the error occurs specifically during build stroma snapshot: open staging index suggests that the code constructing the temporary/staging database path might be prefixing a URI scheme (file:) to a Windows absolute path (C:...), causing the underlying SQLite driver to interpret the drive letter as an invalid URI scheme.