ProjectHelmChartRepository "Error retrieving index file" Errors in OpenShift

Solution In Progress - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Red Hat OpenShift on AWS (ROSA)
    • 4
  • Red Hat OpenShift Dedicated (OSD)
    • 4
  • Azure Red Hat OpenShift (ARO)
    • 4

Issue

  • When creating ProjectHelmChartRepository as following:
apiVersion: helm.openshift.io/v1beta1
kind: ProjectHelmChartRepository
metadata:
  name: my-helm-chart-repo
  namespace: my-helm-chart-ns
spec:
  connectionConfig:
    url: 'https://github.com/test-git/test-helm'
  name: My Helm Chart Repo

Receiving Errors from Openshift Console pods.

E0412 17:54:59.245598       1 proxy.go:92] Error retrieving index file for &{my-helm-chart-repo my-helm-chart-ns https://github.com/test-git/test-helm false 0x26f1920}: Response for https://github.com/test-git/test-helm/index.yaml returned &{404 Not Found 404 HTTP/1.1 1 1 map[Cache-Control:[no-cache] Content-Security-Policy:[default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src 'self' data:; script-src 'self'; style-src 'unsafe-inline'] Content-Type:[text/plain; charset=utf-8] Date:[Wed, 12 Apr 2023 17:54:54 GMT] Referrer-Policy:[origin-when-cross-origin, strict-origin-when-cross-origin] Server:[GitHub.com] Set-Cookie:[_gh_sess=rM5tfzphues...ommit...g%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax _octo=GH1.1.1378741094.1681322099; Path=/; Domain=github.com; Expires=Fri, 12 Apr 2024 17:54:59 GMT; Secure; SameSite=Lax logged_in=no; Path=/; Domain=github.com; Expires=Fri, 12 Apr 2024 17:54:59 GMT; HttpOnly; Secure; SameSite=Lax] Strict-Transport-Security:[max-age=31536000; includeSubdomains; preload] Vary:[X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With] X-Content-Type-Options:[nosniff] X-Frame-Options:[deny] X-Github-Request-Id:[6843:DF92:3DB9359:3E66129:6436F073] X-Xss-Protection:[0]] 0xc0004cc180 -1 [] false true map[] 0xc0007c2a00 0xc0008c62c0} with status code 404

Resolution

Disclaimer: Links contained herein to external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or their entities, products or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.

To resolve this issue, you need to create an index.yaml file and commit it to your Helm Chart Repository. The index.yaml file is a yaml file that contains information about all the charts in the chart repository.

Follow the instructions in the Helm documentation to create the index.yaml file:

  1. Navigate to the charts/ directory in your Helm repository.
  2. Run the command helm repo index . This command will scan the current directory for charts and generate an index.yaml file containing information about those charts.
  3. Commit the newly created index.yaml file to your repository.

For more detailed instructions, refer to the Helm documentation on the index file and the helm repo index command.

By correctly setting up your Helm Chart Repository, OpenShift will be able to locate and use the index.yaml file, resolving the 404 error.

Root Cause

The primary cause of this issue is an improper Helm Chart Repository structure. According to the Helm documentation, the repository should have a structure similar to this:

charts/
  |
  |- index.yaml
  |
  |- alpine-0.1.2.tgz
  |
  |- alpine-0.1.2.tgz.prov

If the index.yaml file is missing from your repository, as in the case highlighted in the error message, OpenShift will not be able to find it, resulting in a 404 error.

Diagnostic Steps

To check the logs from OpenShift console pods, you can use the oc command-line tool. Here are the steps:

  1. Log in to your OpenShift cluster with the oc command-line tool:
oc login --token=<your-token> --server=<your-openshift-api-server-url>
  1. Find the names of the console pods. The console pods are usually in the openshift-console namespace:
oc get pods -n openshift-console

This command will list all the pods in the openshift-console namespace. Look for pods with names that start with console-.

  1. Once you have identified the console pod name, use the oc logs command to get the logs:
oc logs <console-pod-name> -n openshift-console

Replace <console-pod-name> with the name of your console pod.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments