Jenkins Overwriting JobDSL Configured Job

16 views
Skip to first unread message

Chris McIntosh

unread,
Aug 7, 2019, 4:45:28 PM8/7/19
to jenkins...@googlegroups.com
Hey All,

Hoping somebody can shed some light on this.  

I am using the jobDsl plugin with a seed job to configure a job.  
The job is using a configure {} block to configure some aspect of the job for a plugin that doesn't have a jobDsl extension (Office365Connector). 

When I run the seed job, the config.xml file for the job is updated as expected with the plugin configuration.  

When i go to open the job in the Jenkins UI the plugin is not configured.  When I open the config.xml file for the job on the Jenkins Master filesystem, the config has been reverted somehow to remove the config block my jobDsl job has defined.  

I configured auditd to watch the config file and I see two log entries done by the jenkins user within a few seconds of each other indicating to me that something in Jenkins is causing the job config to get overwritten after my seed job has defined the job.  

Anybody have any clue how I can go about debugging this?  

Jenkins master is running on Ubuntu 18.04.  I can provide any other info needed.  

Thanks,

Chris

Reinhold Füreder

unread,
Aug 8, 2019, 12:54:16 AM8/8/19
to jenkins...@googlegroups.com

Hi Chris,

 

just a very naive guess:

  • there are certain pipeline options or also called pipeline job properties (e.g. build discarder policy or pipeline triggers or pipeline parameters) that lead to updates of the pipeline job config once the corresponding “properties” step (of scripted) pipeline is executed

 

HTH Reinhold

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAJq9cAoMLWof5Y9nrQ5Ee0WxDVVqs8QP8NfKQ5r5c1WiuM2pdA%40mail.gmail.com.

Chris McIntosh

unread,
Aug 8, 2019, 8:59:23 AM8/8/19
to jenkins...@googlegroups.com
Thanks Reinhold,

Any way you could think of to get the job to load first before it executes?  
I tried reloading all the config from disk which didn't work.  I didn't have a chance to try restarting it yet.

Thanks,

Chris



--
Touch not the Cat bot a Glove

Reinhold Füreder

unread,
Aug 8, 2019, 9:12:26 AM8/8/19
to jenkins...@googlegroups.com

Hi Chris,

 

after re-reading also your initial email I have the feeling my pipeline focused/related answer is not helpful at all, as you are not using pipeline jobs, but presumably freestyle jobs?

 

Another very naïve guess:

  • Could it be that using the JobDSL configure { } block changes the “config.xml” as you think is expected (because you “just” look at the “config.xml”), but in fact it is invalid and during opening the job configuration via Jenkins UI (via “Configure” button) it reads in the invalid “config.xml” and then detects and removes the invalid elements (that were added via JobDSL configure { } block)?

 

Please note that I have no idea about JobDSL implementation, so this 2nd naïve guess could be even less helpful than the first one :-o

Chris McIntosh

unread,
Aug 13, 2019, 9:30:17 AM8/13/19
to jenkins...@googlegroups.com
Hi Reinhold,  

We are using pipeline jobs via a jenkinsfile.  
I will double check my xml from the configure block vs the xml generated by jenkins when manually adding the section through the UI.  
I thought it was the same, though the UI added a bunch of extra sections to the xml unrelated to my specific change.  

Thanks again for the help.  

Chris

Chris McIntosh

unread,
Aug 13, 2019, 10:20:58 AM8/13/19
to jenkins...@googlegroups.com
Thanks for the help all,

This is fixed.  I saw that the jobDsl plugin had an update, so I bumped the version up to 1.75 and it started working again.  (I should have mentioned I am using code that worked last month).  
I don't have a satisfying explanation other than my plugins may have been fighting with each other somehow.

Thanks,

Chris

Baptiste Mathus

unread,
Aug 14, 2019, 3:54:45 PM8/14/19
to jenkins...@googlegroups.com
What does the changelog for the plug-in say that could relate to your problem?

Reply all
Reply to author
Forward
0 new messages