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

istioctl analyze invalid memory address or nil pointer dereference #44318

Closed
14 tasks
gojanpaolo opened this issue Apr 10, 2023 · 5 comments
Closed
14 tasks

istioctl analyze invalid memory address or nil pointer dereference #44318

gojanpaolo opened this issue Apr 10, 2023 · 5 comments

Comments

@gojanpaolo
Copy link

gojanpaolo commented Apr 10, 2023

Bug Description

Hello, we're getting the following error when running istioctl analyze. How do we troubleshoot the issue? Thank you!

$ istioctl analyze
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x263941a]

goroutine 1 [running]:
istio.io/istio/pkg/config/analysis/analyzers/gateway.initGatewaysMap.func1(0x2b566c0)
        istio.io/istio/pkg/config/analysis/analyzers/gateway/conflictinggateway.go:133 +0x11a
istio.io/istio/pkg/config/analysis/local.(*istiodContext).ForEach(0xc00146fbd0, {0x31ecea5, 0x22}, 0xc01b51ae20)
        istio.io/istio/pkg/config/analysis/local/context.go:104 +0x768
istio.io/istio/pkg/config/analysis/analyzers/gateway.initGatewaysMap({0x3830b18, 0xc00146fbd0})
        istio.io/istio/pkg/config/analysis/analyzers/gateway/conflictinggateway.go:126 +0xa2
istio.io/istio/pkg/config/analysis/analyzers/gateway.(*ConflictingGatewayAnalyzer).Analyze(0x5bfe9d0, {0x3830b18, 0xc00146fbd0})
        istio.io/istio/pkg/config/analysis/analyzers/gateway/conflictinggateway.go:53 +0x37
istio.io/istio/pkg/config/analysis.(*CombinedAnalyzer).Analyze(0xc000c7dc20, {0x3830b18, 0xc00146fbd0})
        istio.io/istio/pkg/config/analysis/analyzer.go:60 +0x1cd
istio.io/istio/pkg/config/analysis/local.(*IstiodAnalyzer).ReAnalyze(0xc000cc4c30, 0xc0004d5200)
        istio.io/istio/pkg/config/analysis/local/istiod_analyze.go:135 +0x2eb
istio.io/istio/pkg/config/analysis/local.(*IstiodAnalyzer).Analyze(0xc0007acc60, 0x3199d6c)
        istio.io/istio/pkg/config/analysis/local/istiod_analyze.go:154 +0xfd
istio.io/istio/istioctl/cmd.Analyze.func1(0xc000c12000, {0x5bfe9d0, 0x0, 0x0})
        istio.io/istio/istioctl/cmd/analyze.go:218 +0x775
github.com/spf13/cobra.(*Command).execute(0xc000c12000, {0x5bfe9d0, 0x0, 0x0})
        github.com/spf13/cobra@v1.4.0/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc0005afb80)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.4.0/command.go:902
main.main()
        istio.io/istio/istioctl/cmd/istioctl/main.go:39 +0xde

Version

$ istioctl version
client version: 1.13.9
control plane version: 1.13.9
data plane version: 1.13.9 (1413 proxies), 1.14.6 (155 proxies)

$ kubectl version --short
Client Version: v1.25.2
Kustomize Version: v4.5.7
Server Version: v1.23.14-gke.1800
WARNING: version difference between client (1.25) and server (1.23) exceeds the supported minor version skew of +/-1

$ helm version --short
v3.7.0+geeac838

Additional Information

No response

Affected product area

  • Ambient
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Extensions and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure
  • Upgrade
  • Multi Cluster
  • Virtual Machine
  • Control Plane Revisions
@gojanpaolo
Copy link
Author

Looks like the problem is one of the configs in our gateway because I was able to istioctl analyze when I removed that block. Closing issue. Will post correct solution later

@keithmattix
Copy link
Contributor

I had a feeling it was a config issue; regardless, istioctl analyze shouldn't panic. I suspect there's just a nil check missing somewhere. Reopening, but @gojanpaolo please do respond with the config block that caused the error

@keithmattix keithmattix reopened this Apr 10, 2023
@gojanpaolo
Copy link
Author

It was a Server missing its port definition

- hosts:
  - confluent.svc.cluster.local
  - '*.confluent.svc.cluster.local'
  tls:
    mode: PASSTHROUGH

Corrected to

- hosts:
  - confluent.svc.cluster.local
  - '*.confluent.svc.cluster.local'
  port:
    name: http
    number: 8090
    protocol: http
  tls:
    mode: PASSTHROUGH

@hanxiaop
Copy link
Member

Fixed by #44321

@nicole-lihui
Copy link
Member

add fixed by #44476

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

No branches or pull requests

4 participants