helm: "failed: no objects visited" error when creating only secrets via helm

Output of helm version: Client: &version.Version{SemVer:“v2.10.0”, GitCommit:“9ad53aac42165a5fadc6c87be0dea6b115f93090”, GitTreeState:“clean”} Server: &version.Version{SemVer:“v2.10.0”, GitCommit:“9ad53aac42165a5fadc6c87be0dea6b115f93090”, GitTreeState:“clean”}

Output of kubectl version: Client Version: version.Info{Major:“1”, Minor:“10”, GitVersion:“v1.10.3”, GitCommit:“2bba0127d85d5a46ab4b778548be28623b32d0b0”, GitTreeState:“clean”, BuildDate:“2018-05-21T09:17:39Z”, GoVersion:“go1.9.3”, Compiler:“gc”, Platform:“windows/amd64”} Server Version: version.Info{Major:“1”, Minor:“10+”, GitVersion:“v1.10.6-gke.2”, GitCommit:“384b4eaa132ca9a295fcb3e5dfc74062b257e7df”, GitTreeState:“clean”, BuildDate:“2018-08-15T00:10:14Z”, GoVersion:“go1.9.3b4”, Compiler:“gc”, Platform:“linux/amd6 4”}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE

Issue Description I have a helm template which I am using to create secrets. I created a chart which only creates secrets for my applications. When I run the chart in --debug --dry-run mode it works fine and I do not get any error. But when I actually try to create a secret from it I get below error:

Error: release test failed: no objects visited

Below is how i created my chart:

  1. helm create test
  2. values.yaml content:
   secrets:
      test: YmFzZWw=
  1. helm install --name test test --debug

This is my helm template to create secret:

    apiVersion: v1
    kind: Secret
    metadata:
      name: {{ $.Release.Name }}-secrets
      labels:
        chart:    {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
        release:  {{ $.Release.Name }}
        heritage: {{ $.Release.Service }}
    data:
    {{- range $key, $val := .Values.secrets }}
      {{ $key }}: |-
    {{ $val | indent 4}}
    {{- end }}

But When i run kubectl get secrets I see that my secret named test-secrets was created successfully. And when I use kubectl describe I even see the content.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 45
  • Comments: 56 (12 by maintainers)

Commits related to this issue

Most upvoted comments

As there are not so many people raising this issue it’s been neglected till now… I hope someone sees it and take some action. I’ll see if I can do anything to fix it.

HI @bradleyd, this issue happens for :

  1. secrets
  2. Configmaps
  3. jobs
  4. cronjobs

It’s not a big issue but it is quite annoying

I am hitting this problem - I have a couple Charts all which share the same Secret and my initial plan was to create a Chart just for those Secrets, but then I hit the error described in the original post. I imagine this must be a common scenario with multiple Pods sharing the same Secret - what is the advised practice for this in Helm 3?

I just deleted all the “+1” comments in this thread. In the future, please add a 👍 to the OP instead. That way we can keep the discussion moving forward without a bunch of +1 comments flooding the thread. Thanks!

Not stale annoying bot.

As a workaround just define dummy service i.e.

apiVersion: v1
metadata:
 name: google
spec:
 type: ExternalName
 externalName: google.com```

@bacongobbler my use case doesn’t involve hooks or anything like that so this may be an outlier. I just want to be able to install CRDs individually without any other necessary resources in the templates directory as mentioned in #7247. This is part of a work around due to #6581 where I am unable to put new crd versions in the same chart. I would expect this to be possible without an error since a chart can contain arbitrary kubernetes resources. This is occurring with helm3 for additional context.

This particular error occurs when a chart does not define any templates.

If I’m understanding the reports here, are all the resources within the chart are marked as a hook? Hooks are considered “un-managed” by tiller. If everything is marked as a hook and there are no other objects to install, that would definitely trigger this error.

I’m not sure if that would be considered a bug though given that this was an intentional design decision. What’s the use case here for having a chart with only hooks but no resources?

Thanks for confirming. I’ll close this issue then.

I’m having the same issue with the Hook for a Job. I need to create a Job and wait for it’s completion, but I can’t do this with the --wait flag, since it doesn’t work for a Job. When I switched to setting a Job with the Hook, I came into this problem. What is the workaround? P.S. Users are weird sometimes and we need strange use-cases, such as a Job creation in a separate deployment flow. Sorry for that 😃 But since it is allowed by Helm to have different resources deployed separately, it would be good to have a workaround for such kind of issues.

I’m hitting the same issue when trying to install a chart, which only installs the CRDs from crds directory.

@Krishna1408 @bradleyd I had the same issue with the error “failed: no objects visited” trying to create secrets by helm. After removing unused annotations the deployment works with following version:

Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

Annotations removed:

annotations:
    "helm.sh/resource-policy": keep
    "helm.sh/hook": pre-install,pre-upgrade

helm upgrade --install ...