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

[bigquery] notifier crashes with panic nil dereference #110

Closed
devjgm opened this issue May 21, 2021 · 1 comment
Closed

[bigquery] notifier crashes with panic nil dereference #110

devjgm opened this issue May 21, 2021 · 1 comment

Comments

@devjgm
Copy link

devjgm commented May 21, 2021

I'm using the BigQuery notifier, and it works sometimes but seems to crash often w/ the following stack trace:

2021/05/21 19:16:54 http: panic serving 169.254.8.129:39528: runtime error: invalid memory address or nil pointer dereference
goroutine 49 [running]:
net/http.(*conn).serve.func1(0xc0003c0e60)
	/usr/local/go/src/net/http/server.go:1824 +0x153
panic(0xd78aa0, 0x1592d30)
	/usr/local/go/src/runtime/panic.go:971 +0x499
main.(*bqNotifier).SendNotification(0xc0003d2d50, 0xff2320, 0xc0001cc240, 0xc000231500, 0x2928, 0x3000)
	/go-src/bigquery/main.go:238 +0x846
github.com/GoogleCloudPlatform/cloud-build-notifiers/lib/notifiers.newReceiver.func1(0xff09c0, 0xc000337260, 0xc000460200)
	/go-src/lib/notifiers/notifiers.go:448 +0x938
net/http.HandlerFunc.ServeHTTP(0xc0005e0ea0, 0xff09c0, 0xc000337260, 0xc000460200)
	/usr/local/go/src/net/http/server.go:2069 +0x44
net/http.(*ServeMux).ServeHTTP(0x15af920, 0xff09c0, 0xc000337260, 0xc000460200)
	/usr/local/go/src/net/http/server.go:2448 +0x1ad
net/http.serverHandler.ServeHTTP(0xc000337180, 0xff09c0, 0xc000337260, 0xc000460200)
	/usr/local/go/src/net/http/server.go:2887 +0xa3
net/http.(*conn).serve(0xc0003c0e60, 0xff23c8, 0xc0001cc180)
	/usr/local/go/src/net/http/server.go:1952 +0x8cd
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3013 +0x39b 

The config file I'm using is:

apiVersion: cloud-build-notifiers/v1
kind: BigQueryNotifier
metadata:
  name: google-cloud-cpp-bigquery-notifier
spec:
  notification:
    filter: build.substitutions["REPO_NAME"] == "google-cloud-cpp"
    delivery:
      table: projects/936212892354/datasets/cloudbuild/tables/google_cloud_cpp

My project is tracking this bug at googleapis/google-cloud-cpp#6580.

@devjgm
Copy link
Author

devjgm commented May 27, 2021

@prabenzom fixed this panic with ac220ae#diff-243269b0805de328ce233361b6a6e94d971e1d18e7727433c832fd42e4c19f28

It looks like the issue was that some build notifications do not contain steps.Timing information, so directly referencing those fields was causing the nil dereference panic. FWIW, I seems like most/all non-SUCCESS build notifications are missing that timing information, so the end result is that the BQ data is missing nearly all of that data.

There's a new problem now, but I'll open a new issue for that.

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