Error Codes

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 includes a trace field in the final JSON event showing how far the operation progressed before failure.

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 spawn (archive grow)git init && commit or --discard-local-changes
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
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 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 diagnostic events emitted during operations. These use the same Agent-First Data protocol structure and are written to the runtime stdout event stream.

CodeContextMeaning
CACHE_WARNcapsule/mycelium cacheCache write failed (operation continues)
DOWNLOAD_FAILEDtaste/absorbHTTPS download failed, trying next dist source
CLONE_FAILEDtaste/absorbGit clone failed, trying next dist source
TASTE_DEPtaste –with-depsFetching a dependency
UPDATE_WARNspawn/growFailed to update spore.core.json after spawn/pull
SAVE_WARNspawnFailed to save spawn info
RESTORE_WARNgrowFailed to restore spore.core.json after pull
ABSORB_DISCOVERabsorb –lineageNumber of sources discovered from lineage
ABSORB_FETCHabsorbFetching a source for absorption
SIG_VERIFIEDabsorbSignature verification succeeded
HTTP_OKmycelium serveSuccessful HTTP request
HTTP_ERRORmycelium serveHTTP 500 response
HTTP_NOT_FOUNDmycelium serveHTTP 404 response

Synapse Errors

API Errors

HTTPCodeMessageCause
400INVALID_PROTOCOLInvalid protocol versionProtocol not cmn/1
400INVALID_REQUESTMalformed request bodyFix request JSON
401SIGNATURE_INVALIDSignature verification failedInvalid signature
404NOT_FOUNDResource not foundSpore/domain not indexed
422INVALID_URIInvalid URI formatFix URI syntax
500INTERNAL_ERRORServer errorReport to operator

Pulse-Specific Errors

CodeMessageCause
VERSION_TOO_OLDTimestamp older than cachedMycelium already has newer version
VERSION_CONFLICTSame timestamp, different hashConflicting updates detected
TIMESTAMP_TOO_FAR_IN_FUTURETimestamp too far aheadClock skew exceeds pulse.max_clock_skew (default 300s), check system time

Storage Errors

CodeMessageCause
DB_CONNECTION_FAILEDDatabase unreachableCheck PostgreSQL connection
DB_QUERY_FAILEDQuery execution errorDatabase issue
STORAGE_FULLStorage limit reachedIncrease storage capacity

Error Response Format

Hypha CLI — Error

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

{
  "code": "SIG_FAILED",
  "error": "Core signature verification failed: invalid signature",
  "trace": {
    "duration_ms": 0
  }
}
{
  "code": "invalid_uri",
  "error": "URI must start with 'cmn://'",
  "trace": {
    "duration_ms": 0
  }
}

Hypha CLI — Success with Trace

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

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

Synapse API — Error

{
  "code": "error",
  "error": "Signature verification failed for domain cmn.dev",
  "trace": {
    "error_code": "SIGNATURE_INVALID",
    "storage": "redb"
  }
}

Synapse API — Success

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

{
  "code": "ok",
  "result": {
    "query": { "hash": "b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2", "max_depth": 10 },
    "lineage": []
  },
  "trace": {
    "max_depth_reached": false,
    "storage": "redb"
  }
}

Synapse Access Log

Every request produces a single access log line using Agent-First Data fields at the top level (code, request fields, optional result/error, and trace). The trace field merges request metadata with handler-level state.

JSON format (log_format: json):

{
  "code": "request",
  "method": "GET",
  "path": "/synapse/spore/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2",
  "status_code": 404,
  "error": "Spore not found",
  "trace": {
    "duration_ms": 1,
    "error_code": "NOT_FOUND"
  }
}

Plain format (log_format: plain):

code=request method=GET path=/synapse/spore/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2 status_code=404 error="Spore not found" trace.duration=1ms trace.error_code=NOT_FOUND

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
1General error
2Invalid arguments
3Network error
4Verification failed
5Git operation failed
6Permission denied

Debugging

Verbose Output

hypha --verbose taste cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Debug Logging

RUST_LOG=debug hypha taste cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Trace Logging

RUST_LOG=trace hypha taste cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Common Issues

“Key fetch failed”

  1. Verify https://yourdomain.com/.well-known/cmn.json is accessible
  2. Check that cmn.json contains a valid public_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. Clear cache: hypha cache clean --domain cmn.dev
  2. Re-fetch the spore
  3. Report to publisher if issue persists

“Merge conflict” during grow

  1. Resolve conflicts in affected files
  2. git add <resolved-files>
  3. git commit
  4. Your spore.core.json is preserved automatically