{"record":{"id":"46bd84914e0c5f39","repo":"helm/helm","slug":"s-no-such-file","errorCode":null,"errorMessage":"%s: no such file","messagePattern":"(.+?): no such file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/pusher/ocipusher.go","lineNumber":51,"sourceCode":"\n// OCIPusher is the default OCI backend handler\ntype OCIPusher struct {\n\topts options\n}\n\n// Push performs a Push from repo.Pusher.\nfunc (pusher *OCIPusher) Push(chartRef, href string, options ...Option) error {\n\tfor _, opt := range options {\n\t\topt(&pusher.opts)\n\t}\n\treturn pusher.push(chartRef, href)\n}\n\nfunc (pusher *OCIPusher) push(chartRef, href string) error {\n\tstat, err := os.Stat(chartRef)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn fmt.Errorf(\"%s: no such file\", chartRef)\n\t\t}\n\t\treturn err\n\t}\n\tif stat.IsDir() {\n\t\treturn errors.New(\"cannot push directory, must provide chart archive (.tgz)\")\n\t}\n\n\tmeta, err := loader.Load(chartRef)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient := pusher.opts.registryClient\n\tif client == nil {\n\t\tc, err := pusher.newRegistryClient()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/pusher/ocipusher.go#L33-L69","documentation":"OCIPusher.push runs os.Stat on the chart reference before pushing; when the stat error is fs.ErrNotExist it returns \"<path>: no such file\". The chartRef argument must be the path of an existing .tgz chart archive on local disk.","triggerScenarios":"Calling OCIPusher.Push(chartRef, href) or `helm push chart.tgz oci://...` where chartRef does not exist: a typo in the filename, a relative path resolved from a different working directory, or a package step that never produced the .tgz.","commonSituations":"CI scripts referencing dist/*.tgz before `helm package` ran; shell globs that expanded to nothing so the literal pattern is passed; running helm from a directory other than where the archive was built.","solutions":["Run ls or os.Stat on the exact path you pass to Push and fix the typo or directory","Use an absolute path, or ensure the process cwd is where the .tgz lives","If the archive does not exist yet, build it first with `helm package <chart-dir>`"],"exampleFix":"// before\nerr := pusher.Push(\"mychart-1.0.0.tgz\", \"oci://reg.example.com/charts/mychart\")\n\n// after\nif _, statErr := os.Stat(\"mychart-1.0.0.tgz\"); statErr != nil {\n\treturn fmt.Errorf(\"chart archive missing (run `helm package .` first): %w\", statErr)\n}\nerr := pusher.Push(\"mychart-1.0.0.tgz\", \"oci://reg.example.com/charts/mychart\")","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(chartRef); err != nil {\n\treturn fmt.Errorf(\"refusing to push, chart archive not found: %w\", err)\n}\nerr := pusher.Push(chartRef, ociURL)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build .tgz paths with absolute paths derived from `helm package` output rather than assumptions about cwd","Fail fast in CI: assert the archive exists right after `helm package` before any later step"],"tags":["file-io","oci","push","path-validation"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}