Skip to content

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

Closed

Description

@Krishna1408

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.

Activity

  1. changed the title [-][BUG] no objects visited error when creating secret only[/-] [+][BUG] no objects visited error when creating only secrets via helm[/+] on Sep 19, 2018
  2. changed the title [-][BUG] no objects visited error when creating only secrets via helm[/-] [+][BUG] "failed: no objects visited" error when creating only secrets via helm[/+] on Sep 19, 2018
  3. bradleyd commented on Oct 31, 2018

    @bradleyd

    FWIW, am seeing the same with a Job instead of secrets. I am using helm

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

    I am using hooks as well.

      annotations:
        "helm.sh/hook-weight": "100"
        "helm.sh/hook": post-install,post-upgrade
        "helm.sh/hook-delete-policy": before-hook-creation
    

    I have another chart that does almost the same thing but I do not get the error output like

    Release "dbmigrate" has been upgraded. Happy Helming!
    Error: no objects visited
    

    thanks

  4. Krishna1408 commented on Oct 31, 2018

    @Krishna1408
    Author

    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

  5. bradleyd commented on Oct 31, 2018

    @bradleyd

    @Krishna1408 thanks for the quick response. Yeah it was failing our jenkins job until i realized it is "harmless". I just added a || true to the end for now until a fix is in.

  6. StephGit commented on Dec 5, 2018

    @StephGit

    @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 ...

  7. Krishna1408 commented on Dec 5, 2018

    @Krishna1408
    Author

    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.

  8. jesseeichar commented on Jan 1, 2019

    @jesseeichar

    This is an issue for me as well. I want to deploy a job, some roles (and a few other objects_ to perform some tasks, but since there is no deployment, statefulset, etc... the helm install fails. As a work around I'm looking at having to create a deployment that does essentially nothing.

  9. Jean85 commented on Mar 14, 2019

    @Jean85

    Can someone re-label this issue as a bug? It renders impossible to use jobs as hooks as documented here

  10. added
    bug
    and removed on Mar 14, 2019
  11. bacongobbler commented on Mar 14, 2019

    @bacongobbler
    Member

    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?

  12. added and removed
    bug
    on Mar 14, 2019
  13. 59 remaining items

  14. cdenneen commented on May 27, 2021

    @cdenneen

    /remove-lifecycle stale

  15. github-actions commented on Aug 27, 2021

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  16. invidian commented on Aug 27, 2021

    @invidian

    Not stale

  17. github-actions commented on Nov 26, 2021

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  18. invidian commented on Nov 26, 2021

    @invidian

    Not stale

  19. joejulian commented on Jan 13, 2022

    @joejulian
    Contributor

    Helm 2 is no longer supported.

    Helm 3:
    Per the description I created a chart (helm create chart foo). In that chart I removed everything under templates and created a single template file:

    templates/secret.yaml

    ---
    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 }}
    

    I set the chart's values.yaml as specified in the issue description:

    values.yaml

    ---
    secrets:
      test: YmFzZWw=
    

    Then install it

    helm install foo foo
    
    NAME: foo
    LAST DEPLOYED: Thu Jan 13 10:56:48 2022
    NAMESPACE: default
    STATUS: deployed
    REVISION: 1
    TEST SUITE: None
    

    Is this issue still valid for helm 3?

  20. joejulian commented on Jan 13, 2022

    @joejulian
    Contributor

    Also tried with making it a hook with no error:

    templates/secret.yaml

    ---
    apiVersion: v1
    kind: Secret
    metadata:
      annotations:
        helm.sh/hook: "pre-install,pre-upgrade"
        helm.sh/hook-delete-policy: "before-hook-creation"
      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 }}
    
  21. invidian commented on Jan 14, 2022

    @invidian

    With the following Helm version:

    $ helm version
    version.BuildInfo{Version:"v3.7.2", GitCommit:"663a896f4a815053445eec4153677ddc24a0a361", GitTreeState:"clean", GoVersion:"go1.17.4"}
    

    And following reproducing steps:

    helm create foo
    cd foo && rm -r ./templates
    mkdir -p ./crds/
    cat <<EOF > ./crds/test.yaml
    apiVersion: apiextensions.k8s.io/v1
    kind: CustomResourceDefinition
    metadata:
      # name must match the spec fields below, and be in the form: <plural>.<group>
      name: crontabs.stable.example.com
    spec:
      # group name to use for REST API: /apis/<group>/<version>
      group: stable.example.com
      # list of versions supported by this CustomResourceDefinition
      versions:
        - name: v1
          # Each version can be enabled/disabled by Served flag.
          served: true
          # One and only one version must be marked as the storage version.
          storage: true
          schema:
            openAPIV3Schema:
              type: object
              properties:
                spec:
                  type: object
                  properties:
                    cronSpec:
                      type: string
                    image:
                      type: string
                    replicas:
                      type: integer
      # either Namespaced or Cluster
      scope: Namespaced
      names:
        # plural name to be used in the URL: /apis/<group>/<version>/<plural>
        plural: crontabs
        # singular name to be used as an alias on the CLI and for display
        singular: crontab
        # kind is normally the CamelCased singular type. Your resource manifests use this.
        kind: CronTab
        # shortNames allow shorter string to match your resource on the CLI
        shortNames:
        - ct
    EOF
    helm install test .

    I no longer get any warnings or errors!

  22. joejulian commented on Mar 17, 2022

    @joejulian
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions