{"record":{"id":"fac9be5ca793e357","repo":"vxcontrol/pentagi","slug":"failed-to-open-file-w","errorCode":null,"errorMessage":"failed to open file: %w","messagePattern":"failed to open file: %w","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"backend/pkg/resources/resources.go","lineNumber":424,"sourceCode":"\t\t}\n\t\theader, err := zip.FileInfoHeader(info)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create zip header: %w\", err)\n\t\t}\n\t\tzipPath, err := SanitizeResourcePath(filepath.ToSlash(rel))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid zip entry path %q: %w\", rel, err)\n\t\t}\n\t\theader.Name = filepath.ToSlash(zipPath)\n\t\theader.Method = zip.Deflate\n\n\t\tzf, err := zw.CreateHeader(header)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create zip entry: %w\", err)\n\t\t}\n\t\tf, err := os.Open(entryPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to open file: %w\", err)\n\t\t}\n\t\t_, copyErr := io.Copy(zf, f)\n\t\tf.Close()\n\t\treturn copyErr\n\t})\n}\n\n// validatePathComponent rejects empty, dot/dotdot, overly long, or\n// character-unsafe path segments.  Mirrors flowfiles.validatePathComponent.\nfunc validatePathComponent(component string) error {\n\tclean := strings.TrimSpace(component)\n\tif clean == \"\" || clean == \".\" || clean == \"..\" {\n\t\treturn fmt.Errorf(\"invalid path component %q\", component)\n\t}\n\tif len(clean) > MaxFileNameLength {\n\t\treturn fmt.Errorf(\"path component %q exceeds maximum length of %d\", component, MaxFileNameLength)\n\t}\n\tfor _, r := range clean {","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/resources/resources.go#L406-L442","documentation":"Error \"failed to open file: %w\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/resources/resources.go:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}