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

Can not analyze EKS: invalid memory address or nil pointer dereference #566

Closed
3 of 4 tasks
raulmartinezr opened this issue Jul 20, 2023 · 2 comments
Closed
3 of 4 tasks

Comments

@raulmartinezr
Copy link

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

k8sgpt: 0.3.12 (9d2bee9), built at: unknown

Kubernetes Version

No response

Host OS and its Version

Ubuntu 22.04

Steps to reproduce

1.- k8sgpt installed following the instructions for Ubuntu based systems (k8sgpt_amd64.deb)
2.- OpenAI aoikey added with: k8sgpt auth add --backend openai -m gpt-3.5-turbo
3.- Kubecondig refreshed with aws eks cli: aws eks update-kubeconfig
4.- Analysis triggered:  k8sgpt analyze

Expected behaviour

k8s analyzes EKS cluster and results are obtained

Actual behaviour

Suddenly an error ir raised:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1e7dc4a]

goroutine 78 [running]:
github.com/k8sgpt-ai/k8sgpt/pkg/analyzer.MutatingWebhookAnalyzer.Analyze({}, {0xc000b8e300, {0x2c3f640, 0xc00012e018}, {0x0, 0x0}, {0x2c3fd78, 0x3f76e40}, 0x0, {0x0, ...}, ...})
	/home/runner/work/k8sgpt/k8sgpt/pkg/analyzer/mutating_webhook.go:58 +0x60a
github.com/k8sgpt-ai/k8sgpt/pkg/analysis.(*Analysis).RunAnalysis.func1({0x2c24160, 0x3fb63d8}, 0xc0009ef670?, 0x6?)
	/home/runner/work/k8sgpt/k8sgpt/pkg/analysis/analysis.go:171 +0xd8
created by github.com/k8sgpt-ai/k8sgpt/pkg/analysis.(*Analysis).RunAnalysis
	/home/runner/work/k8sgpt/k8sgpt/pkg/analysis/analysis.go:169 +0xa1d

Additional Information

KubeConfig contents. Kubectl working properly with it

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: CA Content..
    server: https://C8239EF7106434D729A7370A4FB7FBEC.gr7.eu-west-1.eks.amazonaws.com
  name: arn:aws:eks:eu-west-1:562348615205:cluster/tests_kubedapr-eu-west-1-eks-a257c3
- cluster:
    certificate-authority-data: CA Content..
    server: https://B548A5671FACA20E095BE3560FA461D4.gr7.eu-west-1.eks.amazonaws.com
  name: arn:aws:eks:eu-west-1:562348615205:cluster/eks-tests-kubedapr-eu-west-1-a257c3
- cluster:
    certificate-authority-data: CA Content..
    server: https://18340870F12F460368AC8CB2C85E2B9A.sk1.eu-west-1.eks.amazonaws.com
  name: arn:aws:eks:eu-west-1:562348615205:cluster/kube-kubedapr-eu-west-1-a257
contexts:
- context:
    cluster: arn:aws:eks:eu-west-1:562348615205:cluster/tests_kubedapr-eu-west-1-eks-a257c3
    user: arn:aws:eks:eu-west-1:562348615205:cluster/tests_kubedapr-eu-west-1-eks-a257c3
  name: tests_kubedapr-eu-west-1-eks-a257c3
- context:
    cluster: arn:aws:eks:eu-west-1:562348615205:cluster/eks-tests-kubedapr-eu-west-1-a257c3
    user: arn:aws:eks:eu-west-1:562348615205:cluster/eks-tests-kubedapr-eu-west-1-a257c3
  name: eks-tests-kubedapr-eu-west-1-a257c3
- context:
    cluster: arn:aws:eks:eu-west-1:562348615205:cluster/kube-kubedapr-eu-west-1-a257
    user: arn:aws:eks:eu-west-1:562348615205:cluster/kube-kubedapr-eu-west-1-a257
  name: kube-kubedapr-eu-west-1-a257
current-context: kube-kubedapr-eu-west-1-a257
kind: Config
preferences: {}
users:
- name: arn:aws:eks:eu-west-1:562348615205:cluster/tests_kubedapr-eu-west-1-eks-a257c3
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - --region
      - eu-west-1
      - eks
      - get-token
      - --cluster-name
      - tests_kubedapr-eu-west-1-eks-a257c3
      - --output
      - json
      command: aws
      env:
      - name: AWS_PROFILE
        value: play
- name: arn:aws:eks:eu-west-1:562348615205:cluster/eks-tests-kubedapr-eu-west-1-a257c3
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - --region
      - eu-west-1
      - eks
      - get-token
      - --cluster-name
      - eks-tests-kubedapr-eu-west-1-a257c3
      - --output
      - json
      command: aws
      env:
      - name: AWS_PROFILE
        value: play
- name: arn:aws:eks:eu-west-1:562348615205:cluster/kube-kubedapr-eu-west-1-a257
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - --region
      - eu-west-1
      - eks
      - get-token
      - --cluster-name
      - kube-kubedapr-eu-west-1-a257
      - --output
      - json
      command: aws
      env:
      - name: AWS_PROFILE
        value: play
@arbreezy
Copy link
Member

it's most likely happening, cause one of your mutating webhooks are missing the service attribute, try to de activate the mutating-webhook analyser until we throw a new release.

@AlexsJones
Copy link
Member

Please upgrade to https://github.com/k8sgpt-ai/k8sgpt/releases/tag/v0.3.13

brew upgrade k8sgpt which has fixes for this

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

No branches or pull requests

3 participants