helmfile: Cannot use a helm-git chart that depends on a helm-git chart

I have written two helm charts. The first helm chart lists the second helm chart in the requirements.yaml file. I don’t have a helm repository, so I use helm-git to download and install these charts. This means that I have a “repository” listing for each of the charts.

When I run helmfile install, I run into trouble when helm diff tries to download the first chart:

Adding repo nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora: 
Adding repo onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora: "onlyoffice-documentserver" has been added to your repositories

"onlyoffice-documentserver" has been added to your repositories

err: helm exited with status 1:
  Error: no repository definition for @onlyoffice-documentserver. Please add them via 'helm repo add'
  Error in plugin 'helm-git': Error while helm_dependency_update
  Error: Looks like "git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error
changing working directory back to "/root"
in /oas/source/repos/helmfiles/helmfile.d/20-nextcloud.yaml: helm exited with status 1:
  Error: no repository definition for @onlyoffice-documentserver. Please add them via 'helm repo add'
  Error in plugin 'helm-git': Error while helm_dependency_update
  Error: Looks like "git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error

I understand that this is all very vague, but I wanted to give a short summary of the problem before I went into specifics.

I am talking about the two charts in this repository and branch:

https://code.greenhost.net/openappstack/nextcloud/tree/4-use-onlyoffice-instead-of-collabora

(in time of writing HEAD is at this commit)

The nextcloud-onlyoffice chart includes a job that installs an integration of NextCloud and OnlyOffice, so it’s requirements.yaml file lists:

dependencies:
  - name: nextcloud
    version: 1.1.1
    repository: "@stable"
    tags:
      - nextcloud
  - name: onlyoffice-documentserver
    version: 0.1.0
    repository: "@onlyoffice-documentserver"
    tags:
      - onlyoffice
      - nextcloud

The first dependency is no problem, because it uses the @stable repository, but the second (a link to the onlyoffice-documentserver chart in the same git repository) needs you to have that helm repository available.

In the non-helmfile scenario, a user would run

helm repo add onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora

To add that repository. In this case, however, we want to use helmfile. So we have this second repository with our helmfile configuration:

https://code.greenhost.net/openappstack/helmfiles/tree/7077c08573bac6b87601d6e1d7b8abd7e16ffae3

Here, in helmfile.d/20-nextcloud.yaml, we have listed the two repositories we need:

repositories:
  - name: nextcloud-onlyoffice
    url: git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora
  - name: onlyoffice-documentserver
    url: git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora

But when we run the following command:

/usr/local/bin/helmfile -b /snap/bin/helm -e oas -f /oas/source/repos/helmfiles/helmfile.d/ --log-level debug apply --suppress-secrets

Helmfile exits with this error:

Adding repo nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add nextcloud-onlyoffice git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora: 
Adding repo onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora
exec: /snap/bin/helm repo add onlyoffice-documentserver git+https://code.greenhost.net/openappstack/nextcloud@onlyoffice-documentserver?ref=4-use-onlyoffice-instead-of-collabora: "onlyoffice-documentserver" has been added to your repositories

"onlyoffice-documentserver" has been added to your repositories

err: helm exited with status 1:
  Error: no repository definition for @onlyoffice-documentserver. Please add them via 'helm repo add'
  Error in plugin 'helm-git': Error while helm_dependency_update
  Error: Looks like "git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error
changing working directory back to "/root"
in /oas/source/repos/helmfiles/helmfile.d/20-nextcloud.yaml: helm exited with status 1:
  Error: no repository definition for @onlyoffice-documentserver. Please add them via 'helm repo add'
  Error in plugin 'helm-git': Error while helm_dependency_update
  Error: Looks like "git+https://code.greenhost.net/openappstack/nextcloud@nextcloud-onlyoffice?ref=4-use-onlyoffice-instead-of-collabora" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error

I have done some debugging, and it turns out that at some point helm-git is run with the following environment variables set:

  HELM_PLUGIN_DIR=/root/.helm/plugins/helm-git
  HELM_PLUGIN_NAME=helm-git
  SNAP_USER_COMMON=/root/snap/helm/common
  HELM_PATH_STARTER=starters
  HELM_PATH_REPOSITORY=repository
  HELM_BIN=/root/.helm/plugins/helm-diff/bin/diff
  HELM_PLUGIN=/root/.helm/plugins
  PWD=/tmp/helm-git.Ii2YPX
  HELM_PATH_REPOSITORY_FILE=repository/repositories.yaml
  SNAP_INSTANCE_NAME=helm
  SNAP_USER_DATA=/root/snap/helm/106
  HELM_PATH_CACHE=repository/cache
  SNAP=/snap/helm/106
  SNAP_COMMON=/var/snap/helm/common
  HELM_HOME=
  SNAP_DATA=/var/snap/helm/106
  XDG_RUNTIME_DIR=/run/user/0/snap.helm
  HELM_PATH_LOCAL_REPOSITORY=repository/local
  SNAP_NAME=helm

Now I’m not sure where this is going wrong, because I’m not sure if these environment variables are set by helm-diff or by helmfile, but the problem is that HELM_HOME is set to an empty string, which results in helm-git using a temporary home directory instead of the user’s normal helm home, which is the reason why it can not find the @onlyoffice-documentserver repository definition.

So I’m aware that this might be a problem in one of the plugins, but I’m not experienced enough with the whole toolset to find the exact cause of this problem on my own. Since helmfile supports using helm-git I thought I’d start here, and I’ll open an issue with either plugin if we figure out that they’re the culprit.

Any help would be appreciated!

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @mrtndwrd! Thanks for reporting, I’m unable to test now as it seems your git server is blocked at my workplace. Gonna try to debug when I’m back home. I added a Troubleshooting section in the helm-git repo, feel free to have a try. Thanks @mumoshu for your input!