Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart upgrade failed 'could not get information about the resource ValidatingWebhookConfiguration' #10733

Closed
mtovmassian opened this issue Dec 7, 2023 · 8 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@mtovmassian
Copy link

What happened:

I tried to upgrade my ingress-nginx helm chart from v4.8.3 to v4.8.4 with this command:

    helm upgrade \
        --reuse-values \
        --set controller.admissionWebhooks.patch.networkPolicy.enabled=false \
        --version 4.8.4 \
        --namespace ingress-nginx \
        ingress-nginx \
        ingress-nginx/ingress-nginx 

NB. I set the controller.admissionWebhooks.patch.networkPolicy.enabled field since it is now required in the networkpolicy.yaml file.

And I got this error / debug stack trace:

upgrade.go:153: [debug] preparing upgrade for ingress-nginx
upgrade.go:540: [debug] reusing the old release's values
upgrade.go:161: [debug] performing update for ingress-nginx
Error: UPGRADE FAILED: Unable to continue with update: could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace "": invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
helm.go:84: [debug] invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace ""
helm.sh/helm/v3/pkg/action.existingResourceConflict.func1
        helm.sh/helm/v3/pkg/action/validate.go:54
helm.sh/helm/v3/pkg/kube.ResourceList.Visit
        helm.sh/helm/v3/pkg/kube/resource.go:32
helm.sh/helm/v3/pkg/action.existingResourceConflict
        helm.sh/helm/v3/pkg/action/validate.go:43
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:330
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
Unable to continue with update
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:332
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
UPGRADE FAILED
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:229
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598

NGINX Ingress controller version:

-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       v1.8.0
  Build:         35f5082ee7f211555aaff431d7c4423c17f8ce9e
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.21.6

-------------------------------------------------------------------------------

Kubernetes version:

clientVersion:
  buildDate: "2023-06-14T09:56:58Z"
  compiler: gc
  gitCommit: 11902a838028edef305dfe2f96be929bc4d114d8
  gitTreeState: clean
  gitVersion: v1.26.6
  goVersion: go1.19.10
  major: "1"
  minor: "26"
  platform: linux/amd64
kustomizeVersion: v4.5.7
serverVersion:
  buildDate: "2023-07-17T09:24:53Z"
  compiler: gc
  gitCommit: 050932de5e9f5f588e3e912efcaee2616df0a8fc
  gitTreeState: clean
  gitVersion: v1.26.6-gke.1700
  goVersion: go1.19.10 X:boringcrypto
  major: "1"
  minor: "26"
  platform: linux/amd64

Environment:

  • Cloud provider or hardware configuration: GCP

  • OS (client): Ubuntu 22.04.3 LTS

  • Kernel (client): 6.2.0-37-generic

  • How was the ingress-nginx-controller installed:

    • Helm release
      ingress-nginx ingress-nginx 15 2023-12-06 10:28:55.590059964 +0100 CET deployed ingress-nginx-4.8.3 1.9.4
    • Helm values
USER-SUPPLIED VALUES:
controller:
 admissionWebhooks:
   patch:
     networkPolicy:
       enabled: false
 networkPolicy:
   enabled: false
 service:
   loadBalancerIP: x.x.x.x
rbac:
 create: true
@mtovmassian mtovmassian added the kind/bug Categorizes issue or PR as related to a bug. label Dec 7, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 7, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mtovmassian
Copy link
Author

It does not seem to be related to my GKE configuration/environment.

I tested the upgrade within a fresh minikube envrionment by applying these steps:

  1. Install ingress-nginx v4.8.3:
helm upgrade \
    --install \
    --version 4.8.3 \
    --namespace \
    ingress-nginx \
    --create-namespace \
    ingress-nginx ingress-nginx/ingress-nginx
  1. ingress-nginx installed and running
  2. Upgrade ingress-nginx to v4.8.4:
helm upgrade \
    --debug \
    --reuse-values \
    --set controller.admissionWebhooks.patch.networkPolicy.enabled=false \
    --version 4.8.4 \
    --namespace ingress-nginx \
    ingress-nginx \
    ingress-nginx/ingress-nginx
  1. Same error:
upgrade.go:153: [debug] preparing upgrade for ingress-nginx
upgrade.go:540: [debug] reusing the old release's values
upgrade.go:161: [debug] performing update for ingress-nginx
Error: UPGRADE FAILED: Unable to continue with update: could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace "": invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
helm.go:84: [debug] invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace ""
helm.sh/helm/v3/pkg/action.existingResourceConflict.func1
        helm.sh/helm/v3/pkg/action/validate.go:54
helm.sh/helm/v3/pkg/kube.ResourceList.Visit
        helm.sh/helm/v3/pkg/kube/resource.go:32
helm.sh/helm/v3/pkg/action.existingResourceConflict
        helm.sh/helm/v3/pkg/action/validate.go:43
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:330
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
Unable to continue with update
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:332
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
UPGRADE FAILED
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:229
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598

@strongjz
Copy link
Member

please downgrade to 4.8.3, 4.8.4 was a mistaken release. Please report back if you have issues with 4.8.3

/close

@k8s-ci-robot
Copy link
Contributor

@strongjz: Closing this issue.

In response to this:

please downgrade to 4.8.3, 4.8.4 was a mistaken release. Please report back if you have issues with 4.8.3

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mtovmassian
Copy link
Author

mtovmassian commented Jan 30, 2024

@strongjz just for information I keep getting the same error while upgrading from v4.8.3 to v4.9.1 .
Command:

helm upgrade \
    --debug \
    --reuse-values \
    --set controller.admissionWebhooks.patch.networkPolicy.enabled=false \
    --version 4.9.1 \
    --namespace ingress-nginx \
    ingress-nginx \
    ingress-nginx/ingress-nginx

Error:

upgrade.go:153: [debug] preparing upgrade for ingress-nginx
upgrade.go:540: [debug] reusing the old release's values
upgrade.go:161: [debug] performing update for ingress-nginx
Error: UPGRADE FAILED: Unable to continue with update: could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace "": invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
helm.go:84: [debug] invalid resource name "ingress-nginx-%!s(<nil>)": [may not contain '%']
could not get information about the resource ValidatingWebhookConfiguration "ingress-nginx-%!s(<nil>)" in namespace ""
helm.sh/helm/v3/pkg/action.existingResourceConflict.func1
        helm.sh/helm/v3/pkg/action/validate.go:54
helm.sh/helm/v3/pkg/kube.ResourceList.Visit
        helm.sh/helm/v3/pkg/kube/resource.go:32
helm.sh/helm/v3/pkg/action.existingResourceConflict
        helm.sh/helm/v3/pkg/action/validate.go:43
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:330
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
Unable to continue with update
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
        helm.sh/helm/v3/pkg/action/upgrade.go:332
helm.sh/helm/v3/pkg/action.(*Upgrade).RunWithContext
        helm.sh/helm/v3/pkg/action/upgrade.go:162
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:227
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598
UPGRADE FAILED
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:229
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:940
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1068
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:992
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:250
runtime.goexit
        runtime/asm_amd64.s:1598

But at least I found a workaround by getting rid of the --reuse-values flag and re-setting the previous values with the --set flag.

@avodaqstephan
Copy link

I'm running into the same issue. I wanted to upgrade from helm chart version ingress-nginx-4.7.1 to ingress-nginx-4.9.1.

Same command, same error as @mtovmassian so I won't copy paste the debug output again.

@strongjz Can we re-open that issue or shall I create a new one?

@mtovmassian
Copy link
Author

@avodaqstephan did your upgrade command used the --reuse-values flag too?

@avodaqstephan
Copy link

avodaqstephan commented Feb 1, 2024

Yes. In my case I needed to set two options to false. Then I end up with the same error message your already posted.

helm upgrade ingress-nginx ingress-nginx/ingress-nginx --version 4.9.1 --reuse-values --set controller.admissionWebhooks.patch.networkPolicy.enabled=false --set controller.networkPolicy.enabled=false --namespace ingress-nginx

Edit: Ah, I missed the last sentence of your previous post with the workaround. I'll try that.

Edit2: That worked. I exported my current values to a yaml, added the two networkPolicy settings and made the upgrade with my vaule file instead of the --reuse-values flag. This worked.

  1. helm get values ingress-nginx -n ingress-nginx > current_values.yaml
  2. Add the networkPolicy settings
  3. helm upgrade --version 4.9.1 -f current_values.yaml --namespace ingress-nginx ingress-nginx ingress-nginx/ingress-nginx

Thank you @mtovmassian for the heads-up. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Archived in project
Development

No branches or pull requests

4 participants