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

          Daniel Beck added a comment -

          Assuming the culprit is EC2 for now.

          Daniel Beck added a comment - Assuming the culprit is EC2 for now.

          Joseph Hughes added a comment -

          I am using Jenkins 1.582. I also have the ec2 plugin installed but do not have anything come up in the managed old data. For me I notice that the Views and the Jenkins Slave port are the two pieces of data that consistently disappear on reboots. I have started uninstalling any non essential plugins but have not seen any changes yet. I need the ec2 plugin so unfortunately uninstalling it is not an option.

          Joseph Hughes added a comment - I am using Jenkins 1.582. I also have the ec2 plugin installed but do not have anything come up in the managed old data. For me I notice that the Views and the Jenkins Slave port are the two pieces of data that consistently disappear on reboots. I have started uninstalling any non essential plugins but have not seen any changes yet. I need the ec2 plugin so unfortunately uninstalling it is not an option.

          Joseph Hughes added a comment -

          I am using version 1.24 of the ec2 plugin.

          Joseph Hughes added a comment - I am using version 1.24 of the ec2 plugin.

          Joseph Hughes added a comment -

          <com.amazonaws.internal.ListWithAutoConstructFlag>
          <default>
          <autoConstruct>true</autoConstruct>
          </default>
          </com.amazonaws.internal.ListWithAutoConstructFlag>
          </blockDeviceMappings>

          This is where I see autoConstruct in my config. I see the autoConstruct tag all over the ec2 config. Of course this is not causing any errors in my config to come up in "Manage Old Data" and the xml seems valid.

          Joseph Hughes added a comment - <com.amazonaws.internal.ListWithAutoConstructFlag> <default> <autoConstruct>true</autoConstruct> </default> </com.amazonaws.internal.ListWithAutoConstructFlag> </blockDeviceMappings> This is where I see autoConstruct in my config. I see the autoConstruct tag all over the ec2 config. Of course this is not causing any errors in my config to come up in "Manage Old Data" and the xml seems valid.

          Code changed in jenkins
          User: Francis Upton
          Path:
          src/main/java/hudson/plugins/ec2/EC2AbstractSlave.java
          http://jenkins-ci.org/commit/ec2-plugin/d823b5e5da73f2ea9f57f11d890246df5f6c5110
          Log:
          Merge pull request #112 from jglick/transient-lastFetchInstance

          JENKINS-24938 Various fields should be transient

          Compare: https://github.com/jenkinsci/ec2-plugin/compare/7ebb4886cc05...d823b5e5da73

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francis Upton Path: src/main/java/hudson/plugins/ec2/EC2AbstractSlave.java http://jenkins-ci.org/commit/ec2-plugin/d823b5e5da73f2ea9f57f11d890246df5f6c5110 Log: Merge pull request #112 from jglick/transient-lastFetchInstance JENKINS-24938 Various fields should be transient Compare: https://github.com/jenkinsci/ec2-plugin/compare/7ebb4886cc05...d823b5e5da73

          Korey Earl added a comment -

          @Francis Upton
          Can you kindly explain why changing the fields to be transient will solve the issue?

          Cheers,
          Amber & Korey Pairing (Our old account got locked out).

          Korey Earl added a comment - @Francis Upton Can you kindly explain why changing the fields to be transient will solve the issue? Cheers, Amber & Korey Pairing (Our old account got locked out).

          Daniel Beck added a comment -

          Transient fields don't get serialized to XML on disk by Xstream.

          Daniel Beck added a comment - Transient fields don't get serialized to XML on disk by Xstream.

          Joseph Hughes added a comment -

          I have tested the fix and it works. Basically Xstream was not deserializing some values correctly and those values were not meant to be persisted in the first place.

          I have updated my masters with the patch and the fix works.

          Joseph Hughes added a comment - I have tested the fix and it works. Basically Xstream was not deserializing some values correctly and those values were not meant to be persisted in the first place. I have updated my masters with the patch and the fix works.

          Korey Earl added a comment -

          We have installed the EC2 plugin with these changes and we are not seeing this problem anymore!

          Thank you!

          Korey Earl added a comment - We have installed the EC2 plugin with these changes and we are not seeing this problem anymore! Thank you!

          Korey Earl added a comment -

          When will the next release of the Amazon EC2 plugin be available?

          Korey Earl added a comment - When will the next release of the Amazon EC2 plugin be available?

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

              Created:
              Updated:
              Resolved: