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

On restart Jenkins rewrites some config.xml values

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • Ubuntu 1.582

      I have been seeing this behavior for a while now. I have a standard ubuntu installation using the official package. Every time I reboot the jenkins process to update a plugin of a version my Views and Slave Port configuration are overridden.

      For instance my original config.xml includes the following.

      views>
      <hudson.model.AllView>
      <owner class="hudson" reference="../../.."/>
      <name>All</name>
      <filterExecutors>false</filterExecutors>
      <filterQueue>false</filterQueue>
      <properties class="hudson.model.View$PropertyList"/>
      </hudson.model.AllView>
      <listView>
      <owner class="hudson" reference="../../.."/>
      <name>iOS</name>
      <filterExecutors>false</filterExecutors>
      <filterQueue>false</filterQueue>
      <properties class="hudson.model.View$PropertyList"/>
      <jobNames>
      <comparator class="hudson.util.CaseInsensitiveComparator"/>
      </jobNames>
      <jobFilters/>
      <columns>
      <hudson.views.StatusColumn/>
      <hudson.views.WeatherColumn/>
      <hudson.views.JobColumn/>
      <hudson.views.LastSuccessColumn/>
      <hudson.views.LastFailureColumn/>
      <hudson.views.LastDurationColumn/>
      <hudson.views.BuildButtonColumn/>
      </columns>
      <includeRegex>(?i).IOS-.</includeRegex>
      <recurse>false</recurse>
      </listView>
      </views>
      <primaryView>All</primaryView>
      <slaveAgentPort>8098</slaveAgentPort>

      After a restart that section of the config.xml is reduced to.
      <views>
      <hudson.model.AllView>
      <owner class="hudson" reference="../../.."/>
      <name>All</name>
      <filterExecutors>false</filterExecutors>
      <filterQueue>false</filterQueue>
      <properties class="hudson.model.View$PropertyList"/>
      </hudson.model.AllView>
      </views>
      <primaryView>All</primaryView>
      <slaveAgentPort>0</slaveAgentPort>

      I have watched the jenkins.log file closely and seen no errors or warnings in regard to why these two things specifically are being reset. What is also strange is that the rest of the core config is persisted and remains unchanged.

          [JENKINS-24938] On restart Jenkins rewrites some config.xml values

          Joseph Hughes created issue -

          Daniel Beck added a comment -

          Are you manually modifying the config.xml while Jenkins is running, or is this change only your observation because your view config is reset upon restart?

          Daniel Beck added a comment - Are you manually modifying the config.xml while Jenkins is running, or is this change only your observation because your view config is reset upon restart?

          Joseph Hughes added a comment -

          I am not manually modifying the config.xml while jenkins is running. I backed up the config before I did a restart so I could compare the two files. The result is what you see above.

          Joseph Hughes added a comment - I am not manually modifying the config.xml while jenkins is running. I backed up the config before I did a restart so I could compare the two files. The result is what you see above.

          Joseph Hughes added a comment -

          Also, when I make the changes through the UI then view the xml I see what I would expect to be there, but when I restart it is gone again. It does seem to be limited to just these two config values, Views and the Slave port. Everything else persists correctly.

          Joseph Hughes added a comment - Also, when I make the changes through the UI then view the xml I see what I would expect to be there, but when I restart it is gone again. It does seem to be limited to just these two config values, Views and the Slave port. Everything else persists correctly.

          Daniel Beck added a comment -

          Is there a file named init.groovy, or a folder init.groovy.d in the Jenkins home directory? If so, what are the contents?

          Is security in Jenkins enabled?

          Daniel Beck added a comment - Is there a file named init.groovy, or a folder init.groovy.d in the Jenkins home directory? If so, what are the contents? Is security in Jenkins enabled?

          Joseph Hughes added a comment -

          Security is enabled. I am using Jenkins user database along with the Role Strategy Plugin. https://wiki.jenkins-ci.org/display/JENKINS/Role+Strategy+Plugin

          I do not see any init.groovy or a init.groovy.d folder

          Joseph Hughes added a comment - Security is enabled. I am using Jenkins user database along with the Role Strategy Plugin. https://wiki.jenkins-ci.org/display/JENKINS/Role+Strategy+Plugin I do not see any init.groovy or a init.groovy.d folder

          Daniel Beck added a comment -

          Is JobConfigHistory plugin installed, and if so, does it record changes to the global config.xml? Which user is specified?

          Daniel Beck added a comment - Is JobConfigHistory plugin installed, and if so, does it record changes to the global config.xml? Which user is specified?

          Joseph Hughes added a comment -

          It is not installed... but if it would be helpful I could install it.

          Joseph Hughes added a comment - It is not installed... but if it would be helpful I could install it.

          Oleg Nenashev added a comment -

          @Joseph
          Any updates?

          Oleg Nenashev added a comment - @Joseph Any updates?

          AmberKorey Pairing added a comment - - edited

          We are experiencing a similar issue. We have recently upgraded from Jenkins 1.480.3 to 1.565.3 and it seems once any change is made to the global config.xml file by jenkins, it looses all configurations from the views section forward including our Global Environment Variables section.

          We have the JobConfigHistory plugin installed and it only shows that SYSTEM is making the changes to the config file.

          We have been working on this issue for several days now and have spun up a couple of test environments. We cannot seem to reproduce this issue consistently in our test environments.

          We have tailed stderr and stdout and have observed no exceptions on startup or restart of Jenkins

          Here are the steps to reproduce our issue (in one environment anyways)

          • Take a config file from a jenkins that is not showing the views and copy it into test environment master-workspace
          • Start up jenkins and verify that Views and Environment variables are not displayed in the UI
          • Verify that Views and Environment variables are still in the config.xml file
          • Change the System Message of the Jenkins Server in Jenkins->Configuration
          • Click Save
          • Observe that the Views section and Environment Variable section of config.xml are now clobbered. (No Views, No Environment Variables)

          Any thoughts?

          AmberKorey Pairing added a comment - - edited We are experiencing a similar issue. We have recently upgraded from Jenkins 1.480.3 to 1.565.3 and it seems once any change is made to the global config.xml file by jenkins, it looses all configurations from the views section forward including our Global Environment Variables section. We have the JobConfigHistory plugin installed and it only shows that SYSTEM is making the changes to the config file. We have been working on this issue for several days now and have spun up a couple of test environments. We cannot seem to reproduce this issue consistently in our test environments. We have tailed stderr and stdout and have observed no exceptions on startup or restart of Jenkins Here are the steps to reproduce our issue (in one environment anyways) Take a config file from a jenkins that is not showing the views and copy it into test environment master-workspace Start up jenkins and verify that Views and Environment variables are not displayed in the UI Verify that Views and Environment variables are still in the config.xml file Change the System Message of the Jenkins Server in Jenkins->Configuration Click Save Observe that the Views section and Environment Variable section of config.xml are now clobbered. (No Views, No Environment Variables) Any thoughts?

            francisu Francis Upton
            jjhughes57 Joseph Hughes
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: