{"record":{"id":"c4443c331516be71","repo":"Tencent/WeKnora","slug":"failed-to-read-skill-directory-s-w","errorCode":null,"errorMessage":"failed to read skill directory %s: %w","messagePattern":"failed to read skill directory (.+?): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/skills/loader.go","lineNumber":66,"sourceCode":"\tvar metadata []*SkillMetadata\n\n\t// Check if directory exists\n\tinfo, err := os.Stat(dir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, nil // Directory doesn't exist, skip silently\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to access skill directory %s: %w\", dir, err)\n\t}\n\n\tif !info.IsDir() {\n\t\treturn nil, fmt.Errorf(\"%s is not a directory\", dir)\n\t}\n\n\t// Read directory entries\n\tentries, err := os.ReadDir(dir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read skill directory %s: %w\", dir, err)\n\t}\n\n\tfor _, entry := range entries {\n\t\tif !entry.IsDir() {\n\t\t\tcontinue\n\t\t}\n\n\t\tskillPath := filepath.Join(dir, entry.Name())\n\t\tskillFile := filepath.Join(skillPath, SkillFileName)\n\n\t\t// Check if SKILL.md exists\n\t\tif _, err := os.Stat(skillFile); os.IsNotExist(err) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Read and parse SKILL.md\n\t\tcontent, err := os.ReadFile(skillFile)\n\t\tif err != nil {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/skills/loader.go#L48-L84","documentation":"Wraps os.ReadDir failure in Loader.discoverInDirectory: the skill directory exists and is a directory (os.Stat succeeded) but reading its entries failed, typically due to permission denied. Missing directories are deliberately skipped silently, so this error means an existing directory could not be enumerated.","triggerScenarios":"Thrown at internal/agent/skills/loader.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix filesystem permissions on the skill directory so the process can read it","Verify the path points to a directory the service user can access","Check for mount/NFS issues if the directory is on shared storage"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}