puppet-confluence icon indicating copy to clipboard operation
puppet-confluence copied to clipboard

Confluence being restarted every puppet run

Open andrewwippler opened this issue 8 years ago • 6 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 1.9.1
  • Ruby: n/a
  • Distribution: CentOS 7
  • Module version: commit dc96ab3f0c0cb26bbda219ef90099f472f92faa1

How to reproduce (e.g Puppet code you use)

  java::oracle { 'jdk8' :
    ensure  => 'present',
    version => '8',
    java_se => 'jdk',
  }

  class { "confluence":
    version        => '6.0.4',
    javahome       => "/usr/java/jdk1.8.0_51",
    jvm_xms        => '3G',
    jvm_xmx        => '7G',
    jvm_permgen    => '512m',
    tomcat_proxy   => {
      scheme       => 'https',
      proxyName    => 'wiki.domain.org',
      proxyPort    => '443',
    },
  }

Then apply:

  java::oracle { 'jdk8' :
    ensure  => 'present',
    version => '8',
    java_se => 'jdk',
  }

  class { "confluence":
    version        => '6.0.6',
    javahome       => "/usr/java/jdk1.8.0_51",
    jvm_xms        => '3G',
    jvm_xmx        => '7G',
    jvm_permgen    => '512m',
    tomcat_proxy   => {
      scheme       => 'https',
      proxyName    => 'wiki.domain.org',
      proxyPort    => '443',
    },
  }

What are you seeing

Confluence is being restarted every puppet run after an upgrade

What behaviour did you expect instead

Restart only for the upgrade

Output log

notice 	Puppet 	Attempting to upgrade CONFLUENCE
notice 	/Stage[main]/Confluence/Notify[Attempting to upgrade CONFLUENCE]/message 	defined 'message' as 'Attempting to upgrade CONFLUENCE'
notice 	/Stage[main]/Confluence/Exec[service confluence stop && sleep 15]/returns 	executed successfully
notice 	/Stage[main]/Confluence::Service/Service[confluence]/ensure 	ensure changed 'stopped' to 'running'

Any additional information you'd like to impart

I removed the offending lines locally to bypass the constant restart.

andrewwippler avatar Feb 23 '17 18:02 andrewwippler

We are seeing the same behaviour. It is the fact which picks up the java version instead of the confluence one. To be honest, looking for 'a process with atlassian-confluence in the name and then taking the first thing which looks a bit like a version' is not ideal.

Unfortunately there doesn't seem to be an easy way to get the version from the rest API like in jira.

This might work?

curl -s http://localhost:8090/nonexisting_page |grep ajs-version-number
            <meta name="ajs-version-number" content="6.0.3">

For now I've changed: confluence_process.scan(%r{\d+\.\d+\.\d+}).first to: confluence_process.scan(%r{\d+\.\d+\.\d+}).last

Which does the trick for now

senax avatar Mar 13 '17 09:03 senax

I've created pull request #124

senax avatar Mar 14 '17 10:03 senax

@andrewwippler @senax I merged the PR. Can you confirm that this is now fixed?

oranenj avatar Apr 10 '17 18:04 oranenj

@oranenj, Sorry, I think this still doesn't work. It's still restarting for me. I've confirmed that the version on my machine and the expected version is the same, but it's still restarting.

wynnsusilo avatar Apr 18 '17 20:04 wynnsusilo

FWIW, I had this problem with Oracle JDK and v2.3.0 of this module, using commit 64e3d64152a04ae18119a70492401a76b9564162 instead resolved the confluence_version fact incorrectly catching Java's version.

The output of my host's pgrep --list-full --full java.*atlassian-confluence-[0-9].*org.apache.catalina.startup.Bootstrap command looks like:

17945 /usr/java/jdk1.8.0_131/jre/bin/java -Djava.util.logging.config.file=/data/atlassian/confluence/atlassian-confluence-6.1.2/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms4G -Xmx8G -XX:MaxPermSize=512m -XX:+UseLargePages -Dhttp.proxyHost=example.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=example.com -Dhttps.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.*.*.* -Djava.awt.headless=true -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Djava.endorsed.dirs=/data/atlassian/confluence/atlassian-confluence-6.1.2/endorsed -classpath /data/atlassian/confluence/atlassian-confluence-6.1.2/bin/bootstrap.jar:/data/atlassian/confluence/atlassian-confluence-6.1.2/bin/tomcat-juli.jar -Dcatalina.base=/data/atlassian/confluence/atlassian-confluence-6.1.2 -Dcatalina.home=/data/atlassian/confluence/atlassian-confluence-6.1.2 -Djava.io.tmpdir=/data/atlassian/confluence/atlassian-confluence-6.1.2/temp org.apache.catalina.startup.Bootstrap start

As for the fact based on an HTTP call... Why not use curl on the login page to detect the fact perhaps? Confluence has long put the version its running at the bottom of the page...

# curl -s http://localhost:8090/wiki/login.action | grep 'Atlassian Confluence [0-9]\.[0-9]\.[0-9]'
            <li class="print-only">Printed by Atlassian Confluence 6.1.2</li>

decibelhertz avatar May 16 '17 13:05 decibelhertz

I see the same behaviour on Debian 9 stretch, Confluence is restarted at every puppet run. Going to give the other commit a shot tomorrow

waza-ari avatar Aug 28 '17 19:08 waza-ari