Description of problem: Per an exchange with an internal consumer at https://coreos.slack.com/archives/CNU6JC8GJ/p1639018303084900 The are extending our 4.8 Jenkins image, and with the latest version, have started seeing this NPE (full stack trace in slack thread): java.lang.NullPointerException at io.fabric8.jenkins.openshiftsync.PipelineJobListener.upsertWorkflowJob(PipelineJobListener.java:169) at io.fabric8.jenkins.openshiftsync.PipelineJobListener.upsertItem(PipelineJobListener.java:148) at io.fabric8.jenkins.openshiftsync.PipelineJobListener.onCreated(PipelineJobListener.java:90) at hudson.model.listeners.ItemListener.lambda$fireOnCreated$1(ItemListener.java:217) at hudson.model.listeners.ItemListener.forAll(ItemListener.java:178) at hudson.model.listeners.ItemListener.fireOnCreated(ItemListener.java:215) at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:291) at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:4096) at this time, this maps to this line in the method: String ns = property.getNamespace(); where that property object was previously populated by BuildConfigProjectProperty property = buildConfigProjectForJob(job); So why is the BuildConfigProjectProperty not associated with the job? 1) they are creating a project ... perhaps there is a timing issue and the BuildConfigProjectProperty is not created yet? 2) the plugin combination they have constructed is somehow breaking other function 3) this in fact is not a jenkins pipeline strategy job, and we should just ignore. Minimally, we should move the get Namespace call in the if block with the null check. We then need to consider whether we put this create event in a queue to periodically retry.
Alice FYI ... this fix is separate from the other stuff you are tracking right now. If you think you are going to touch PipelineJobListener, perhaps you can at least address the NPE, by not calling property.GetNamespace() unless property is non null. But if you don't think you are going to touch it, I'll get a PR up real quick to fix it.
ok this looks like a benign but noisy / distracting NPE for users 1) it is the case where the incoming workitem is NOT associated with a jenkins pipeline strategy build config 2) jenkins catches this exception and moves onto the next registered listener ... the associated job is still created
https://github.com/openshift/jenkins-sync-plugin/pull/407
I have already verified the `NullPointerException` thing with https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1830329, which was released in https://bugzilla.redhat.com/show_bug.cgi?id=2016058 and I did not find any such error
Release noted in 4.10 with https://github.com/openshift/openshift-docs/pull/40899
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:0056