ti-community-infra / tichi

TiChi ☯️ contains the tidb community collaboration automation basic framework and tool set.
https://prow.tidb.net
Apache License 2.0
45 stars 27 forks source link

cherry-pick invite crashed #1131

Closed wuhuizuo closed 1 year ago

wuhuizuo commented 1 year ago

Bug Report

{"client":"github","file":"/home/runner/go/pkg/mod/k8s.io/test-infra@v0.0.0-20221207211222-8949d0ab2096/prow/github/client.go:917","func":"k8s.io/test-infra/prow/github.(*client).log","level":"info","msg":"ListCollaborators(ti-chi-bot, tidb)","time":"2022-12-22T09:49:07Z"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x17e4254]

goroutine 688 [running]:
main.oauth2TokenSource.Token(0xc000838ab0?)
        /home/runner/work/tichi/tichi/cmd/ticommunitycherrypicker/github.go:23 +0x14
golang.org/x/oauth2.(*reuseTokenSource).Token(0xc0001b6420)
        /home/runner/go/pkg/mod/golang.org/x/oauth2@v0.3.0/oauth2.go:304 +0xd5
golang.org/x/oauth2.(*Transport).RoundTrip(0xc0001b6460, 0xc000378b00)
        /home/runner/go/pkg/mod/golang.org/x/oauth2@v0.3.0/transport.go:45 +0xd6
net/http.send(0xc000378b00, {0x1fb7ce0, 0xc0001b6460}, {0x1be6d60?, 0x1?, 0x0?})
        /opt/hostedtoolcache/go/1.18.8/x64/src/net/http/client.go:252 +0x5d8
net/http.(*Client).send(0xc000824c60, 0xc000378b00, {0x203000?, 0x203000?, 0x0?})
        /opt/hostedtoolcache/go/1.18.8/x64/src/net/http/client.go:176 +0x9b
net/http.(*Client).do(0xc000824c60, 0xc000378b00)
        /opt/hostedtoolcache/go/1.18.8/x64/src/net/http/client.go:725 +0x8f5
net/http.(*Client).Do(...)
        /opt/hostedtoolcache/go/1.18.8/x64/src/net/http/client.go:593
github.com/google/go-github/v29/github.(*Client).Do(0xc000264000, {0x1fd2c78, 0xc000358540}, 0xc000378a00, {0x189c300, 0xc0001a2690})
        /home/runner/go/pkg/mod/github.com/google/go-github/v29@v29.0.3/github/github.go:533 +0x378
github.com/google/go-github/v29/github.(*RepositoriesService).ListInvitations(0xc000264088, {0x1fd2c78, 0xc000358540}, {0xc00082c3e0?, 0xc00005d0c8?}, {0xc00005c74c, 0x4}, 0x0?)
        /home/runner/go/pkg/mod/github.com/google/go-github/v29@v29.0.3/github/repos_invitations.go:44 +0x15b
main.(*extendGithubClient).ListRepoInvitations(0xc000836390, {0xc00082c3e0, 0xa}, {0xc00005c74c, 0x4})
        /home/runner/work/tichi/tichi/cmd/ticommunitycherrypicker/github.go:60 +0x185
github.com/ti-community-infra/tichi/internal/pkg/externalplugins/cherrypicker.(*Server).inviteCollaborator(0xc00001c540, 0x0?)
        /home/runner/work/tichi/tichi/internal/pkg/externalplugins/cherrypicker/cherrypicker_invite.go:31 +0x3ff
github.com/ti-community-infra/tichi/internal/pkg/externalplugins/cherrypicker.(*Server).handleIssueComment(0xc0007df640?, 0x4d13e5?, 0xc000437800)
        /home/runner/work/tichi/tichi/internal/pkg/externalplugins/cherrypicker/cherrypicker.go:270 +0xfc
github.com/ti-community-infra/tichi/internal/pkg/externalplugins/cherrypicker.(*Server).handleEvent.func1()
        /home/runner/work/tichi/tichi/internal/pkg/externalplugins/cherrypicker/cherrypicker.go:243 +0x45
created by github.com/ti-community-infra/tichi/internal/pkg/externalplugins/cherrypicker.(*Server).handleEvent
        /home/runner/work/tichi/tichi/internal/pkg/externalplugins/cherrypicker/cherrypicker.go:242 +0x398