{"record":{"id":"8edb28898351981d","repo":"helm/helm","slug":"failed-to-create-plugin-tarball-w","errorCode":null,"errorMessage":"failed to create plugin tarball: %w","messagePattern":"failed to create plugin tarball: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/plugin_package.go","lineNumber":139,"sourceCode":"\t\t// User explicitly disabled signing\n\t\tfmt.Fprint(out, \"WARNING: Skipping plugin signing. This is not recommended for plugins intended for distribution.\\n\")\n\t}\n\n\t// Now create the tarball (only after signing prerequisites are met)\n\t// Use plugin metadata for filename: PLUGIN_NAME-SEMVER.tgz\n\tmetadata := pluginMeta.Metadata()\n\tfilename := fmt.Sprintf(\"%s-%s.tgz\", metadata.Name, metadata.Version)\n\ttarballPath := filepath.Join(o.destination, filename)\n\n\ttarFile, err := os.Create(tarballPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create tarball: %w\", err)\n\t}\n\tdefer tarFile.Close()\n\n\tif err := plugin.CreatePluginTarball(o.pluginPath, metadata.Name, tarFile); err != nil {\n\t\tos.Remove(tarballPath)\n\t\treturn fmt.Errorf(\"failed to create plugin tarball: %w\", err)\n\t}\n\ttarFile.Close() // Ensure file is closed before signing\n\n\t// If signing was requested, sign the tarball\n\tif o.sign {\n\t\t// Read the tarball data\n\t\ttarballData, err := os.ReadFile(tarballPath)\n\t\tif err != nil {\n\t\t\tos.Remove(tarballPath)\n\t\t\treturn fmt.Errorf(\"failed to read tarball for signing: %w\", err)\n\t\t}\n\n\t\t// Sign the plugin tarball data\n\t\tsig, err := plugin.SignPlugin(tarballData, filepath.Base(tarballPath), signer)\n\t\tif err != nil {\n\t\t\tos.Remove(tarballPath)\n\t\t\treturn fmt.Errorf(\"failed to sign plugin: %w\", err)\n\t\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/cmd/plugin_package.go#L121-L157","documentation":"The output file was created successfully, but plugin.CreatePluginTarball (internal/plugin/sign.go:105) failed while walking the plugin source directory and copying files into the tar writer. The half-written archive is cleaned up with os.Remove before the error is returned. Causes are per-file problems inside the plugin directory: unreadable files, permission bits, broken symlinks.","triggerScenarios":"A file inside the plugin dir with mode 000 or owned by another user; a symlink pointing to a nonexistent target; a file deleted concurrently while the tar walk is in progress.","commonSituations":"Restrictive umask or ownership after copying plugin files in CI; committed broken symlinks (e.g. node_modules style link farms); antivirus quarantining a binary mid-read on Windows.","solutions":["Check the wrapped error to identify which file failed to read","Fix readability: `chmod -R u+rX ./my-plugin` and repair/remove broken symlinks","Re-run once concurrent writes to the plugin directory have stopped"],"exampleFix":"# before\nhelm plugin package ./my-plugin --destination ./dist\n# error: failed to create plugin tarball: open ./my-plugin/bin/helm-my-plugin: permission denied\n\n# after\nchmod -R u+rX ./my-plugin && helm plugin package ./my-plugin --destination ./dist","handlingStrategy":"try-catch","validationCode":"func checkPluginFilesReadable(root string) error {\n    return filepath.Walk(root, func(p string, info os.FileInfo, err error) error {\n        if err != nil {\n            return err\n        }\n        if info.Mode().IsRegular() && info.Mode().Perm()&0o400 == 0 {\n            return fmt.Errorf(\"file not readable: %s\", p)\n        }\n        if info.Mode()&os.ModeSymlink != 0 {\n            if _, err := os.Stat(p); err != nil {\n                return fmt.Errorf(\"broken symlink: %s\", p)\n            }\n        }\n        return nil\n    })\n}","typeGuard":null,"tryCatchPattern":"if err := runPluginPackage(args); err != nil {\n    if strings.Contains(err.Error(), \"failed to create plugin tarball\") {\n        // tarball was cleaned up by helm; fix file perms and retry once\n        _ = exec.Command(\"chmod\", \"-R\", \"u+rX\", pluginDir).Run()\n        return runPluginPackage(args)\n    }\n    return err\n}","preventionTips":["Check file permissions and broken symlinks in the plugin dir before packaging","Avoid concurrent writes to the plugin directory during release builds"],"tags":["plugins","packaging","filesystem","tar"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}