Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confluence being restarted every puppet run #119

Open
andrewwippler opened this issue Feb 23, 2017 · 6 comments
Open

Confluence being restarted every puppet run #119

andrewwippler opened this issue Feb 23, 2017 · 6 comments

Comments

@andrewwippler
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

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

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.

@senax
Copy link
Contributor

senax commented Mar 13, 2017

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
Copy link
Contributor

senax commented Mar 14, 2017

I've created pull request #124

@oranenj
Copy link
Contributor

oranenj commented Apr 10, 2017

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

@wynnsusilo
Copy link

wynnsusilo commented Apr 18, 2017

@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.

@decibelhertz
Copy link

decibelhertz commented May 16, 2017

FWIW, I had this problem with Oracle JDK and v2.3.0 of this module, using commit 64e3d64 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>

@waza-ari
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants