{"record":{"id":"2c8b537d34086d81","repo":"tinyhumansai/openhuman","slug":"core-not-reachable-at-rpc-url-start-it-with","errorCode":null,"errorMessage":"core not reachable at ${RPC_URL} — start it with `cargo run --bin openhuman -- serve`. (${err.message})","messagePattern":"core not reachable at (.+?) — start it with `cargo run --bin openhuman -- serve`\\. \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/test-memory-email-ingest.mjs","lineNumber":112,"sourceCode":"    threads.get(tid).push(m);\n  }\n  return [...threads.entries()].map(([threadId, msgs]) => {\n    msgs.sort((a, b) => parseEmailDate(a.date) - parseEmailDate(b.date));\n    return {\n      threadId,\n      subject: msgs[0]?.subject || \"(no subject)\",\n      messages: msgs.map(toEmailMessage),\n    };\n  });\n}\n\nasync function main() {\n  console.log(`[memory-email-ingest] fixture=${FIXTURE}`);\n  console.log(`[memory-email-ingest] rpc_url=${RPC_URL}`);\n\n  // Sanity-check that the core is up.\n  await rpc(\"openhuman.health_snapshot\", {}).catch((err) => {\n    throw new Error(\n      `core not reachable at ${RPC_URL} — start it with \\`cargo run --bin openhuman -- serve\\`. (${err.message})`,\n    );\n  });\n\n  const raw = await readFile(FIXTURE, \"utf8\");\n  const inbox = JSON.parse(raw);\n  const messages = Array.isArray(inbox.messages) ? inbox.messages : [];\n  if (messages.length === 0) {\n    console.error(\"[memory-email-ingest] no messages in fixture, nothing to do\");\n    process.exit(1);\n  }\n  console.log(`[memory-email-ingest] loaded ${messages.length} email(s)`);\n\n  const threads = groupByThread(messages);\n  console.log(`[memory-email-ingest] grouped into ${threads.length} thread(s)`);\n\n  let chunksWritten = 0;\n  let chunksDropped = 0;","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/scripts/test-memory-email-ingest.mjs#L94-L130","documentation":"main() sanity-checks connectivity with a single openhuman.health_snapshot RPC before doing any work; when that first call fails for any reason (ECONNREFUSED, HTTP error like 287, or a JSON-RPC error like 288), the script rethrows wrapped with this hint naming the startup command.","triggerScenarios":"No core listening on RPC_URL (default http://127.0.0.1:7810/rpc); core on a different port; core up but health_snapshot itself erroring (JSON-RPC failure still lands here via err.message).","commonSituations":"Forgot to run `cargo run --bin openhuman -- serve` in a separate terminal; core crashed between two script runs; stale RPC_URL exported from an earlier session pointing at a dead port.","solutions":["Start the core: cargo run --bin openhuman -- serve (release tree: ./target/debug/openhuman-core serve) and wait for its listening log","Verify liveness on the same base: curl http://127.0.0.1:7810/health","Align RPC_URL with the port the core actually logged; the token for a standalone core lives in {workspace}/core.token"],"exampleFix":"# before\nnode scripts/test-memory-email-ingest.mjs   # core not reachable at http://127.0.0.1:7810/rpc\n\n# after\ncargo run --bin openhuman -- serve &        # wait for the listening line\nRPC_URL='http://127.0.0.1:7810/rpc' node scripts/test-memory-email-ingest.mjs","handlingStrategy":"validation","validationCode":"async function waitForCore(url, tries = 30) {\n  for (let i = 0; i < tries; i++) {\n    try { const r = await fetch(url.replace(/\\/rpc$/, '/health')); if (r.ok) return; } catch {}\n    await new Promise((r) => setTimeout(r, 1000));\n  }\n  throw new Error(`core never became healthy at ${url}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["start the core before the ingest script; gate on /health","keep RPC_URL and token in one sourced env file","treat any health_snapshot failure as environment, not fixture, trouble first"],"tags":["jsonrpc","connectivity","local-core","testing"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}