{"record":{"id":"319c05480353de73","repo":"helm/helm","slug":"could-not-load-s-w","errorCode":null,"errorMessage":"could not load %s: %w","messagePattern":"could not load (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chart/v3/util/create.go","lineNumber":655,"sourceCode":"  containers:\n    - name: wget\n      image: busybox\n      command: ['wget']\n      args: ['{{ include \"<CHARTNAME>.fullname\" . }}:{{ .Values.service.port }}']\n  restartPolicy: Never\n`\n\n// Stderr is an io.Writer to which error messages can be written\n//\n// In Helm 4, this will be replaced. It is needed in Helm 3 to preserve API backward\n// compatibility.\nvar Stderr io.Writer = os.Stderr\n\n// CreateFrom creates a new chart, but scaffolds it from the src chart.\nfunc CreateFrom(chartfile *chart.Metadata, dest, src string) error {\n\tschart, err := loader.Load(src)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not load %s: %w\", src, err)\n\t}\n\n\tschart.Metadata = chartfile\n\n\tvar updatedTemplates []*common.File\n\n\tfor _, template := range schart.Templates {\n\t\tnewData := transform(string(template.Data), schart.Name())\n\t\tupdatedTemplates = append(updatedTemplates, &common.File{Name: template.Name, ModTime: template.ModTime, Data: newData})\n\t}\n\n\tschart.Templates = updatedTemplates\n\tb, err := yaml.Marshal(schart.Values)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading values file: %w\", err)\n\t}\n\n\tvar m map[string]any","sourceCodeStart":637,"sourceCodeEnd":673,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/internal/chart/v3/util/create.go#L637-L673","documentation":"Thrown by util.CreateFrom (the engine behind 'helm create --from') when loader.Load(src) fails on the source chart it is supposed to scaffold from. The error wraps the underlying loader failure, so the real cause (missing Chart.yaml, broken archive, bad values) travels with it. src may be a directory, a .tgz, or a URL-referenced chart — anything loader.Load accepts.","triggerScenarios":"CreateFrom(metadata, dest, src) where src is not a loadable chart: directory without Chart.yaml, corrupt or non-chart .tgz, a path with a typo, an empty directory, or a chart whose subcharts/values fail load-time validation.","commonSituations":"'helm create myapp --from <path-or-archive>' pointing at a rendered-output directory, a half-downloaded tarball, or a repo layout where the chart is one level deeper than given; scripts passing a values file or repo URL component instead of the chart.","solutions":["Verify src loads standalone: 'helm show chart <src>' (or 'helm lint <src>') — fix whatever it reports first.","Check the path is the chart root (contains Chart.yaml) or a valid packaged .tgz produced by 'helm package'.","Re-download/re-pull the source if it was fetched (helm pull <repo>/<chart> --version <v>) to rule out corruption.","Once 'helm show chart <src>' succeeds, retry the create --from."],"exampleFix":"# before\n$ helm create myapp --from ./myapp-rendered   # rendered manifests, no Chart.yaml\nError: could not load ./myapp-rendered: ...\n\n# after\n$ helm create myapp --from ./charts/source-chart   # directory containing Chart.yaml","handlingStrategy":"validation","validationCode":"// Validate the --from source before scaffolding.\nfunc srcLoadable(src string) error {\n    if fi, err := os.Stat(src); err == nil && fi.IsDir() {\n        ok, derr := util.IsChartDir(src)\n        if derr != nil || !ok {\n            return fmt.Errorf(\"src dir is not a valid chart: %v\", derr)\n        }\n        return nil\n    }\n    _, lerr := loader.Load(src) // archives/files\n    return lerr\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'helm show chart <src>' before 'helm create --from <src>'.","Confirm src is a chart root (has Chart.yaml) or a helm-packaged .tgz.","Pin and re-pull dependency sources instead of reusing possibly stale local copies."],"tags":["helm","chart","create","scaffold","loader"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}