13

We are using Jenkins enterprise version. Whenever we update job configs there are cases where the config is again updated with the System user to what it was earlier.

We are unable to understand what process is doing that.

Thank you for the help in advance.

I'm unable to attach a screenshot to give an idea of what is happening as my reputation is not high enough.

zurebe-pieter
  • 3,246
  • 21
  • 38
pocman
  • 325
  • 4
  • 14
  • 1
    Please post your screenshot on some free image hosting site such as `http://www.postmyimage.com/`. – Technext Sep 03 '14 at 11:10
  • Have you found an explanation since then? We are experiencing the same issue. Thank you – Andrew Jan 21 '15 at 22:55
  • Hi Andrew, haven't found the root cause yet and the issue has stopped occurring. I have no clue what had happened. – pocman Jan 22 '15 at 05:11
  • 4
    We had a similar issue to this - when a job was executed, the changes to the job's properties would be discarded by the SYSTEM user. In our case, there was a Jenkinsfile step that was setting the job's properties to ensure a certain parameter was defined for the next execution, this was essentially discarding the other job property changes each time the job was run. – rjohnston Sep 28 '16 at 05:00
  • Old thread but facing same issue, any solution for this @moiz134? – Vaibhav Jain May 05 '18 at 16:25
  • I have also noticed that once we change something in Jenkinsfile, then run the job with changed configuration, then Jenkins picks this new configuration, but in few hours it reverts back the old config, and after few minutes reverts back new config again. And there after it is stable on new configuration. So nutshell, I have no clue why Jenkins (SYSTEM user) ges back to old config at least once. so for any change in Jenkinsfile: there are 3 changes in Job-Config-history done by SYSTEM: new-config revert-back-to-old-config revert-back-to-new-config – ashish Aug 03 '18 at 08:55

2 Answers2

12

Most likely, the reason is in the fact, that your job includes "Parameterized Jenkins Pipeline" stage (thanks to @rjohnston for the "Jenkinsfile" comment above, which is related to this). And in this case, once the parameters code "is included at the top level of the pipeline script, any pipeline execution resets the job’s parameters to the specified values" (as it is pointed out in this article: Parameterized Jenkins Pipelines).

So, you need to change config parameters not in the job configuration page itself, but in the pipeline script (source code in the repository). To find its relative address, you can refer to the job configuration page ("/configure"), "Pipeline" tab, "Script Path" field.

evgeny9
  • 1,381
  • 3
  • 17
  • 31
  • "So, you need to change config parameters not in the job configuration page itself, but in the pipeline script, relative link to which you can find in the "Script Path" field of the "Pipeline" part of the "Config" page." can you re-write this sentence? I cannot understand it – ealeon Jan 06 '21 at 02:30
  • 1
    @ealeon I've rephrased this part - hope it helps – evgeny9 Jan 11 '21 at 14:54
-6

I would like to suggest you to install a plugin called Job Config History This will track the confrontational change by each user,

The following is the output of this plugin this gives the complete details of Configuration changes of Job enter image description here


You can also get the changes in xml format like below

enter image description here

Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
  • The screenshot attached by you shows a change from System user. Is that change done automatically by Jenkins? – pocman Sep 05 '14 at 08:25
  • There are two types of changes, One of them is done by system and another one is done by user, I have installed and uninstalled plugins so that are the configuration changes are shown in system – Trikaldarshiii Sep 05 '14 at 08:42
  • Does the system user by any chance modifies or revert the changes you have done? That is the problem I have, the changes we did to a job were reverted by the System User. – pocman Sep 05 '14 at 09:09
  • I have not seen such incidents I have test system in my machine our build server is at other location, I have never seen such incident but you can check this section for your queries nothing gonna stop you to do so, do make your changes and check this config change systems if it shows that you made change or not if it does then it will definitely will show the systems chagnes too. – Trikaldarshiii Sep 05 '14 at 09:33
  • 4
    @moiz134 Why is this an accepted answer? You wanted to know why and how `SYSTEM` user would revert changes, but the answer is about how to track who changed it. You obviously already know that it is the `SYSTEM` user doing it, so you didn't need the plugin suggested by @anonymous-mohit. The problem with incorrectly accepting an answer is that many others who come here looking for an answer to the same problem, end up wasting their time reading through the answer and then realizing that it doesn't really help. – haridsv Aug 06 '15 at 07:33