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

Jira site configuration lost after a restart

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Modifications to the Jira configuration done in the UI are not persisted on disk but are only kept in memory. After jenkins is restarted, the settings are lost.

      This started with jira-plugin 3.0.7 and it is still a problem in 3.0.8.

       

       

       

        Attachments

          Issue Links

            Activity

            dcendents Daniel Beland created issue -
            dcendents Daniel Beland made changes -
            Field Original Value New Value
            Environment jira-plugin 3.0.7
            Hide
            ronhks Dénes Zsolt added a comment - - edited

            I experienced the same with the previous version, also. :/

            Show
            ronhks Dénes Zsolt added a comment - - edited I experienced the same with the previous version, also. :/
            Hide
            jholzer_cciq Justin Holzer added a comment - - edited

            I've experienced this same issue, but I think it's better summarized by saying that the 3.0.7 version of the plugin does not seem to allow settings to be updated using the Jenkins configuration UI (http://your-jenkins-server/configure).

            From what I've seen, the plugin's XML settings file is never deleted, it's just that it is not updated when the UI is used to make config changes.

            I've found the following workarounds:

            1. Manually edit the plugin's XML file (hudson.plugins.jira.JiraGlobalConfiguration.xml)
              • After manually editing, you either have to restart Jenkins or use the reload configuration option on the "Manage Jenkins" page
            2. Use the Configuration as Code plugin and maintain plugin settings in the jenkins.yaml file (or wherever you have settings stored)
              • You can use the "Manage Jenkins" -> "Configuration as Code" page to initially export settings (for building jenkins.yaml) and also to reload settings without restarting Jenkins
              • Here's a sample YAML configuration
                unclassified:
                  jiraGlobalConfiguration:
                    sites:
                    - credentialsId: "some-credential-id"
                      url: "https://my-jira-site.atlassian.net/"
                
            Show
            jholzer_cciq Justin Holzer added a comment - - edited I've experienced this same issue, but I think it's better summarized by saying that the 3.0.7 version of the plugin does not seem to allow settings to be updated using the Jenkins configuration UI ( http://your-jenkins-server/configure ). From what I've seen, the plugin's XML settings file is never deleted, it's just that it is not updated when the UI is used to make config changes. I've found the following workarounds: Manually edit the plugin's XML file ( hudson.plugins.jira.JiraGlobalConfiguration.xml ) After manually editing, you either have to restart Jenkins or use the reload configuration option on the "Manage Jenkins" page Use the Configuration as Code plugin and maintain plugin settings in the jenkins.yaml file (or wherever you have settings stored) You can use the "Manage Jenkins" -> "Configuration as Code" page to initially export settings (for building jenkins.yaml) and also to reload settings without restarting Jenkins Here's a sample YAML configuration unclassified: jiraGlobalConfiguration: sites: - credentialsId: "some-credential-id" url: "https: //my-jira-site.atlassian.net/"
            Hide
            dcendents Daniel Beland added a comment -

            As a general recommendation to everyone, unless you really need 3.0.7, then I would recommend to stick with 3.0.6 until it is fixed. It does work and is easier to configure than updating the config file manually on disk. Also I believe with 3.0.7, any change in the jenkins configuration page results in the settings being lost (after a reboot, they are still in memory).

             

            Show
            dcendents Daniel Beland added a comment - As a general recommendation to everyone, unless you really need 3.0.7, then I would recommend to stick with 3.0.6 until it is fixed. It does work and is easier to configure than updating the config file manually on disk. Also I believe with 3.0.7, any change in the jenkins configuration page results in the settings being lost (after a reboot, they are still in memory).  
            Hide
            kian kyle ian added a comment -

             

            Working off Justin Holzer's workaround, the below worked for me in script console – I also tried this as a file in $JENKINS_HOME/ref/init.groovy.d to get loaded on boot, and it appeared to blow away the site record entirely, so I don't recommend trying that. Opted for new JiraSite to overwrite existing due to lack of setUrl method.

            import hudson.plugins.jira.*
            jiraSites = JiraGlobalConfiguration.get().getSites()
            jiraSites[0] = new JiraSite("https://my-jira-site.atlassian.net/")
            jiraSites[0].setCredentialsId("some-credential-id")
            

             

            Show
            kian kyle ian added a comment -   Working off  Justin Holzer 's workaround, the below worked for me in script console – I also tried this as a file in $JENKINS_HOME/ref/init.groovy.d to get loaded on boot, and it appeared to blow away the site record entirely, so I don't recommend trying that. Opted for new JiraSite to overwrite existing due to lack of setUrl method. import hudson.plugins.jira.* jiraSites = JiraGlobalConfiguration.get().getSites() jiraSites[0] = new JiraSite( "https: //my-jira-site.atlassian.net/" ) jiraSites[0].setCredentialsId( "some-credential-id" )  
            chrisfetz Christoph Fetzer made changes -
            Environment jira-plugin 3.0.7 jira-plugin 3.0.7
            jira-plugin 3.0.8
            Hide
            chrisfetz Christoph Fetzer added a comment -

            I had the same issue with jira-plugin 3.0.8

            Question: what do you mean by "reboot"? - restart of jenkins or reboot of the machine?

            Show
            chrisfetz Christoph Fetzer added a comment - I had the same issue with jira-plugin 3.0.8 Question: what do you mean by "reboot"? - restart of jenkins or reboot of the machine?
            Hide
            ronhks Dénes Zsolt added a comment - - edited

            happens every time, after jenkins restart. For example if a plugin installed/updated and you have to restart the jenkins.

            Show
            ronhks Dénes Zsolt added a comment - - edited happens every time, after jenkins restart. For example if a plugin installed/updated and you have to restart the jenkins.
            Hide
            chrisfetz Christoph Fetzer added a comment -

            I cannot confirm this. For me the setting survived a number of restarts and got lost at a unknown time. I wanted to ask for machine reboot because the machine is maintained by someone else and I am not aware of every reboot.

            Show
            chrisfetz Christoph Fetzer added a comment - I cannot confirm this. For me the setting survived a number of restarts and got lost at a unknown time. I wanted to ask for machine reboot because the machine is maintained by someone else and I am not aware of every reboot.
            Hide
            jholzer_cciq Justin Holzer added a comment - - edited

            Christoph Fetzer and Dénes Zsolt please see my earlier comment. I'm not really sure the problem described by this ticket has anything to do with restarting Jenkins or rebooting the server Jenkins is running on. It really has to do with the fact that the Jira plugin's configuration file (hudson.plugins.jira.JiraGlobalConfiguration.xml) is not updated when you make configuration changes using the Jenkins configuration page/UI. Because the Jira config file is not properly updated, a side-effect is that when Jenkins is restarted and reloads the configuration, it appears to lose the values that were input earlier. It's not really losing those values, because they were never properly saved in the first place. I've confirmed this behavior in version 3.0.7, running the latest stable version of Jenkins in Windows. It sounds like nothing changed in 3.0.8 in regards to this issue.

             

            As a workaround, any of the following should do:

            1. Manually edit the Jira plugin's XML config file
            2. Use the "Configuration as Code" plugin and create a YAML config file that sets properties for the Jira plugin
            3. As another commentor described, use the init.groovy.d script to configure the Jira plugin
            Show
            jholzer_cciq Justin Holzer added a comment - - edited Christoph Fetzer  and Dénes Zsolt please see my earlier comment. I'm not really sure the problem described by this ticket has anything to do with restarting Jenkins or rebooting the server Jenkins is running on. It really has to do with the fact that the Jira plugin's configuration file ( hudson.plugins.jira.JiraGlobalConfiguration.xml ) is not updated when you make configuration changes using the Jenkins configuration page/UI. Because the Jira config file is not properly updated, a side-effect is that when Jenkins is restarted and reloads the configuration, it appears to lose the values that were input earlier. It's not really losing those values, because they were never properly saved in the first place. I've confirmed this behavior in version 3.0.7, running the latest stable version of Jenkins in Windows. It sounds like nothing changed in 3.0.8 in regards to this issue.   As a workaround, any of the following should do: Manually edit the Jira plugin's XML config file Use the "Configuration as Code" plugin and create a YAML config file that sets properties for the Jira plugin As another commentor described, use the init.groovy.d script to configure the Jira plugin
            Hide
            chrisfetz Christoph Fetzer added a comment -

            1. didn't work for me.

            Show
            chrisfetz Christoph Fetzer added a comment - 1. didn't work for me.
            Hide
            jholzer_cciq Justin Holzer added a comment -

            Christoph Fetzer interesting... Did you restart Jenkins after updating the file (this is necessary so that the settings can be properly loaded)? If you did restart, and the settings still didn't take effect, then what happened? Was the settings file automatically modified and reset with old, or default, values?

            Show
            jholzer_cciq Justin Holzer added a comment - Christoph Fetzer interesting... Did you restart Jenkins after updating the file (this is necessary so that the settings can be properly loaded)? If you did restart, and the settings still didn't take effect, then what happened? Was the settings file automatically modified and reset with old, or default, values?
            Hide
            ronhks Dénes Zsolt added a comment -

            I tested.

            So, before editing (after jenkins restart - OS restart not necessary) looks like this:

            <?xml version='1.1' encoding='UTF-8'?>
            <hudson.plugins.jira.JiraGlobalConfiguration plugin="jira@3.0.7">
              <sites class="hudson.util.PersistedList"/>
            </hudson.plugins.jira.JiraGlobalConfiguration>
            

             after edit, it looks the same. Nothing changed in file, but the configuration is available after save and reload the page.

             

            Of course, the file owner is the jenkins user, who runs the jenkins also:

            root@dnd-dev:/opt/dndsys/server/jenkins/jenkins_home# ls -al hudson.plugins.jira.Jira*
            -rw-r--r-- 1 jenkins jenkins 196 May  3 10:43 hudson.plugins.jira.JiraGlobalConfiguration.xml
            -rw-r--r-- 1 jenkins jenkins 117 May  3 10:43 hudson.plugins.jira.JiraProjectProperty.xml

            and the Jenkins process data:

            root@dnd-dev:/opt/dndsys/server/jenkins/jenkins_home# ps fax | grep jenki
            11281 ?        Sl   2147:26 /opt/dndsys/lang/java8/bin/java -Djava.awt.headless=true -XX:MaxPermSize=128m -Xmx1024m -DJENKINS_HOME=/opt/dndsys/server/jenkins/jenkins_home -jar /opt/dndsys/server/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --httpPort=PORT_NUMBER --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 --prefix=/jenkins

            And the jenkins's home, also owned by jenkins

            root@dnd-dev:/opt/dndsys/server/jenkins# ls -al | grep jenkins_home
            drwxr-xr-x 34 jenkins jenkins    12288 Jul 24 16:37 jenkins_home

            There is nothing relevant (jira, Global, etc.) at jenkins.log

             

             

            Show
            ronhks Dénes Zsolt added a comment - I tested. So, before editing (after jenkins restart - OS restart not necessary) looks like this: <?xml version= '1.1' encoding= 'UTF-8' ?> <hudson.plugins.jira.JiraGlobalConfiguration plugin= "jira@3.0.7" > <sites class= "hudson.util.PersistedList" /> </hudson.plugins.jira.JiraGlobalConfiguration>  after edit, it looks the same. Nothing changed in file, but the configuration is available after save and reload the page.   Of course, the file owner is the jenkins  user, who runs the jenkins also: root@dnd-dev:/opt/dndsys/server/jenkins/jenkins_home# ls -al hudson.plugins.jira.Jira* -rw-r--r-- 1 jenkins jenkins 196 May 3 10:43 hudson.plugins.jira.JiraGlobalConfiguration.xml -rw-r--r-- 1 jenkins jenkins 117 May 3 10:43 hudson.plugins.jira.JiraProjectProperty.xml and the Jenkins process data: root@dnd-dev:/opt/dndsys/server/jenkins/jenkins_home# ps fax | grep jenki 11281 ? Sl 2147:26 /opt/dndsys/lang/java8/bin/java -Djava.awt.headless=true -XX:MaxPermSize=128m -Xmx1024m -DJENKINS_HOME=/opt/dndsys/server/jenkins/jenkins_home -jar /opt/dndsys/server/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --httpPort=PORT_NUMBER --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 --prefix=/jenkins And the jenkins's home, also owned by jenkins root@dnd-dev:/opt/dndsys/server/jenkins# ls -al | grep jenkins_home drwxr-xr-x 34 jenkins jenkins 12288 Jul 24 16:37 jenkins_home There is nothing relevant (jira, Global, etc.) at jenkins.log    
            Hide
            jholzer_cciq Justin Holzer added a comment -

            Dénes Zsolt I believe that when you make changes to the configuration through the Jenkins web UI, it's storing/caching the configuration in memory, and is persisted until you restart Jenkins, or some other event happens that would cause Jenkins to reload the configuration from disk. This is likely why you see your updated configuration after saving and then reloading the configuration page (without restarting Jenkins)

            Show
            jholzer_cciq Justin Holzer added a comment - Dénes Zsolt I believe that when you make changes to the configuration through the Jenkins web UI, it's storing/caching the configuration in memory, and is persisted until you restart Jenkins, or some other event happens that would cause Jenkins to reload the configuration from disk. This is likely why you see your updated configuration after saving and then reloading the configuration page (without restarting Jenkins)
            Hide
            ronhks Dénes Zsolt added a comment - - edited

            Yes, it seems legit. But, I think the plugin should be save te configuration to the disk, shouldn't be?

            Show
            ronhks Dénes Zsolt added a comment - - edited Yes, it seems legit. But, I think the plugin should be save te configuration to the disk, shouldn't be?
            Hide
            dcendents Daniel Beland added a comment -

             

            Yes I'm not sure the reboot/restart is important (I run jenkins in docker, so for me a reboot meant restarting the docker container).

            I think a better description is simply that modifications done in the UI are not persisted on disk but are only kept in memory. After jenkins is restarted, obviously the settings are lost.

             

             

             

             

            Show
            dcendents Daniel Beland added a comment -   Yes I'm not sure the reboot/restart is important (I run jenkins in docker, so for me a reboot meant restarting the docker container). I think a better description is simply that modifications done in the UI are not persisted on disk but are only kept in memory. After jenkins is restarted, obviously the settings are lost.        
            Hide
            ronhks Dénes Zsolt added a comment -

            At the container, you also mounted a configuration holder disk space, so it also could be persisted also, doesn't it?

            Show
            ronhks Dénes Zsolt added a comment - At the container, you also mounted a configuration holder disk space, so it also could be persisted also, doesn't it?
            dcendents Daniel Beland made changes -
            Description I configured my Jira site using the latest plugin version 3.0.7

            All worked fine (recognised the issue in my scm comment and added a link to Jira)

            However after a reboot I noticed the configuration was lost, also I couldn't find any configuration file in my jenkins home directory.

             

            I downgraded the plugin to version 3.0.6 and now I can see the file hudson.plugins.jira.JiraProjectProperty.xml is created when I add a Jira site. 

             

            If I update the plugin back to the latest version 3.0.7 and modify the configuration, the content of the file is lost.

             
            Modifications to the Jira configuration done in the UI are not persisted on disk but are only kept in memory. After jenkins is restarted, the settings are lost.

            This started with jira-plugin 3.0.7 and it is still a problem in 3.0.8.

             

             

             
            dcendents Daniel Beland made changes -
            Summary Jira site configuration lost after a reboot Jira site configuration lost after a restart
            Hide
            dcendents Daniel Beland added a comment -

            yes, everything is persisted in a docker volume, this is the only plugin configuration I have problems with.

            Now that I've updated the plugin (by mistake) to 3.0.8, I saw my Jira configuration was duplicated, I tried to delete the extra one but it won't go away (I can see the config file on disk still has 2 entries).

             

            Show
            dcendents Daniel Beland added a comment - yes, everything is persisted in a docker volume, this is the only plugin configuration I have problems with. Now that I've updated the plugin (by mistake) to 3.0.8, I saw my Jira configuration was duplicated, I tried to delete the extra one but it won't go away (I can see the config file on disk still has 2 entries).  
            Hide
            chrisfetz Christoph Fetzer added a comment -

            I can confirm missing updates of the config file.

            What my problems looked like:

            I had to change the configuration of the Jira server (moved to a new host). My first experience of the fault was, in some magic way the setting changed back to the old one. I tried to manually correct the setting in the config file, which was the place were I found the old settings. Since that, the settings entirely disappeared (but still lived in the config file).

            I can still not confirm the time points when the settings changed back: I intentionally restarted jenjkins several times due to jenkins - and/or plugin updates and I can't remember a correlation between those restarts and broken Jira settings.

            Unfortunately this is a production system. Therefore I reverted the plugin back to 3.0.6 and can't play around with it to find out more relations.

            Show
            chrisfetz Christoph Fetzer added a comment - I can confirm missing updates of the config file. What my problems looked like: I had to change the configuration of the Jira server (moved to a new host). My first experience of the fault was, in some magic way the setting changed back to the old one. I tried to manually correct the setting in the config file, which was the place were I found the old settings. Since that, the settings entirely disappeared (but still lived in the config file). I can still not confirm the time points when the settings changed back: I intentionally restarted jenjkins several times due to jenkins - and/or plugin updates and I can't remember a correlation between those restarts and broken Jira settings. Unfortunately this is a production system. Therefore I reverted the plugin back to 3.0.6 and can't play around with it to find out more relations.
            Hide
            gamentek Rob Brunelle added a comment -

            I'm also having this issue, but I'm new to this plugin and don't have any previous xml config changes.  Can someone provide a sample?  I've tried the following, but it doesn't persist to the system config after restarting Jenkins.

            <?xml version='1.1' encoding='UTF-8'?>
            <hudson.plugins.jira.JiraGlobalConfiguration plugin="jira@3.0.7">
              <sites class="hudson.util.PersistedList" credentialsId="Jenkins.JOB" url="https://jira.mydomain:8444/" />
            </hudson.plugins.jira.JiraGlobalConfiguration>
            
            Show
            gamentek Rob Brunelle added a comment - I'm also having this issue, but I'm new to this plugin and don't have any previous xml config changes.  Can someone provide a sample?  I've tried the following, but it doesn't persist to the system config after restarting Jenkins. <?xml version= '1.1' encoding= 'UTF-8' ?> <hudson.plugins.jira.JiraGlobalConfiguration plugin= "jira@3.0.7" > <sites class= "hudson.util.PersistedList" credentialsId= "Jenkins.JOB" url= "https: //jira.mydomain:8444/" /> </hudson.plugins.jira.JiraGlobalConfiguration>
            Hide
            chrisfetz Christoph Fetzer added a comment -

            For me:

            <?xml version='1.1' encoding='UTF-8'?>
            <hudson.plugins.jira.JiraGlobalConfiguration plugin="jira@3.0.7">
              <sites class="hudson.util.PersistedList">   
                <hudson.plugins.jira.JiraSite>
                  <url>http://myJira:8080/</url>
                  <alternativeUrl>myJira:8080/</alternativeUrl>
                  <useHTTPAuth>false</useHTTPAuth>
                  <credentialsId>BuildUser</credentialsId>
                  <supportsWikiStyleComment>false</supportsWikiStyleComment>
                  <recordScmChanges>true</recordScmChanges>
                  <disableChangelogAnnotations>false</disableChangelogAnnotations>
                  <userPattern>(JOB+-[1-9][0-9]*)([^.]|\.[^0-9]|\.$|$)</userPattern>
                  <updateJiraIssueForAllStatus>false</updateJiraIssueForAllStatus>
                  <timeout>10</timeout>
                  <readTimeout>30</readTimeout>
                  <threadExecutorNumber>10</threadExecutorNumber>
                  <appendChangeTimestamp>true</appendChangeTimestamp>
                  <ioThreadCount>2</ioThreadCount>
                </hudson.plugins.jira.JiraSite>
              </sites>
            </hudson.plugins.jira.JiraGlobalConfiguration>
            

            But as noted: the workaround did not work for me.

            Show
            chrisfetz Christoph Fetzer added a comment - For me: <?xml version= '1.1' encoding= 'UTF-8' ?> <hudson.plugins.jira.JiraGlobalConfiguration plugin= "jira@3.0.7" > <sites class= "hudson.util.PersistedList" > <hudson.plugins.jira.JiraSite> <url>http: //myJira:8080/</url> <alternativeUrl>myJira:8080/</alternativeUrl> <useHTTPAuth> false </useHTTPAuth> <credentialsId>BuildUser</credentialsId> <supportsWikiStyleComment> false </supportsWikiStyleComment> <recordScmChanges> true </recordScmChanges> <disableChangelogAnnotations> false </disableChangelogAnnotations> <userPattern>(JOB+-[1-9][0-9]*)([^.]|\.[^0-9]|\.$|$)</userPattern> <updateJiraIssueForAllStatus> false </updateJiraIssueForAllStatus> <timeout>10</timeout> <readTimeout>30</readTimeout> <threadExecutorNumber>10</threadExecutorNumber> <appendChangeTimestamp> true </appendChangeTimestamp> <ioThreadCount>2</ioThreadCount> </hudson.plugins.jira.JiraSite> </sites> </hudson.plugins.jira.JiraGlobalConfiguration> But as noted: the workaround did not work for me.
            Hide
            gamentek Rob Brunelle added a comment -

            Thank you!  It loaded fine for me after fixing the alternativeUrl value.  I didn't even customize it yet.

            Show
            gamentek Rob Brunelle added a comment - Thank you!  It loaded fine for me after fixing the alternativeUrl value.  I didn't even customize it yet.
            Hide
            aytuncbeken Aytunc BEKEN added a comment - - edited

            Having the same problem. Configuration of the plugin do not persist after restarts only stays in memory.
            Jenkins Version: 2.176.2
            Plugin Version: 3.0.8

            Another symptom is, plugin do not create any config file or do put update config.xml when it's first installation. So every change made on plugin configuration is just in memory.

            Show
            aytuncbeken Aytunc BEKEN added a comment - - edited Having the same problem. Configuration of the plugin do not persist after restarts only stays in memory. Jenkins Version: 2.176.2 Plugin Version: 3.0.8 Another symptom is, plugin do not create any config file or do put update config.xml when it's first installation. So every change made on plugin configuration is just in memory.
            olamy Olivier Lamy made changes -
            Assignee Olivier Lamy [ olamy ]
            Hide
            olamy Olivier Lamy added a comment -
            Show
            olamy Olivier Lamy added a comment - might be because of  https://issues.jenkins-ci.org/browse/JENKINS-52906  
            Show
            casz Joseph Petersen (old) added a comment - Fixed in https://github.com/jenkinsci/jira-plugin/pull/195
            casz Joseph Petersen (old) made changes -
            Remote Link This issue links to "jira-plugin #195 (Web Link)" [ 23417 ]
            olamy Olivier Lamy made changes -
            Labels jira-plugin-3.0.9
            olamy Olivier Lamy made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            olamy Olivier Lamy made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            warden Radek Antoniuk made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              olamy Olivier Lamy
              Reporter:
              dcendents Daniel Beland
              Votes:
              6 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: