Everything lost after automatic upgrades

35 views
Skip to first unread message

Giacomo Boccardo

unread,
Jul 22, 2017, 1:25:48 PM7/22/17
to Jenkins Users
Hi, 

  I'm using Jenkins 2.60.1 and after every automatic upgrade I did for the latest three LTS the installation loses everything (configurations, jobs, plugins, etc.): it's exactly like a fresh installation. I didn't see anything in the logs related to the actions happened before, during or after the installation.
Have you ever experienced such a behavior?

Thanks in advance,
  Giacomo

Mark Waite

unread,
Jul 22, 2017, 1:31:54 PM7/22/17
to jenkins...@googlegroups.com
I've never seen a behavior like that.  Are you using a docker image for your base, and possibly forgetting to use a volume to retain the data?

Mark Waite
 
Thanks in advance,
  Giacomo

--
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/f5cc73d1-6de9-4399-b08f-5a8714fba45f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giacomo Boccardo

unread,
Jul 22, 2017, 3:09:00 PM7/22/17
to Jenkins Users
Unfortunately I didn't install it the first time, so I don't know how it has been installed exactly. What I can see is that:
  • Docker is surely not used
  • it's on a CentOS Linux 7 virtual machine which has never been restarted since the first upgrade
  • it has been installed in the home of a user without creating a directory to contain the installation itself
  • /home/jenkins/war contains the following files (strange way to name them, considering that I'm using the version 2.60.1, and the backup of a version should probably be the previously installed one):
    • 70611723 Jun 23 21:37 jenkins-2.46.2.war
    • 70340821 May 25 23:55 jenkins-2.46.2.war.bak
    • 70611723 Jun 23 21:37 jenkins-2.46.2.war.tmp
    •        6 Jun 23 22:01 jenkins.pid
    •       18 May 11 16:05 jenkins.war -> jenkins-2.46.2.war
  • it's launched using the service
    • [Unit]

      Description=jenkins service

      After=network.target network-online.target

      Wants=network-online.target


      [Service]

      Type=forking

      ExecStart=/home/jenkins/bin/jenkins.sh start

      ExecStop=/home/jenkins/bin/jenkins.sh stop

      PIDFile=/home/jenkins/war/jenkins.pid

      User=jenkins


      [Install]

      WantedBy=multi-user.target

    • where jenkins.sh is a script very similar to https://build.opensuse.org/package/view_file/devel:tools:building/jenkins/jenkins.init?expand=1 and the resulting command is "/home/jenkins/java/bin/java -Djava.awt.headless=true -DJENKINS_HOME=/home/jenkins/jenkins-home -jar /home/jenkins/war/jenkins.war --webroot=/home/jenkins/jenkins-home --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 --logfile=/home/jenkins/log/jenkins.log"


Please let me know if you need any further information.


Thanks,
  Giacomo

Mark Waite

unread,
Jul 22, 2017, 3:42:28 PM7/22/17
to Jenkins Users
If you're already losing everything on each upgrade, then it may be worth considering a change to a more standard way of managing the Jenkins installation.  The https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions page describes how to install Jenkins on Red Hat derived operating systems.  You might consider installing it using that technique, then restore your backup into the /var/lib/jenkins/ directory that is created by the install process.

I'm not fluent enough in systemd and Red Hat configuration to be able to help through e-mail questions, answers, and diagnosis.

Mark Waite

Björn Pedersen

unread,
Jul 24, 2017, 1:47:53 AM7/24/17
to Jenkins Users
Hi,

I've something like that once here. It turned out that the upgrade did change the configured jenkins home (I think  the environment var was  not set, and the default was changed from the current working dir to ~/.jenkins)
You can check the current used home on the  "configure jenkins" page.


Does your jenkins.sh set JENKINS_HOME / HUDSON_HOME?

Björn

Giacomo Boccardo

unread,
Jul 24, 2017, 4:56:49 PM7/24/17
to jenkins...@googlegroups.com
Hi Björn,

thank for the suggestion, but "unfortunately" JENKINS_HOME is
properly set both in Jenkins configuration and in the startup script.
Moreover, ~/.jenkins doesn't contain a previous (wrong) installation of
Jenkins but a cache of artifacts in the form
".jenkins/cache/jars/03/3560CFFBE8012D0FCA4763C9237A01.jar".

Giacomo

Oleg Nenashev

unread,
Jul 25, 2017, 8:42:27 AM7/25/17
to Jenkins Users
AFAIK "~/.jenkins" is a temporary directory for Jenkins metadata being used by agents.
If you point JENKINS_HOME to it, you may likely lose the data when Jenkins agent restarts.

BR, Oleg

понедельник, 24 июля 2017 г., 23:56:49 UTC+3 пользователь Giacomo Boccardo написал:
Reply all
Reply to author
Forward
0 new messages