{"record":{"id":"9514704ed9b8e216","repo":"vxcontrol/pentagi","slug":"failed-to-create-zip-entry-w","errorCode":null,"errorMessage":"failed to create zip entry: %w","messagePattern":"failed to create zip entry: %w","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"backend/pkg/resources/resources.go","lineNumber":420,"sourceCode":"\t\t}\n\t\tinfo, err := d.Info()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get file info: %w\", err)\n\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}","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/resources/resources.go#L402-L438","documentation":"Error \"failed to create zip entry: %w\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/resources/resources.go:420 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"}