Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46426

Pipeline fails with null pointer exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • git-plugin, pipeline
    • Jenkins v2.47
      Git Plugin v3.0.3

      We have a simple pipeline job. It's defined to use "Pipeline script from SCM" . The SCM is Git and it is pointed at our repo with the credentials set as expected (shared with other pipeline jobs). For branches to build, it is set to `*/master`. Under "Advanced clone behaviors" we have a reference repo set which is local to the machine.

      This worked just fine up until about 2 weeks ago. At that point, it stopped automatically triggering and had to be manually triggered (could have been a configuration error made by someone on the team though).

      2 days ago I added another branch specifier to this so that it would build if it matched either name as a temporary change. I removed the extra branch after that build was triggered. Since then, all builds have failed with an error like this: `java.lang.NullPointerException: Cannot invoke method replace() on null object` (Full log is attached).

      I have no idea why this is now failing and can't correct it. I've tried:

      • Removing and recreating the job
      • Removing and recreating the job under a different name
      • Removing the job, then every mention of the job I could find (using `find`), then recreating.
      • Clearing the reference repo and re-cloning in case it was corrupted
      • Specifying the full branch name rather than just `*/master`
      • Running the git commands specified in the log to make sure they succeed

      I'm out of ideas at this point. Our other pipeline jobs using the same reference repo and similar configurations (are set up as scheduled jobs) work fine. We have a multibranch pipeline job that works as expected (building the `master` branch just fine). It's just when I create a pipeline that only runs on that branch that it fails.

            Unassigned Unassigned
            dalemy Dale Myers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: