-
Bug
-
Resolution: Not A Defect
-
Major
-
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.
Pipeline libraries can be defined which are loaded each time a pipeline is executed. They provide reusable components for all pipeline jobs in the context where they are defined. Pipeline library loading is defined at the system level in the "Manage Jenkins", "Configure System", "Global Pipeline Libraries" section.
Pipeline library loading can also be defined in a folder, if your jobs are stored in a folder.
In my environment (as an example), I have a pipeline library that I use for all regression tests. It is loaded from the folder that holds all my regression tests. I use a different pipeline library for plugin development tests. It is loaded from the folders that host my plugin development work.
If you have a pipeline library being loaded, and it contains an error, that might cause those types of surprises.