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

Crash: Cannot read properties of null (reading '.garden') #5303

Closed
glodean19 opened this issue Oct 25, 2023 · 2 comments · Fixed by #5307
Closed

Crash: Cannot read properties of null (reading '.garden') #5303

glodean19 opened this issue Oct 25, 2023 · 2 comments · Fixed by #5307
Assignees

Comments

@glodean19
Copy link

Hey guys,

Just to say, I was running deploy and then I had this issue at this point:
ℹ deploy.default-backend → Already deployed
ℹ deploy.ingress-controller → missing
ℹ deploy.ingress-controller → Deploying version v-8286b84dfa...
✖ deploy.ingress-controller → Failed (took 0.1 sec)
✖ deploy.ingress-controller → Failed processing Deploy type=helm name=ingress-controller (took 0.22 sec). This is what happened:

Encountered an unexpected Garden error. This is likely a bug 🍂

You can help by reporting this on GitHub: https://github.com/garden-io/garden/issues/new?labels=bug,crash&template=CRASH.md&title=Crash%3A%20Cannot%20read%20properties%20of%20null%20(reading%20%27.garden%27)

Please attach the following information to the bug report after making sure that the error message does not contain sensitive information:

Failed processing Deploy type=helm name=ingress-controller (took 0.22 sec). This is what happened:
TypeError: Cannot read properties of null (reading '.garden')
at getReleaseStatus (/snapshot/pkg/core/build/src/plugins/kubernetes/helm/status.js:155:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.helmDeploy (/snapshot/pkg/core/build/src/plugins/kubernetes/helm/deployment.js:46:27)
at async /snapshot/pkg/core/build/src/router/base.js:202:28
at async Router.callHandler (/snapshot/pkg/core/build/src/router/base.js:173:24)
at async deploy (/snapshot/pkg/core/build/src/router/deploy.js:40:24)
at async DeployTask.process (/snapshot/pkg/core/build/src/tasks/deploy.js:89:28)
at async DeployTask. (/snapshot/pkg/core/build/src/tasks/base.js:319:29)
at async /snapshot/pkg/core/build/src/util/open-telemetry/decorators.js:47:30
at async ProcessTaskNode.execute (/snapshot/pkg/core/build/src/graph/nodes.js:214:35)
at async GraphSolver.processNode (/snapshot/pkg/core/build/src/graph/solver.js:281:35)

I had installed again garden-nginx because the deployment of ingress controller was encountering issues and I used this command:

helm install garden-nginx ingress-nginx/ingress-nginx -n garden-system --version 4.0.13

I use Ubuntu 22.04, Minikube and garden version: 0.13.18. The issue happened when I run the deployment and it seemed related to Helms release "garden-nginx" in the namespace "garden-system". Kubernetes and Minikube statuses are ok. The issues seems resolved when I installed the update helm for metricbeat, filebeat and mongdb. I used garden validate and garden logs for help.

Thank you!

@twelvemo
Copy link
Collaborator

Hi @glodean19 ! Thanks for reporting!
The issue here results from installing the nginx ingress controller helm chart outside of garden. When we deploy helm charts with garden we add some custom values to track changes. If you want to get back to a working state uninstall the manually installed nginx controller in the garden-system namespace and run garden again ( you can add the --force-refresh option to make sure the providers get reinitialized). Garden should take care to install the chart again.
Another option would be to disable the garden nginx controller in your project.garden.yaml by setting setupIngressController: false see here. This is the way to tell garden that it should not install the ingress controller for you and you are managing it on your own.

In either case, we should've handled the issue more gracefully and @vvagaytsev opened a PR for that.

Finally there is the question why garden tried to install the helm chart in the first place, since for minikube we usually enable the native minikube ingress addon. What is the name of your kubecontext if i may ask?

@glodean19
Copy link
Author

@twelvemo thanks for replying me. As I'm pretty new to devops and kubernetes, I first tried with docker desktop but then I changed for minikube. Not sure if Garden's behaviour depends by the local kubernetes. I'm still trying to configuring minikube though.

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

Successfully merging a pull request may close this issue.

3 participants