Troubleshooting
Find the message you saw, then follow the fix. Each message is real output from a run of the engine. Commands that stop with a problem exit with status 2 when you gave the engine a bad input, and with status 1 when a run failed. The command reference lists the exit statuses.
Starting the engine
Section titled “Starting the engine”engineering-corpus v0.1 is not out yet
Section titled “engineering-corpus v0.1 is not out yet”You ran uvx engineering-corpus demo and got one line instead of the demo:
engineering-corpus v0.1 is not out yet. The date and the project: https://engineeringcorpus.comYour Python is older than 3.11. The package needs 3.11 or newer, so uv cannot use it and takes the placeholder release 0.0.1, which prints this line and nothing else. Once the placeholder is withdrawn, uv stops instead with No solution found when resolving tool dependencies and says that the package requires Python >=3.11. The cause is the same.
Ask uv for a newer Python. It uses one it finds and downloads one if it finds none:
uvx --python 3.12 engineering-corpus demopython3 --version shows the Python your shell finds first.
The command your agent starts has the same problem. A client runs uvx engineering-corpus serve, uv finds the same old Python, the server exits at once, and claude mcp list shows Failed to connect. Add the flag to that command too:
claude mcp add engineering-corpus -- uvx --python 3.12 engineering-corpus serveCursor and VS Code take the flag as the first two entries of args: ["--python", "3.12", "engineering-corpus", "serve"]. The plugins start uvx themselves, so no flag can be added to their command: install Python 3.11 or newer for them.
corpus: index format: ...
Section titled “corpus: index format: ...”Every command compares the data folder’s format.json with the running engine, and this message means they do not match.
The command exits with status 1 and changes nothing. There are three causes, and each message names its fix. Paths are
shortened.
The folder has a newer format than your engine reads:
corpus: index format: this data folder has index format 2, newer than the 1 this engine reads, so it is left alone: update engineering-corpus (for example `uvx engineering-corpus@latest`), or use another --data-dirUpdate the engine, or point --data-dir at another folder.
The index was built with another embedding model:
corpus: index format: the index here was built with the embedding `Other/embedding-model@0123abcd max 512 tokens, pipeline 1 (768 dimensions)` and this engine embeds with `Teradata/granite-embedding-english-r2@cb87d70caafcbb4b13471cee19238c50d2548a7f/onnx/model-fp32.onnx max 1024 tokens, pipeline 1 (768 dimensions)`, so its vectors cannot be searched correctly: re-embed it with `corpus index <your slice config> --rebuild --data-dir other-embedding-copy` (the clones stay; every chunk is embedded again)Run the command it prints, with your own slice config. --rebuild drops the whole index and embeds again only the repos in
that file. The clones stay.
format.json cannot be read:
corpus: index format: damaged-copy/format.json: key must be a string at line 1 column 2: delete that file to have the engine check the index again, or re-embed with `corpus index <your slice config> --rebuild`Delete the file, and the engine checks the index again and writes a new one when the vectors match. Or rebuild. The configuration reference lists every case.
secret scanning needs Betterleaks 1.x, but "betterleaks" is not on PATH: ...
Section titled “secret scanning needs Betterleaks 1.x, but "betterleaks" is not on PATH: ...”corpus index and corpus chunks scan every repo for secrets before they embed anything, and the scanner is not where the
engine looks. This run set BETTERLEAKS=/nonexistent, so the name in the message is that path. Each repo fails with the same
message and the command exits with status 1:
indexing github.com/pallets/itsdangerous (1/2)...failed github.com/pallets/itsdangerous: secret scanning needs Betterleaks 1.x, but "/nonexistent" is not on PATH: install it (brew install betterleaks), set BETTERLEAKS to its path, or pass --allow-unscanned for a private experimentInstall Betterleaks (brew install betterleaks), or set BETTERLEAKS to its path. --allow-unscanned skips the scan. Use it
only for experiments, and never for an index you share or serve. corpus demo needs no Betterleaks, because the demo’s
repos were scanned when they were pinned.
corpus: no repos are indexed in ...
Section titled “corpus: no repos are indexed in ...”corpus search found nothing to search: the data folder it looked in holds no indexed repo. Either you gave no --data-dir and your own
data folder is empty (the demo keeps its index in its own folder), or you named a folder that has no index. The command loads no model,
creates no folder and exits with status 1. Paths are shortened:
$ corpus search 'verify an HMAC signature'corpus: no repos are indexed in ~/.local/share/engineering-corpus. Index some with `corpus index CONFIG`, or run `corpus demo` and search its folder: `corpus search QUERY --data-dir ~/.cache/engineering-corpus/demo`To search the demo’s index, give the search the demo’s folder:
corpus search 'verify an HMAC signature' --data-dir ~/.cache/engineering-corpus/demoTo search your own repos, index them first with corpus index. Index your stars walks through it.
Inside the Docker image the message names docker run commands for the volume’s folder /data/demo instead:
corpus: no repos are indexed in /data. Run the demo, then search its folder: `docker run -it --rm -v corpus:/data ghcr.io/ymcbzrgn/engineering-corpus demo --data-dir /data/demo`, then `docker run --rm -v corpus:/data ghcr.io/ymcbzrgn/engineering-corpus search QUERY --data-dir /data/demo`To index your own repos in the image, see HTTP and Docker.
Writing your stars file
Section titled “Writing your stars file”corpus: stars.toml exists, and may hold your edits; pass --force to write it again (its exclude_owners stay)
Section titled “corpus: stars.toml exists, and may hold your edits; pass --force to write it again (its exclude_owners stay)”corpus stars found a file at the path and will not overwrite your edits. The command exits with status 2.
Pass --force to write the file again, or choose another path with --out. With --force the exclude_owners of the old
file stay.
corpus: nofolder does not exist; make it with `mkdir -p nofolder`, or give --out a folder that exists
Section titled “corpus: nofolder does not exist; make it with `mkdir -p nofolder`, or give --out a folder that exists”The folder in --out is missing. The command checks this before it asks GitHub for anything, and the message prints the
mkdir -p command that makes the folder. Run it, or write to a folder that exists.
corpus: GH_TOKEN holds characters a token cannot have; fix it, or run `unset GH_TOKEN` to ask GitHub without a token (it allows fewer requests an hour)
Section titled “corpus: GH_TOKEN holds characters a token cannot have; fix it, or run `unset GH_TOKEN` to ask GitHub without a token (it allows fewer requests an hour)”GH_TOKEN, or GITHUB_TOKEN when GH_TOKEN is not set, holds a space or another character that a GitHub token never
holds. The engine refuses to send it and does not print its value. The message names the variable that is wrong. Fix the
variable, or run the unset command it shows to use GitHub without a token, which has a lower hourly limit.
corpus: exclude_owners entry 'İ': GitHub names use only ASCII letters, digits and hyphens, at most 39; write the owner as it appears in github.com/<owner>, or the start of it
Section titled “corpus: exclude_owners entry 'İ': GitHub names use only ASCII letters, digits and hyphens, at most 39; write the owner as it appears in github.com/<owner>, or the start of it”An --exclude-owner value, or an exclude_owners entry in the file, cannot start any GitHub name. The engine refuses it
instead of keeping a filter that matches nothing. Write the owner as it appears in github.com/<owner>, or the start of it.
Indexing and removing
Section titled “Indexing and removing”corpus: not registered: github.com/Pallets/ItsDangerous (did you mean github.com/pallets/itsdangerous ...)
Section titled “corpus: not registered: github.com/Pallets/ItsDangerous (did you mean github.com/pallets/itsdangerous ...)”corpus remove found a name that the registry does not hold, and removed nothing. The command exits with status 2. Names are
the canonical ids that corpus search --repo takes: github.com/owner/name, in lowercase. The message says what to do next,
in one of these forms:
$ corpus remove github.com/Pallets/ItsDangerouscorpus: not registered: github.com/Pallets/ItsDangerous (did you mean github.com/pallets/itsdangerous for github.com/Pallets/ItsDangerous?)
$ corpus remove github.com/acme-corp/toolcorpus: not registered: github.com/acme-corp/tool; registered: github.com/burntsushi/walkdir, github.com/danielstjules/buddy.js, github.com/iphelix/pack, github.com/pallets/itsdangerous
$ corpus remove github.com/acme-corp/toolcorpus: not registered: github.com/acme-corp/tool; 9 repos are registered, and the corpus_repos tool lists them
$ corpus remove github.com/acme-corp/toolcorpus: not registered: github.com/acme-corp/tool; nothing is registered yet: run `corpus index <slice config>`- When a registered id is close to the name you gave, or the name differs only in capitals, the message names that id.
A close misspelling gets the same hint:
github.com/pallets/itsdangergetsdid you mean github.com/pallets/itsdangerous. - Otherwise it lists the registered ids when there are at most 8. With 9 or more it gives the count, and the
corpus_repostool lists them. - With an empty registry it tells you to run
corpus index.
The first two runs used a registry with the demo’s four repos. The third used a copy with five more repos added, and the fourth an empty data folder.
corpus: typo.toml: repos[1]: unknown keys ['commmit'] (did you mean 'commit' for 'commmit'?)
Section titled “corpus: typo.toml: repos[1]: unknown keys ['commmit'] (did you mean 'commit' for 'commmit'?)”The slice config holds a key the engine does not know, here commmit with three m’s. The path in the message is the file you
passed to corpus index; the run here used typo.toml. The command exits with status 2 before it
clones or embeds anything. The message names the entry (repos[1] is the first [[repos]] block) and, when the key is
close to a known one, the key you probably meant. Fix the spelling. The key for a license is licence, so license stops
the command too. The configuration reference lists the keys.
Connecting a client
Section titled “Connecting a client”✘ Failed to connect — ENOENT: no such file or directory, posix_spawn '/nonexistent/corpus'
Section titled “✘ Failed to connect — ENOENT: no such file or directory, posix_spawn '/nonexistent/corpus'”Claude Code ran claude mcp list and could not start the command you registered. This run registered a path that does not
exist; yours is probably a uvx or corpus that your client cannot find, because a client started from the desktop does not
read your shell’s PATH.
Use the full path of the command in claude mcp add, or run claude mcp get NAME to see the command Claude Code runs. The
connect guide shows the commands for each way to run the server.
corpus: --host '0.0.0.0' is not a loopback address, and the HTTP server has no authentication, so it would answer anyone who can reach it. ...
Section titled “corpus: --host '0.0.0.0' is not a loopback address, and the HTTP server has no authentication, so it would answer anyone who can reach it. ...”corpus serve --http refuses a --host that is not a loopback address, and exits with status 2. Use the default,
127.0.0.1. If a proxy with authentication sits in front, or the container’s port is published on localhost only, pass
--allow-remote-bind. The HTTP and Docker guide explains both.
corpus serve: error: argument --port: port must be between 1 and 65535, not 70000
Section titled “corpus serve: error: argument --port: port must be between 1 and 65535, not 70000”The port is out of range. Use a port from 1 to 65535.
Invalid Host header 'mcp.example.org:8443': this server answers localhost, 127.0.0.1 and [::1] only. ... with status 421, or Invalid Origin header with status 403
Section titled “Invalid Host header 'mcp.example.org:8443': this server answers localhost, 127.0.0.1 and [::1] only. ... with status 421, or Invalid Origin header with status 403”The HTTP server answers only the names localhost, 127.0.0.1 and [::1], and each name you added with --allowed-host.
It refused a request whose Host is another name (421) or whose Origin is another page (403). This is the protection against
a web page that pretends to be local. The message names the value the server got and the exact flag that would let it in:
Invalid Host header 'mcp.example.org:8443': this server answers localhost, 127.0.0.1 and [::1] only. To allow this name, start it with `corpus serve --http --allowed-host mcp.example.org:8443`.HTTP 421
Invalid Origin header 'https://page.example:8080': this server answers localhost, 127.0.0.1 and [::1] only. To allow a page served from it, start it with `corpus serve --http --allowed-host page.example:8080`.HTTP 403A client on your computer sends a local Host, so a 421 usually means a proxy, a container or another computer reached the
server under a name it does not know. Start the server again with the flag the message shows, once for each name. The
HTTP and Docker guide shows the runs, and the security model shows the
refusals.
Request body too large with status 413
Section titled “Request body too large with status 413”The HTTP server refuses a request body over 128 KiB, before it parses it. A call whose query held 140,000 characters, in a
body of 140,117 bytes, got:
Request body too largeHTTP 413Send a shorter request. The limit for each argument is in the Limits column of the tools reference.
Hooks that print nothing
Section titled “Hooks that print nothing”A hook prints nothing in these cases, and it never blocks your work:
- The data folder it is given has no
models/folder with the embedding model in it, or noindex/. A hook never builds an index or downloads the embedding model. - No hit is close enough: the prior-art hook speaks only for a hit with a similarity of at least 0.86, and the provenance hook only when at least half of the block’s distinctive lines match.
- It already spoke for that text, or it spoke three times in the session.
- It is the
writehook, which is off by default. SetENGINEERING_CORPUS_WRITE_HOOKtoonto turn it on. ENGINEERING_CORPUS_HOOKSis set tooff,0,falseorno. That silences thewritehook too.
Run corpus hook write or corpus hook prompt yourself on a sample, as the agent pack guide shows, to
see which case you are in.
A hook also prints nothing when it fails, and the failure stays hidden. Set ENGINEERING_CORPUS_HOOKS_DEBUG to any value to
make it print the exception on standard error. With input that is not JSON:
$ echo 'not json' | ENGINEERING_CORPUS_HOOKS_DEBUG=1 corpus hook writeengineering-corpus hook: JSONDecodeError('Expecting value: line 1 column 1 (char 0)')The same input without the variable prints nothing, and both runs exit with status 0. The variable shows an error. It does not explain the cases in the list, where nothing failed.
Empty and weak results
Section titled “Empty and weak results”These answers are real calls to corpus serve --http on a copy of a data folder with four small repos
indexed. Each call is a POST to the server’s /mcp URL with the headers Content-Type: application/json and
Accept: application/json, text/event-stream. The notice field is left out, and each hit shows only its repo, path, lines
and score.
"status": "not_indexed"
Section titled “"status": "not_indexed"”You asked corpus_search to look only in repos the index does not hold, so nothing was searched. The request named
github.com/nobody/nothing:
{"status": "not_indexed", "coverage": {"repos_searched": 0, "repos_matched": 0}, "not_indexed": ["github.com/nobody/nothing"], "hits": []}Check the repo name with the corpus_repos tool. A repo id is github.com/owner/name in lowercase. If the repo is yours to
add, put it in your slice config and run corpus index. The server answers the call as a success, and the status is the
signal.
"status": "no_strong_match"
Section titled “"status": "no_strong_match"”Hits came back, and none of them is close to the query. Your agent should treat them as weak leads. What counts as close is a line the engine sets from your index, and the glossary gives the rule. A query of nonsense words returned this, with hits whose scores sit near 1.0 and mean little:
{"query": "qzxv wlorp frumbulate the ploxitor", "status": "no_strong_match", "coverage": {"repos_searched": 4, "repos_matched": 4}, "not_indexed": [], "hits": [{"repo": "github.com/burntsushi/walkdir", "path": "src/lib.rs", "start_line": 901, "end_line": 960, "score": 1.027}, {"repo": "github.com/burntsushi/walkdir", "path": "src/error.rs", "start_line": 51, "end_line": 110, "score": 1.0197}, {"repo": "github.com/iphelix/pack", "path": "README", "start_line": 251, "end_line": 310, "score": 1.017}]}Rewrite the query with the names or behaviour you expect in the code, in English. If the repo that should answer is not in
your index, no wording will find it: check with corpus_repos. corpus_compare and corpus_explore answer with this status
and no approaches or options when no repo comes close enough to the problem.
repo not indexed: github.com/nobody/nothing; corpus_repos lists the indexed repos
Section titled “repo not indexed: github.com/nobody/nothing; corpus_repos lists the indexed repos”corpus_read and corpus_grep take one repo and fail when the index does not hold it. The server answers with HTTP status 200
and "isError": true:
{"content": [{"type": "text", "text": "Error executing tool corpus_read: repo not indexed: github.com/nobody/nothing; corpus_repos lists the indexed repos"}], "isError": true}List the indexed repos with corpus_repos, and use a name from that list.
invalid repo id: 'pallets/itsdangerous'; expected github.com/<owner>/<name>, lowercase; did you mean 'github.com/pallets/itsdangerous'?
Section titled “invalid repo id: 'pallets/itsdangerous'; expected github.com/<owner>/<name>, lowercase; did you mean 'github.com/pallets/itsdangerous'?”A repo id for corpus_read, corpus_grep and the other tools that take a repo has the form github.com/owner/name, in
lowercase. pallets/itsdangerous leaves out the host. The message ends with the id the server thinks you meant:
{"content": [{"type": "text", "text": "Error executing tool corpus_read: invalid repo id: 'pallets/itsdangerous'; expected github.com/<owner>/<name>, lowercase; did you mean 'github.com/pallets/itsdangerous'?"}], "isError": true}The hint appears only when the server can read the id. It reads owner/name, a GitHub URL (with www, a .git ending, a
branch path or capitals) and an id in capitals, and all of them give github.com/pallets/itsdangerous here. A bare name such
as itsdangerous has no reading, so the message gives the form and no guess:
{"content": [{"type": "text", "text": "Error executing tool corpus_read: invalid repo id: 'itsdangerous'; expected github.com/<owner>/<name>, lowercase"}], "isError": true}Write the id as the hint shows it, or as github.com/owner/name in lowercase.
String should have at most 4000 characters
Section titled “String should have at most 4000 characters”A text argument is longer than its limit. The server refuses the call before it searches, and the error names the argument and
the limit. This call sent a query of 4,001 characters:
{"content": [{"type": "text", "text": "Error executing tool corpus_search: 1 validation error for corpus_searchArguments\nquery\n String should have at most 4000 characters [type=string_too_long, input_value='aaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaa', input_type=str]\n For further information visit https://errors.pydantic.dev/2.14/v/string_too_long"}], "isError": true}Shorten the value. The Limits column of the tools reference gives the limit of each argument: 4,000
characters for query and problem, at most 100 ids of 151 characters for repos, 4,096 for a path, 1,000 for a
corpus_grep pattern and 2,000,000 for a line number.
My Turkish query finds little
Section titled “My Turkish query finds little”The engine and its models are English only. In a test index of four small repos, the Turkish question
bir imzayı HMAC ile doğrula and its English form verify an HMAC signature both came back as ok, and the right file,
src/itsdangerous/signer.py, was the first hit for both, with scores of 1.1665 and 1.1912. The line for no_strong_match follows the index and sits lower on a small one, so a weak
query can come back ok there. One query shows little: the corpus and the embedding model are English, so a query in another language can match worse. Ask your agent to translate the query into English before it searches. The
instructions the server gives agents say so.