{"record":{"id":"8373d72064137aa5","repo":"Significant-Gravitas/AutoGPT","slug":"failed-to-load-default-skill-body","errorCode":null,"errorMessage":"Failed to load default skill body","messagePattern":"Failed to load default skill body","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":2731,"sourceCode":"    dependencies=[Security(requires_user)],\n)\nasync def read_copilot_skill(\n    user_id: Annotated[str, Security(get_user_id)],\n    name: str = Path(..., description=\"Slug of the skill to read\"),\n) -> CopilotSkillDetail:\n    \"\"\"Return full SKILL.md content (name, description, triggers, body)\n    for the library UI's expand-to-view dialog.\n\n    Built-in default skills are returned with ``is_default=True`` so the\n    UI can hide destructive affordances; missing user skills return 404.\n    \"\"\"\n    slug = name.strip().lower()\n    try:\n        default = get_default_skill_with_body(slug)\n    except OSError:\n        # Don't leak the on-disk path; operators trace via server logs.\n        logger.exception(\"[skills] failed to load default skill body for %s\", slug)\n        raise HTTPException(\n            status_code=500,\n            detail=\"Failed to load default skill body\",\n        )\n    if default is not None:\n        return CopilotSkillDetail(\n            name=default.name,\n            description=default.description,\n            triggers=list(default.triggers),\n            body=default.body,\n            is_default=True,\n        )\n\n    parsed = await read_user_skill_with_body(user_id, slug)\n    if parsed is None:\n        raise HTTPException(\n            status_code=HTTP_404_NOT_FOUND, detail=f\"Skill '{slug}' not found\"\n        )\n    sibling_files = await list_user_skill_sibling_paths(user_id, slug)","sourceCodeStart":2713,"sourceCodeEnd":2749,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L2713-L2749","documentation":"Skill-detail endpoint returns 500 when reading a built-in default skill's body from disk (`get_default_skill_with_body(slug)`) raises OSError — the packaged SKILL.md asset for that default skill is missing, unreadable, or the filesystem denies access. The handler deliberately hides the on-disk path from clients and logs the full traceback server-side ('[skills] failed to load default skill body').","triggerScenarios":"GET /skills/{name} for a slug that resolves to a built-in default skill whose file was deleted, not shipped in the deployment image, or has broken permissions on the server.","commonSituations":"Deployment images built without copying the default-skills assets; partial installs/upgrades; volumes mounted read-only or with wrong ownership; local edits deleting a packaged skill file.","solutions":["Check server logs for the logged OSError — it names the actual path and I/O problem.","Restore the default skill files (reinstall/redeploy the backend package or re-copy the defaults directory) and verify file permissions for the server process user.","If a default skill is intentionally removed, also remove its registration so get_default_skill_with_body doesn't resolve it."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await api.getSkillDetail(slug);\n} catch (e) {\n  if (e.status === 500) {\n    // server-side asset problem — one retry after a short delay, then surface\n    await sleep(1000);\n    return api.getSkillDetail(slug);\n  }\n  throw e;\n}","preventionTips":["Operators: verify default-skill assets ship in deployment images with correct permissions.","Monitor the '[skills] failed to load default skill body' log line to catch broken assets early.","Keep default-skill registration in sync with the files on disk."],"tags":["http-500","filesystem","skills","deployment"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}