Reference for error codes and messages in CMN tools.

Hypha Errors

Pipeline Error Codes

These codes correspond to stages in the visitor resolution pipeline (sense/taste/spawn/grow/absorb). Each error is a strict AFDATA event with a trace.duration_ms field.

CodeStageCauseResolution
invalid_uriURI parseMalformed CMN URICheck URI syntax: cmn://domain/b3.<hash>
key_fetch_failedKey fetchcmn.json fetch or public key extraction failedCheck domain’s cmn.json, check network
cmn_failedcmn.jsoncmn.json endpoint extraction failedCheck domain’s cmn.json, check network
manifest_failedManifestMycelium or spore manifest fetch failedVerify URI, domain may have removed it
sig_failedVerificationEd25519 signature invalidContact publisher, possible tampering
hash_mismatchHash checkContent doesn’t match URI hashRe-fetch, possible corruption
spore_not_foundCatalogSpore not in mycelium catalogVerify hash, spore may have been removed
fetch_failedDownloadContent download (HTTPS/git) failedCheck network, try later

Command-Specific Error Codes

CodeCauseResolution
DIR_EXISTSTarget directory already existsRemove directory first
dir_errorDirectory creation failedCheck filesystem permissions
spawn_errorSpawn git/archive operation failedCheck git URL, disk space
grow_errorGrow local operation failedCheck git state, commit changes first
LOCAL_MODIFIEDLocal files modified since spawnMerge manually using cached old/new content paths shown in hint
NO_SPAWN_REMOTEGit repo has no spawn remote, cannot auto-updateMerge manually using cached old/new content paths shown in hint
GIT_URL_CHANGEDGit repository URL changed since spawnRe-spawn with new repository
REPO_IDENTITY_ERRRoot commit mismatchRepository was recreated, re-spawn
bond_errorBond operation failedCheck spore.core.json, disk space
bond_read_failedBond index could not be readCheck read permissions; delete a damaged .cmn/bonds/bonds.json and rerun bond to rebuild (historic directory names may change)
bond_index_invalidBond index is not valid JSON or has invalid entriesDelete .cmn/bonds/bonds.json and rerun bond to rebuild (historic directory names may change)
bond_write_failedBond index could not be saved atomicallyCheck permissions and disk space; symbolic-link targets are rejected
bond_clean_failedA bond directory could not be removed or inspectedFix the reported filesystem error and rerun; failed indexed deletions remain in the index
bond_relation_conflictA desired sync URI already belongs to another relationUse another URI or explicitly remove the existing bond; check and apply both exit 1 without writing
bond_spec_read_failedhatch bond sync couldn’t read --spec (file or stdin)Check the path exists and is readable, or that stdin is being piped
bond_spec_invalidhatch bond sync --spec is not valid JSON, or an entry is missing id or has an empty domainFix the spec: a JSON array of {id, domain?, reason?, with?, uri?} objects
bond_site_invalidhatch bond sync --site is not DOMAIN=PATH, names a domain twice, or overlaps --site-path; or --site-path was given without --domainPass one --site DOMAIN=PATH per domain, and give --site-path only together with --domain
missing_domainhatch bond sync needs a domain to resolve a spec entry’s uriPass --domain (and --site-path or --site for a non-default site), or give the entry a domain or an explicit uri
bond_uri_unresolvedhatch bond sync couldn’t resolve a spec entry’s uri: not deployed, and no sibling spore.core.json for the dry-run fallbackRelease the dependency first, or give the entry an explicit uri
absorb_errorAbsorb local operation failedCheck permissions, disk space
synapse_errorSynapse query failedCheck Synapse URL and network
NOT_TASTEDSpore has not been tastedRun hypha taste <uri>, review, record verdict
TOXICSpore tasted as toxicDo not proceed; choose an alternative

Publisher Error Codes

CodeCauseResolution
init_errorFailed to initialize siteCheck permissions
NO_SITESite directory not foundRun hypha mycelium root domain
NO_SPOREspore.core.json not foundRun hypha hatch first
validation_errorspore.core.json validation failedFix required fields
sign_errorFailed to sign manifestCheck private key
invalid_argsInvalid command argumentsCheck required flags
write_errorFailed to write fileCheck permissions

Runtime Diagnostic Codes

Non-fatal diagnostics are strict AFDATA log or progress events. With the default --output-to split routing they go to stderr; --output-to stdout or --output-to stderr can collapse all event kinds onto one ordered stream. Stable service log events use lowercase names such as startup, server_started, http_ok, http_forbidden, and http_not_found; generic library warnings use event: "warn".

Synapse Errors

API Errors

HTTPCodeMessageCause
400invalid_capsuleInvalid JSON or schemaFix the signed CMN document
400field_missingRequired query field absent or invalidCheck the endpoint’s query parameters
400cursor_invalidInvalid or overflowing search cursorUse the cursor returned by the previous result page
404not_foundResource not foundSpore/domain not indexed
422uri_invalidInvalid URI formatFix URI syntax
422hash_invalidContent hash mismatchVerify the signed document’s URI hash
422invalid_signatureSignature or signing key invalidVerify publisher identity and signature
502key_fetch_failedDomain identity could not be fetchedCheck the domain and retry
500internal_errorServer/storage errorReport to operator

