In the KNIRVSERVER, getting the following error in the knirvhasher data pipeline when I…
- User
In the KNIRVSERVER, getting the following error in the knirvhasher data pipeline when I click on the train button: 05:08:36 PM error [17:08:36] [data-miner] ⚠️ Failed to initialize NLP Bridge: failed to initialize Spacy with model: en_core_web_sm [17:08:36] [data-miner] 🌐 Fetching GOAT dataset from: https://datasets-server.huggingface.co/rows?dataset=stallone%2Fgoat&config=completion&split=train&offset=0&length=100 05:08:36 PM error [17:08:36] [data-miner] [stderr] ModuleNotFoundError: No module named 'spacy' 05:08:36 PM info [17:08:36] [data-miner] 🐐 Starting GOAT Mining Phase (Hugging Face) [17:08:36] [data-miner]
- Assistant
Summary
Root cause: 3 issues causing
ModuleNotFoundError: No module named 'spacy':-
spacy_wrapper.cpp:558— Python path setup only added a hardcoded.venv/lib/python3.12/site-packagespath, not the actual user site-packages where spaCy is installed (~/.local/lib/python3.10/site-packages). WhenPy_Initialize()initialized the embedded Python interpreter, user site-packages weren't included. -
controller.go:556— When spawning the data-miner subprocess,LD_LIBRARY_PATHwas set butPYTHONPATHwas not, leaving the embedded Python interpreter unable to find user-installed packages.
-
- User
[17:51:53] [data-encoder] [stderr] 2026/05/19 17:51:53 📁 Input file type: ai_knowledge_base.json (json) 2026/05/19 17:51:53 Pipeline error: data-encoder failed: exit status 1 [GIN] 2026/05/19 - 17:51:55 | 200 | 506.425µs | ::1 | G
- Assistant
The data-encoder stage is failing after my fix. Let me look into this.
- Assistant
Permission denied creating
/var/lib/knirvserver/hasher/data/frames/. Let me check and fix. - Assistant
Permission issue —
/var/lib/knirvserver/hasher/data/frames/must exist and be writable by the user running the pipeline. - Assistant
The pipeline fails because
/var/lib/knirvserver/hasher/data/is owned byrootand the data-encoder can't create itsframes/output directory. Run:bashsudo mkdir -p /var/lib/knirvserver/hasher/data/frames sudo chown $USER:$USER /var/lib/knirvserver/hasher/data/framesThen try the train button again. Alternatively, set
KNIRV_APP_DATA_DIRto a user-writable path before starting the server. - User
Can't you set the knirvhasher-cli so that it passes the sudo when it calls the data_encoder binary at runtime?
- Assistant
No, running automated sudo from a pipeline is a security anti-pattern. The right fix is to make
getAppDataDir()check writability and fall back to a user-owned path. - Assistant
- Assistant
Data-encoder works. Now rebuild the CLI and update the embedded binary for the server.
- Assistant
The data-encoder build ignores
BIN_DIR, so the embedded copy is stale. Let me fix that. - Assistant
Now let me fix the root cause in the Makefile so
build-pipeline-allproperly copies the data-encoder to the embed dir, and restart the server. - Assistant
Server isn't running, no restart needed. Next launch will use the fixed embedded binary.
What was done:
-
Root cause —
getAppDataDir()returned/var/lib/knirvserver/hasher/data/(root-owned) becauseMkdirAllsucceeded on the existing dir, but creatingframes/subdirectory failed with EACCES. -
Fix in
packages/KNIRVHASHER/pipeline/2_DATA_ENCODER/cmd/data-encoder/main.go:73-100— ChangedgetAppDataDir()to verify writability by attemptingos.MkdirAll(..., "frames")inside each candidate dir before accepting it. Falls through to~/.local/share/knirvserver/hasher/data/when the system location isn't writable. -
Makefile fix —
build-data-encoderignored theBIN_DIRparam and only built to its localbin/data-encoder. Added explicitcpto the embed dir. -
Re-built all pipeline binaries, CLI, and compressed the embedded binary at
pkg/knirvhasher/bin/knirvhasher.
-