{"record":{"id":"926b17415b751db8","repo":"multica-ai/multica","slug":"runtime-local-skill-import-failed","errorCode":null,"errorMessage":"runtime local skill import failed","messagePattern":"runtime local skill import failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/runtimes/local-skills.ts","lineNumber":83,"sourceCode":"    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  }\n  if (!current.skill) {\n    throw new Error(\"runtime local skill import did not return a skill\");\n  }\n\n  return {\n    status: current.action === \"overwrite\" ? \"updated\" : \"created\",\n    skill: current.skill,\n  };\n}\n\nexport function runtimeLocalSkillsOptions(runtimeId: string | null | undefined) {\n  return queryOptions({\n    queryKey: runtimeId\n      ? runtimeLocalSkillsKeys.forRuntime(runtimeId)\n      : runtimeLocalSkillsKeys.all(),\n    queryFn: () => resolveRuntimeLocalSkills(runtimeId as string),\n    enabled: Boolean(runtimeId),","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/packages/core/runtimes/local-skills.ts#L65-L101","documentation":"Thrown by writeDerivedHermesEnv when reading the shared home's .env fails with any error other than not-exist (a missing file is the normal, tolerated case and yields an empty body). Typical causes are permission denial on the file or an I/O error from the underlying storage; since the derived .env must preserve the source's credentials/settings, an unreadable file is fatal rather than silently dropped.","triggerScenarios":"os.ReadFile(filepath.Join(sharedHome, \".env\")) returns an error where os.IsNotExist(err) is false — mode 0000 or owner-only perms excluding the daemon user, an unreadable directory in the path, or EIO from a failing disk/NFS mount.","commonSituations":"User's .env created with restrictive perms by a different tool/user than the daemon runs as; shared home on NFS with root-squash; failing disk returning EIO; the .env path being a directory.","solutions":["Check the file's mode and owner: chmod 0600 <sharedHome>/.env owned by (or readable by) the daemon user.","Ensure every parent directory of the shared home grants execute (x) to the daemon user.","If the path is a directory, remove/rename it so the real .env file can be read.","Repair the underlying storage (disk/NFS) if reads return I/O errors."],"exampleFix":"# before: daemon cannot read the user's .env\n$ ls -l /home/user/.hermes/.env\n-rw------- 1 otheruser otheruser 120 ...\n\n# after\n$ chmod 640 /home/user/.hermes/.env   # or add daemonuser to a readable group\n$ chgrp daemonuser /home/user/.hermes/.env","handlingStrategy":"validation","validationCode":"src := filepath.Join(sharedHome, \".env\")\nif fi, err := os.Stat(src); err == nil {\n    if !fi.Mode().IsRegular() {\n        return fmt.Errorf(\"%s is not a regular file\", src)\n    }\n    if fi.Mode().Perm()&0o400 == 0 && fi.Mode().Perm()&0o004 == 0 {\n        return fmt.Errorf(\"%s not readable by daemon user\", src)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := writeDerivedHermesEnv(sharedHome, hermesHome); err != nil {\n    if strings.Contains(err.Error(), \"read shared .env\") {\n        var pe *os.PathError\n        if errors.As(err, &pe) && errors.Is(pe.Err, os.ErrPermission) {\n            // fix perms on sharedHome/.env, then re-run prepare\n        }\n    }\n}","preventionTips":["Create the shared .env with 0600 owned by the daemon's user (or a readable group).","Grant the daemon user path-execute (x) on all parents of the shared home.","After permission changes to the shared home, smoke-test one task prepare."],"tags":["go","hermes","execenv","dotenv","filesystem","permissions"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}