{"record":{"id":"2b3095ac888f78b4","repo":"multica-ai/multica","slug":"runtime-local-skill-import-timed-out","errorCode":null,"errorMessage":"runtime local skill import timed out","messagePattern":"runtime local skill import timed out","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/runtimes/local-skills.ts","lineNumber":66,"sourceCode":"  return {\n    skills: current.skills ?? [],\n    supported: current.supported,\n\tmcpServers: current.mcp_servers ?? [],\n\tmcpSupported: current.mcp_supported === true,\n  };\n}\n\nexport async function resolveRuntimeLocalSkillImport(\n  runtimeId: string,\n  payload: CreateRuntimeLocalSkillImportRequest,\n): Promise<RuntimeLocalSkillImportResult> {\n  const initial = await api.initiateImportLocalSkill(runtimeId, payload);\n  const start = Date.now();\n  let current = initial;\n\n  while (current.status === \"pending\" || current.status === \"running\") {\n    if (Date.now() - start > IMPORT_POLL_TIMEOUT_MS) {\n      throw new Error(\"runtime local skill import timed out\");\n    }\n    await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));\n    current = await api.getImportLocalSkillResult(runtimeId, initial.id);\n  }\n\n  if (current.status === \"conflict\") {\n    if (!current.conflict) {\n      throw new Error(\"runtime local skill import conflict missing details\");\n    }\n    return {\n      status: \"conflict\",\n      conflict: current.conflict,\n    };\n  }\n\n  if (current.status === \"failed\" || current.status === \"timeout\") {\n    throw new Error(current.error || \"runtime local skill import failed\");\n  }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/packages/core/runtimes/local-skills.ts#L48-L84","documentation":"Wrap thrown by prepareHermesHome when writeDerivedHermesEnv fails. This writes the overlay's .env: the source home's .env with any HERMES_HOME assignment stripped, plus a pinned HERMES_HOME appended last so it wins (Hermes loads <HERMES_HOME>/.env with override=True right after profile resolution). The file is always written — even with no source .env — 0600 via atomic replace, because it can hold API-key secrets. A write failure is fatal since an absent .env would let Hermes' project-.env fallback relocate the home and break skill binding and memory isolation.","triggerScenarios":"writeDerivedHermesEnv(sharedHome, hermesHome) errors — reading the source .env fails with a non-NotExist error (handled by a narrower wrap), stripping/serialization fails, or the atomic replace into hermes-home fails on permissions or full disk.","commonSituations":"Overlay .env left owned by a previous daemon user in a recycled env-root; disk full at the moment of the atomic rename; env-root on a filesystem that does not support the rename-based atomic write.","solutions":["Check ownership/permissions of <envRoot>/hermes-home/.env and repair or remove it so the atomic replace can proceed.","Free disk space on the env-root volume.","Ensure env-root is on a POSIX filesystem supporting rename(2).","If reading the source .env is the failing part (see the wrapped 'read shared .env' error), fix that file's permissions first."],"exampleFix":"# before: stale overlay .env owned by root blocks atomic replace\n$ ls -l /var/lib/app/envs/task-9/hermes-home/.env\n-rw------- 1 root root ...\n\n# after\n$ chown daemonuser:daemongroup /var/lib/app/envs/task-9/hermes-home/.env  # or delete it","handlingStrategy":"try-catch","validationCode":"envFile := filepath.Join(envRoot, \"hermes-home\", \".env\")\nif fi, err := os.Stat(envFile); err == nil && !fi.Mode().IsRegular() {\n    return fmt.Errorf(\"overlay .env path is not a regular file: %s\", envFile)\n}","typeGuard":null,"tryCatchPattern":"if err := prepareHermesHome(...); err != nil {\n    if strings.Contains(err.Error(), \"derive hermes .env\") {\n        // check the wrapped error: source read perms (see 'read shared .env') vs overlay write; fix and retry prepare\n    }\n}","preventionTips":["Repair ownership of stale overlay .env files when recycling env-roots.","Keep env-root on rename-capable local filesystems.","Disk-space alerts on env-root volumes."],"tags":["go","hermes","execenv","dotenv","secrets","filesystem","atomic-write"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}