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

jenkinsci/github-plugin Received PushEvent for null from ip/domain NullPointerException DefaultPushGHEventSubscriber.onEvent #27202

Closed
Nabapadma-sarker opened this issue Sep 23, 2023 · 0 comments · Fixed by #27203
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@Nabapadma-sarker
Copy link
Contributor

Feature Description

main error happening on jenkins server PushEvent triggering

2023-09-23 04:19:37.733+0000 [id=17]	INFO	o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for null from  http://jenkinsdomain.com/github-webhook/
2023-09-23 04:19:37.733+0000 [id=17]	SEVERE	o.j.p.g.e.GHEventsSubscriber$4#applyNullSafe: Subscriber org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber failed to process SCMEvent
hook, skipping...
java.lang.NullPointerException
	at org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber.onEvent(DefaultPushGHEventSubscriber.java:79)

I find out that in https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java#L76
URL repoUrl = push.getRepository().getUrl();
https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHObject.java#L98-L100

public URL getUrl() {
        return GitHubClient.parseURL(url);
}

https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHObject.java#L31
private String url;

it is trying to get url data from payload object of GHRepository

https://github.com/go-gitea/gitea/blob/main/modules/structs/repo.go#L50-L110
but in Repository struct there don't have any url variable
I test it adding the variable and it's now not showing NullPointerException on jenkins server.

2023-09-23 04:21:20.539+0000 [id=16]	INFO	o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for http://giteadomain.com/user/reponame from http://jenkinsdomain.com/github-webhook/
2023-09-23 04:21:20.607+0000 [id=16]	INFO	o.j.p.g.w.s.DefaultPushGHEventSubscriber$1#run: Poked test
2023-09-23 04:21:29.772+0000 [id=616]	INFO	c.c.jenkins.GitHubPushTrigger$1#run: SCM changes detected in test. Triggering #11

Screenshots

No response

@Nabapadma-sarker Nabapadma-sarker added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Sep 23, 2023
silverwind pushed a commit that referenced this issue Sep 25, 2023
…27249)

Backport #27203 by @Nabapadma-sarker

Fixes #27202

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
silverwind pushed a commit that referenced this issue Sep 25, 2023
…27251)

Backport #27203 by @Nabapadma-sarker

Fixes #27202

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant