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

Error with panos.go functions #24

Open
Alfredo-Moreira opened this issue Jan 3, 2024 · 0 comments
Open

Error with panos.go functions #24

Alfredo-Moreira opened this issue Jan 3, 2024 · 0 comments

Comments

@Alfredo-Moreira
Copy link

Most functions in the file panos.go are instantiated the same way. Specifically this section, using one of functions as example:

_, iCancel := context.WithCancel(ctx)
	defer iCancel()
	var interfaceResponse ManagementInterfaceResponse
	command := "<show><interface>management</interface></show>"
	_, res, errs := r.Get(fmt.Sprintf("%s&key=%s&type=op&cmd=%s", p.URI, p.Key, command)).End()
	if errs != nil {
		return interfaceResponse, checkErrors(errs)
	}

	err := xml.Unmarshal([]byte(res), &interfaceResponse)
	if err != nil {
		return interfaceResponse, err
	}
	return interfaceResponse, nil

Running this on our EKS I'm seeing numerous restarts. In the hundreds.

This is a stacktrace of the errors I'm seeing:

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

goroutine 59092 [running]:
strings.indexFunc(...)
	/usr/local/go/src/strings/strings.go:777
strings.IndexFunc({0x0, 0x3}, 0x9b5ba8)
	/usr/local/go/src/strings/strings.go:764 +0x4a
net/http.validMethod(...)
	/usr/local/go/src/net/http/request.go:826
net/http.NewRequestWithContext({0xa42a18?, 0xc0000ce000}, {0x0?, 0x0?}, {0xc0003e8140?, 0x13b?}, {0x0, 0x0?})
	/usr/local/go/src/net/http/request.go:863 +0xb2
net/http.NewRequest(...)
	/usr/local/go/src/net/http/request.go:831
github.com/parnurzeal/gorequest.(*SuperAgent).MakeRequest(0xc0000e2580)
	/go/pkg/mod/github.com/parnurzeal/gorequest@v0.2.16/gorequest.go:1356 +0x805
github.com/parnurzeal/gorequest.(*SuperAgent).getResponseBytes(0xc0000e2580)
	/go/pkg/mod/github.com/parnurzeal/gorequest@v0.2.16/gorequest.go:1167 +0x2c5
github.com/parnurzeal/gorequest.(*SuperAgent).EndBytes(0xc0000e2580, {0x0, 0x0, 0xc000715bf0?})
	/go/pkg/mod/github.com/parnurzeal/gorequest@v0.2.16/gorequest.go:1083 +0x4f
github.com/parnurzeal/gorequest.(*SuperAgent).End(0xc0000e2580?, {0x0?, 0x13b?, 0x3?})
	/go/pkg/mod/github.com/parnurzeal/gorequest@v0.2.16/gorequest.go:1068 +0x7a
github.airbnb.biz/Airbnb-ITX/panos-exporter/panos.(*PaloAlto).GetDataProcessorsResourceUtilData(0xc0000de480, {0xa429e0?, 0xc000162080?})
	/app/panos/panos.go:559 +0x171
github.airbnb.biz/Airbnb-ITX/panos-exporter/collector.(*DataProcessorResourceUtilCollector).Collect(0xc00054f080, 0x0?)
	/app/collector/data_processor_resource_utilization_collector.go:57 +0xec
github.airbnb.biz/Airbnb-ITX/panos-exporter/collector.(*PanosCollector).Collect.func1({0xa40708?, 0xc00054f080?})
	/app/collector/panos_collector.go:121 +0x6d
created by github.airbnb.biz/Airbnb-ITX/panos-exporter/collector.(*PanosCollector).Collect
	/app/collector/panos_collector.go:119 +0x316

And the error will not occur in only one function like GetDataProcessorsResourceUtilData. I have witnessed it happen in different functions described in the file.

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

1 participant