Jenkins overwriting config.xml on startup

1,262 views
Skip to first unread message

Wendell Beckwith

unread,
Dec 12, 2017, 3:12:44 PM12/12/17
to Jenkins Users
I've installed the jenkins 2.94 as both a war file and a docker container with the jenkins_home mapped to a local directory and I can startup jenkins fine.  I then add the suggested plugins, admin user, blue ocean and the docker plugin.  After a restart I add a docker cloud and all is well.  However, if I stop and restart the container/war file then I can see that my config.xml which is approx 2300 bytes is replaced with a 1800 byte file.  Effectively the docker cloud portion is removed and an emply <couds/> element is there.  What config option am I likely missing to get my changes to persist restarts?

Slide

unread,
Dec 12, 2017, 3:28:09 PM12/12/17
to jenkins...@googlegroups.com
Do you mean you are trying to run two instances of Jenkins from the same JENKINS_HOME? That will not work.

On Tue, Dec 12, 2017 at 1:12 PM Wendell Beckwith <wbec...@gmail.com> wrote:
I've installed the jenkins 2.94 as both a war file and a docker container with the jenkins_home mapped to a local directory and I can startup jenkins fine.  I then add the suggested plugins, admin user, blue ocean and the docker plugin.  After a restart I add a docker cloud and all is well.  However, if I stop and restart the container/war file then I can see that my config.xml which is approx 2300 bytes is replaced with a 1800 byte file.  Effectively the docker cloud portion is removed and an emply <couds/> element is there.  What config option am I likely missing to get my changes to persist restarts?

--
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/5b2dd1a0-6aa7-4b86-8e94-fbcc9a506500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

niristotle okram

unread,
Dec 12, 2017, 3:34:36 PM12/12/17
to jenkins...@googlegroups.com
Can you elaborate the part: "I add a docker cloud" ? 

On Tue, Dec 12, 2017 at 2:10 PM, Wendell Beckwith <wbec...@gmail.com> wrote:
I've installed the jenkins 2.94 as both a war file and a docker container with the jenkins_home mapped to a local directory and I can startup jenkins fine.  I then add the suggested plugins, admin user, blue ocean and the docker plugin.  After a restart I add a docker cloud and all is well.  However, if I stop and restart the container/war file then I can see that my config.xml which is approx 2300 bytes is replaced with a 1800 byte file.  Effectively the docker cloud portion is removed and an emply <couds/> element is there.  What config option am I likely missing to get my changes to persist restarts?

--
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-users+unsubscribe@googlegroups.com.



--
Regards
nirish okram

Wendell Beckwith

unread,
Dec 12, 2017, 5:17:04 PM12/12/17
to Jenkins Users
I added the docker 1.1.1 plugin to jenkins and then I configure jenkins and under the "Add a new Cloud" setting I selected Docker.  I then give the docker host a name and a tcp url (i.e. tcp://ec2.compute-1.amazonaws.com:2376) and select Apply and Save.  I can then see that the config.xml has the following

  <clouds>
    <com.nirima.jenkins.plugins.docker.DockerCloud plugin="docker...@1.1.1">
      <name>docker</name>
      <dockerApi>
        <dockerHost plugin="docker-...@1.10">
          <uri>tcp://ec2.compute-1.amazonaws.com:2376</uri>
          <credentialsId>docker</credentialsId>
        </dockerHost>
        <connectTimeout>60</connectTimeout>
      </dockerApi>
      <containerCap>100</containerCap>
      <exposeDockerHost>false</exposeDockerHost>
    </com.nirima.jenkins.plugins.docker.DockerCloud>
  </clouds>

 
However, once I stop and restart jenkins then my changes are wiped out and replaced with an empty <clouds/> element.

Daniel Beck

unread,
Dec 12, 2017, 5:20:39 PM12/12/17
to jenkins...@googlegroups.com

> On 12. Dec 2017, at 23:13, Wendell Beckwith <wbec...@gmail.com> wrote:
>
> However, once I stop and restart jenkins then my changes are wiped out and replaced with an empty <clouds/> element.

Anything interesting in the jenkins.log during startup?

Wendell Beckwith

unread,
Dec 12, 2017, 6:32:25 PM12/12/17
to Jenkins Users
I just configured the config.xml file to be locked on osx and I get the following:

INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@22eb18b8: display name [Root WebApplicationContext]; startup date [Tue Dec 12 19:50:31 UTC 2017]; root of context hierarchy


Dec 12, 2017 7:50:31 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory


INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@22eb18b8]: org.springframework.beans.factory.support.DefaultListableBeanFactory@6c09328


Dec 12, 2017 7:50:31 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons


INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6c09328: defining beans [filter,legacy]; root of factory hierarchy


Dec 12, 2017 7:50:32 PM hudson.util.AtomicFileWriter commit


WARNING: Unable to move atomically, falling back to non-atomic move.


java.nio.file.FileSystemException: /var/jenkins_home/atomic1428219556388127924tmp -> /var/jenkins_home/config.xml: Operation not permitted


        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)


        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)


        at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:396)


        at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)


        at java.nio.file.Files.move(Files.java:1395)


        at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:158)


        at hudson.XmlFile.write(XmlFile.java:184)


        at jenkins.model.Jenkins.save(Jenkins.java:3161)


        at jenkins.model.Jenkins.saveQuietly(Jenkins.java:3167)


        at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2540)


        at jenkins.model.Jenkins$17.run(Jenkins.java:3131)


        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)


        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)


        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)


        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)


        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)


        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)


        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)


        at java.lang.Thread.run(Thread.java:748)




Dec 12, 2017 7:50:32 PM hudson.util.AtomicFileWriter commit


INFO: The target file /var/jenkins_home/config.xml was already existing


Dec 12, 2017 7:50:32 PM hudson.util.AtomicFileWriter commit


WARNING: Unable to move /var/jenkins_home/atomic1428219556388127924tmp to /var/jenkins_home/config.xml. Attempting to delete /var/jenkins_home/atomic1428219556388127924tmp and abandoning.


Dec 12, 2017 7:50:32 PM jenkins.model.Jenkins saveQuietly


WARNING: null


java.nio.file.FileSystemException: /var/jenkins_home/config.xml: Operation not permitted


        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)


        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)


        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)


        at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)


        at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)


        at java.nio.file.Files.move(Files.java:1395)


        at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:173)


        at hudson.XmlFile.write(XmlFile.java:184)


        at jenkins.model.Jenkins.save(Jenkins.java:3161)


        at jenkins.model.Jenkins.saveQuietly(Jenkins.java:3167)


        at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2540)


        at jenkins.model.Jenkins$17.run(Jenkins.java:3131)


        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)


        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)


        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)


        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)


        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)


        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)


        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)


        at java.lang.Thread.run(Thread.java:748)


        Suppressed: java.nio.file.FileSystemException: /var/jenkins_home/atomic1428219556388127924tmp -> /var/jenkins_home/config.xml: Operation not permitted


                at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)


                at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)


                at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:396)


                at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)


                at java.nio.file.Files.move(Files.java:1395)


                at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:158)


                ... 13 more




Dec 12, 2017 7:50:33 PM jenkins.InitReactorRunner$1 onAttained


INFO: Completed initialization


Dec 12, 2017 7:50:33 PM hudson.WebAppMain$3 run


INFO: Jenkins is fully up and running

Reply all
Reply to author
Forward
0 new messages