{"record":{"id":"c26dc3734da73991","repo":"rancher/rancher","slug":"unable-to-find-the-required-chart-tar-file-for-s","errorCode":null,"errorMessage":"unable to find the required chart tar file for %s","messagePattern":"unable to find the required chart tar file for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/catalogv2/oci/oci.go","lineNumber":104,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unable to unmarshal manifest blob of %s: %w\", chartURL, err)\n\t}\n\n\t// Check if the oci artifact is of type helm config ?\n\tif manifest.ArtifactType == registry.ConfigMediaType || manifestJSON.Config.MediaType == registry.ConfigMediaType {\n\t\t// Find the layer of chart type and fetch it\n\t\tfor _, layer := range manifestJSON.Layers {\n\t\t\tif layer.MediaType == registry.ChartLayerMediaType {\n\t\t\t\tchartTar, err := content.FetchAll(ctx, memoryStore, layer)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\treturn io.NopCloser(bytes.NewBuffer(chartTar)), nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"unable to find the required chart tar file for %s\", chartURL)\n}\n\n// GenerateIndex creates a Helm repo index from the OCI url provided\n// by fetching the repositories and then the tags according to the url.\n// Lastly, adds the chart entry to the Helm repo index using the oras library.\nfunc GenerateIndex(ociClient *Client, URL string, credentialSecret *corev1.Secret,\n\tclusterRepoSpec v1.RepoSpec,\n\tclusterRepoStatus v1.RepoStatus,\n\tindexFile *repo.IndexFile) (*repo.IndexFile, error) {\n\tlogrus.Debugf(\"Generating index for oci clusterrepo URL %s\", URL)\n\n\t// Checking if the URL specified by the user is a oras repository or not ?\n\tIsOrasRepository, err := ociClient.IsOrasRepository()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar maxTag string","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/rancher/rancher/blob/932558d4e68565aff2d2f36e89ec4a391b06e7c5/pkg/catalogv2/oci/oci.go#L86-L122","documentation":"oci.Chart copied and parsed the manifest successfully but found no Helm content: either the artifactType/config media type is not application/vnd.cncf.helm.config.v1+json, or no layer carries media type application/vnd.cncf.helm.chart.content.v1.tar+gzip. The reference is simply not packaged as a Helm chart.","triggerScenarios":"oci.Chart called on a generic OCI artifact or container image that happens to be a single manifest; chart pushed with custom tooling (oras push with arbitrary layer types) that did not set the Helm config and chart media types.","commonSituations":"ClusterRepo OCI URL pointing at an app image rather than a chart; manually crafted oras artifacts with a tar layer but a default config blob.","solutions":["Push the chart with helm push chart.tgz oci://reg/charts so the Helm media types are set correctly","Verify with crane manifest: the config mediaType must be application/vnd.cncf.helm.config.v1+json and one layer must be the chart content type","Correct the ClusterRepo URL to reference the actual chart repository path"],"exampleFix":"# before\noras push reg/foo:1.0 ./chart.tgz:application/octet-stream\n# after\nhelm package ./foo && helm push foo-1.0.0.tgz oci://reg/charts","handlingStrategy":"type-guard","validationCode":"// fetch and decode the manifest, then guard before treating it as a chart\nblob, err := content.FetchAll(ctx, memoryStore, manifest)\nif err != nil {\n\treturn err\n}\nvar m ocispecv1.Manifest\nif err := json.Unmarshal(blob, &m); err != nil {\n\treturn err\n}\nif !isHelmChartManifest(m) {\n\treturn fmt.Errorf(\"ref is not packaged as a helm chart\")\n}","typeGuard":"func isHelmChartManifest(m ocispecv1.Manifest) bool {\n\tif m.ArtifactType != registry.ConfigMediaType && m.Config.MediaType != registry.ConfigMediaType {\n\t\treturn false\n\t}\n\tfor _, l := range m.Layers {\n\t\tif l.MediaType == registry.ChartLayerMediaType {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Push charts with helm push so config/layer media types are the cncf.helm ones","Audit CI pipelines that publish to chart repositories with oras/crane","Verify refs with crane manifest before adding them to a ClusterRepo"],"tags":["oci","helm","media-type","validation"],"backgroundTag":null,"analyzedSha":"932558d4e68565aff2d2f36e89ec4a391b06e7c5","analyzedAt":"2026-08-16T04:37:02.125Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}