Pulse-Specific Errors

CodeMessageCause
version_not_newerTimestamp is not newer than cachedHTTP 409; mycelium already has this or a newer version
timestamp_futureTimestamp too far aheadHTTP 422; check pulse.max_clock_skew_s or pulse.max_taste_clock_skew_s and system time
rate_limitedDomain notification received too recentlyHTTP 429; retry after the cooldown
cmn_fetch_failedLive domain entry could not be verifiedHTTP 502; check the deployed cmn.json

Storage Errors

CodeMessageCause
internal_errorStorage operation failedCheck server logs, database connectivity, and disk space

Codes are case-sensitive. Branch on the returned error.code; the tables list common errors rather than every rejection an endpoint can produce.

Error Response Format

Hypha CLI — Error

The nested error.code field contains the specific error code. Parse error.code to branch on error type:

{
  "kind": "error",
  "error": {
    "code": "sig_failed",
    "message": "Core signature verification failed: invalid signature",
    "retryable": false,
    "hint": "read the error field, check hypha --help for the expected input, and retry"
  },
  "trace": {
    "duration_ms": 0
  }
}
{
  "kind": "error",
  "error": {
    "code": "invalid_uri",
    "message": "URI must start with 'cmn://'",
    "retryable": false,
    "hint": "use a CMN URI in the form cmn://domain or cmn://domain/b3.hash"
  },
  "trace": {
    "duration_ms": 0
  }
}

Hypha CLI — Success with Trace

sense returns a trace field with resolution metadata (key fetch, caching, verification):

{
  "kind": "result",
  "result": { "spore": { "..." : "..." } },
  "trace": {
    "cmn_url": "cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2",
    "cmn": { "resolved": true, "cached": true, "public_key": "ed25519.5XmkQ9vZP8nL3xJdFtR7wNcA6sY2bKgU1eH9pXb4" },
    "verified": { "core_signature": true, "capsule_signature": true }
  }
}

Synapse API — Error

{
  "kind": "error",
  "error": {
    "code": "invalid_signature",
    "message": "Signature verification failed for domain cmn.dev",
    "retryable": false,
    "hint": "verify the signing key and signature before retrying"
  },
  "trace": {
    "storage": "redb"
  }
}

Synapse API — Success

Success responses include a result field with query data and a trace field with internal state:

{
  "kind": "result",
  "result": {
    "query": { "hash": "b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2", "direction": "inbound", "max_depth": 10 },
    "bonds": [],
    "total": 0,
    "max_depth_reached": false
  },
  "trace": {
    "storage": "redb"
  }
}

Synapse Access Log

Every request produces a protocol-v1 log event. Request fields and optional result/error data live under log; trace merges request metadata with handler-level state.

JSON format (log_format: json):

{
  "kind": "log",
  "log": {
    "method": "GET",
    "path": "/synapse/spore/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2",
    "status_code": 404,
    "error": {
      "code": "not_found",
      "message": "Spore not found",
      "retryable": false,
      "hint": "verify the domain/hash and wait for indexing before retrying"
    }
  },
  "trace": {
    "duration_ms": 1
  }
}

Plain format (log_format: plain):

kind=log log.error.code=not_found log.error.message="Spore not found" log.error.retryable=false log.method=GET log.path=/synapse/spore/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2 log.status_code=404 trace.duration=1ms

The plain format is generated from the same JSON value using agent_first_data::output_plain (logfmt-style key/value output).

Exit Codes

Hypha CLI exit codes:

CodeMeaning
0Success
1Domain or runtime failure; inspect error.code for network, verification, Git, or permission errors
2Structural CLI rejection before the action runs
4Output or stream redirection failure
7hatch bond sync --check found drift (structured diff on stdout); pure order or group-position changes report reordered=true with empty to_add/to_update/to_remove lists. Conflicts remain general errors (1).

Debugging

Structured Startup Diagnostics

hypha --log startup taste cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Capture One Ordered Event Stream

hypha --output-to stdout --log startup taste cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Startup diagnostics include parsed arguments, redacted configuration, and environment metadata. Use --help for the supported output and log selectors.

Common Issues

“Key fetch failed”

  1. Verify https://yourdomain.com/.well-known/cmn.json is accessible
  2. Check that the primary capsule in cmn.json contains a valid key field
  3. Ensure HTTPS is properly configured on the domain

“Signature verification failed”

  1. Verify you’re fetching the correct URI
  2. Check if publisher updated their public key in cmn.json
  3. Try fetching from Synapse mirror if available

“Hash mismatch”

  1. Inspect hypha cache list; if all cached content can be discarded, run hypha cache clean --all
  2. Re-fetch the spore
  3. Report to publisher if issue persists

“Local files modified” during grow

Grow detected local changes and refused to overwrite. The error hint shows:

Compare the two with diff -r <old>/content/ <new>/content/ and apply changes manually.