{"record":{"id":"69c9583ea4fb7b00","repo":"multica-ai/multica","slug":"read-skill-archive-w","errorCode":null,"errorMessage":"read skill archive: %w","messagePattern":"read skill archive: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":476,"sourceCode":"\tswitch {\n\tcase importURL == \"\" && importFile == \"\":\n\t\treturn fmt.Errorf(\"either --url or --file is required\")\n\tcase importURL != \"\" && importFile != \"\":\n\t\treturn fmt.Errorf(\"--url and --file are mutually exclusive\")\n\t}\n\tonConflict, _ := cmd.Flags().GetString(\"on-conflict\")\n\tif !validSkillImportConflictStrategy(onConflict) {\n\t\treturn fmt.Errorf(\"--on-conflict must be one of: fail, overwrite, rename, skip\")\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(60*time.Second))\n\tdefer cancel()\n\n\tvar result map[string]any\n\tif importFile != \"\" {\n\t\tfileData, readErr := os.ReadFile(importFile)\n\t\tif readErr != nil {\n\t\t\treturn fmt.Errorf(\"read skill archive: %w\", readErr)\n\t\t}\n\t\tif err := client.ImportSkillFile(ctx, fileData, filepath.Base(importFile), onConflict, &result); err != nil {\n\t\t\tif handledErr := handleSkillImportError(cmd, err); handledErr != nil {\n\t\t\t\treturn handledErr\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"import skill: %w\", err)\n\t\t}\n\t\treturn printSkillImportResult(cmd, result)\n\t}\n\n\tbody := map[string]any{\n\t\t\"url\":         importURL,\n\t\t\"on_conflict\": onConflict,\n\t}\n\tif err := client.PostJSON(ctx, \"/api/skills/import\", body, &result); err != nil {\n\t\tif handledErr := handleSkillImportError(cmd, err); handledErr != nil {\n\t\t\treturn handledErr\n\t\t}","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L458-L494","documentation":"Returned by `multica skill import --file <path>` when `os.ReadFile` on the local archive fails. The wrapped error is a standard Go filesystem error: `no such file or directory`, `permission denied`, or `is a directory`. This happens before any bytes hit the network.","triggerScenarios":"Passing a path that does not exist (typo, wrong cwd since relative paths resolve against the current directory); pointing at a directory instead of the archive file; file unreadable due to ownership/permissions; path with unexpanded `~` (the shell does not expand `~/…` inside quotes).","commonSituations":"Running the CLI from a different working directory than where the archive was downloaded; CI runner checking out the repo without the artifact; `\"~/Downloads/skill.zip\"` quoted so tilde never expands; permission mismatch when running under a different user or container.","solutions":["Verify the file exists and is readable at that exact path: `ls -la <path>` from the same shell/cwd.","Use an absolute path to eliminate cwd ambiguity.","Expand `~` yourself (`$HOME/Downloads/skill.zip`) if the path was quoted.","Check permissions if ls shows the file but ReadFile still fails (`chmod +r` or adjust ownership)."],"exampleFix":"# before\nmultica skill import --file skill.zip   # wrong cwd\n\n# after\nmultica skill import --file \"$(pwd)/downloads/skill.zip\"","handlingStrategy":"validation","validationCode":"test -f \"$ARCHIVE\" || { echo \"archive not found: $ARCHIVE\"; exit 1; }\ntest -r \"$ARCHIVE\" || { echo \"archive unreadable: $ARCHIVE\"; exit 1; }\nmultica skill import --file \"$(realpath \"$ARCHIVE\")\"","typeGuard":null,"tryCatchPattern":"If the read still fails inside the CLI, inspect errno in the wrapped message: ENOENT → fix path/cwd; EACCES → fix permissions; EISDIR → point at the archive file itself.","preventionTips":["Always pass an absolute path (realpath) to imports in scripts.","Expand ~ explicitly ($HOME) — quoting suppresses tilde expansion.","Download artifacts to a known directory and reference that path."],"tags":["cli","filesystem","validation","import"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}