Problem with jboss module

238 views
Skip to first unread message

Jamie Ostrowski

unread,
May 26, 2014, 11:44:45 AM5/26/14
to example42-pu...@googlegroups.com


  Hello,

  We are using the example42 jboss module to install a jboss 7 on a CentOS 6.5 server and using Puppet 3.4.3. We''re using the following manifest to run the jboss installation:


class test::role::jboss7appserver(
  ) {

  class {'git': }
  class { 'java': }




          class { 'jboss':
          install             => 'source',
          install_source      => 'http://test.ourdomain.com/jbosstest/jboss-as-7.1.1.Final.tar.gz',
          install_destination => '/usr/local/jboss7',
          install_dirname     => 'jbosstest',
          version               => '7',
          bindaddr              => $ipaddress
        }





When we run the agent for the first time on the client to build jboss, most of the time there are failures when it tries to put in the symbolic link, because it hasn't finished installing the jboss source yet, so there is no destination directory to point the symlink to. As a result, the jboss_init also fails. Puppet continues to finish installing the jboss source and completes, however, the jboss installation failed without the symbolic link created.

When puppet agent runs a second time, it has the dependencies met for the symbolic link since it ran the first time and created the destination directory.

Here is the output of our puppet agent when it fails. As you can see, it is trying to set up the symbolic link and run jboss early in the run, before it has begun to extract the code. When I took a look at the jboss module, in install.pp, there is:

file { 'jboss_link':

        ensure => "${jboss::real_install_destination}/${jboss::real_created_dirname}" ,

    path => "${jboss::real_install_destination}/${jboss::install_dirname}" ,

      }

Should this be checking to make sure that jboss has been extracted and the necessary paths exist first, or is there something wrong with our configuration?






##########AGENT OUTPUT  - First time puppet agent runs (the second time it runs, it installs the link and init's jboss successfully because of the first run)


Info: Applying configuration version '1401010447'

Error: Could not set 'link' on ensure: No such file or directory - /usr/local/jboss7 at 44:/etc/puppet/environments/production/modules/jboss/manifests/install.pp

Error: Could not set 'link' on ensure: No such file or directory - /usr/local/jboss7 at 44:/etc/puppet/environments/production/modules/jboss/manifests/install.pp

Wrapped exception:

No such file or directory - /usr/local/jboss7

Error: /Stage[main]/Jboss::Install/File[jboss_link]/ensure: change from absent to link failed: Could not set 'link' on ensure: No such file or directory - /usr/local/jboss7 at 44:/etc/puppet/environments/production/modules/jboss/manifests/install.pp

Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]/returns: executed successfully

Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local/jboss7]

Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local/jboss7]

Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local/jboss7]: Triggered 'refresh' from 1 events

Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local/jboss7]: Triggered 'refresh' from 1 events

Notice: /Stage[main]/Jboss::Service/File[jboss.init]: Dependency File[jboss_link] has failures: true

Warning: /Stage[main]/Jboss::Service/File[jboss.init]: Skipping because of failed dependencies

Notice: /Stage[main]/Jboss::Service/Service[jboss]: Dependency File[jboss_link] has failures: true

Warning: /Stage[main]/Jboss::Service/Service[jboss]: Skipping because of failed dependencies

 




Alessandro Franceschi

unread,
May 26, 2014, 12:04:51 PM5/26/14
to example42-pu...@googlegroups.com
If I remember well the install_destination should exist already.
Try something like:
install_destination => '/usr/local/',

al
<w:LsdException Locked="false" Priority="71"
...

Jamie Ostrowski

unread,
May 26, 2014, 12:52:26 PM5/26/14
to example42-pu...@googlegroups.com



I tried that as well at one point. Puppet agent reports that it completes successfully, however, some items aren't getting installed. When I set the install directory to /usr/local, puppet agent doesn't report any errors, but jboss will not start. This is the output I get when I try to start jboss with the puppet install_directory set to /usr/local. Puppet runs, but it does not start jboss, because the jboss installation is broken. It is complaining about some directories missing:


[root@jboss7nodeg local]# service jboss start
Starting : Unable to set property fileName on class org.jboss.logmanager.handlers.FileHandler: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.logmanager.PropertyConfigurator.configureProperties(PropertyConfigurator.java:187)
        at org.jboss.logmanager.PropertyConfigurator.configureHandler(PropertyConfigurator.java:312)
        at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:128)
        at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:86)
        at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:246)
        at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:231)
        at java.util.logging.LogManager$2.run(LogManager.java:294)
        at java.util.logging.LogManager$2.run(LogManager.java:292)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
        at java.util.logging.LogManager.getLogManager(LogManager.java:275)
        at java.util.logging.Logger.<init>(Logger.java:252)
        at java.util.logging.Logger.<init>(Logger.java:248)
        at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1327)
        at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1325)
        at java.util.logging.LogManager$1.run(LogManager.java:196)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.<clinit>(LogManager.java:173)
        at org.jboss.modules.Main.main(Main.java:275)
Caused by: java.io.FileNotFoundException: /usr/local/jbosstest/standalone/log/boot.log (No such file or directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
        at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:152)
        at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:183)
        ... 23 more
java.lang.IllegalStateException: JBAS018704: Could not create server data directory: /usr/local/jbosstest/standalone/data
        at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:388)
        at org.jboss.as.server.Main.determineEnvironment(Main.java:242)
        at org.jboss.as.server.Main.main(Main.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.modules.Module.run(Module.java:260)
        at org.jboss.modules.Main.main(Main.java:291)



Here is the output of the puppet agent run:


Info: Applying configuration version '1401122553'
Notice: /Stage[main]/Jboss::User/User[jboss]/home: home changed '/usr/local/jboss' to '/usr/local/jbosstest'
Notice: /Stage[main]/Jboss::Install/File[jboss_link]/ensure: created

Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]/returns: executed successfully
Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local]
Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local]
Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jboss::Service/File[jboss.init]/ensure: created
Notice: /Stage[main]/Jboss::Service/Service[jboss]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Jboss::Service/Service[jboss]: Unscheduling refresh on Service[jboss]



If the install_directory is set to /usr/local/jboss7, then at least the necessary files get installed and jboss will start and run, but it requires 2 puppet agent runs because it is putting the symlink in before it is extracting the source.



  - Jamie
<w:LsdException Locked="false" Priority="71"
...

Alessandro Franceschi

unread,
May 26, 2014, 1:47:03 PM5/26/14
to example42-pu...@googlegroups.com
Have to verify this better, in the meantime try to remove the
           install_dirname     => 'jbosstest', parameter
keeping 
           install_destination => '/usr/local/',

Eventually open a bug on github.


--
You received this message because you are subscribed to the Google Groups "Example42 Puppet Modules" group.
To unsubscribe from this group and stop receiving emails from it, send an email to example42-puppet-m...@googlegroups.com.
To post to this group, send email to example42-pu...@googlegroups.com.
Visit this group at http://groups.google.com/group/example42-puppet-modules.
For more options, visit https://groups.google.com/d/optout.

Jamie Ostrowski

unread,
May 26, 2014, 2:54:23 PM5/26/14
to example42-pu...@googlegroups.com

I tried this, and it failed. Before running the test, I removed /etc/init.d/jboss and rm -rf /usr/local/jboss* I also tried the test on a brand new VM. It failed the same way on both.

Here is the configuration I used:



class test::role::jboss7appserver(
  ) {

  class {'git': }
  class { 'java': }




          class { 'jboss':
          install             => 'source',
          install_source      => 'http://test.mydomain.com/jbosstest/jboss-as-7.1.1.Final.tar.gz',
          install_destination => '/usr/local',

          version               => '7',
          bindaddr              => $ipaddress
        }
}



Here was the output from the puppet agent:


Info: Applying configuration version '1401128697'
Notice: /Stage[main]/Jboss::User/User[jboss]/home: home changed '/usr/local/jbosstest' to '/usr/local/jboss'

Notice: /Stage[main]/Jboss::Install/File[jboss_link]/ensure: created
Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]/returns: executed successfully
Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local]
Info: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Extract jboss-as-7.1.1.Final.tar.gz from /var/tmp]: Scheduling refresh of Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local]
Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[PostExtract jboss-as-7.1.1.Final.tar.gz in /usr/local]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jboss::Install/Puppi::Netinstall[netinstall_jboss]/Exec[Chown jboss-as-7.1.1.Final.tar.gz in /usr/local]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jboss::Service/File[jboss.init]/ensure: created
Notice: /Stage[main]/Jboss::Service/Service[jboss]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Jboss::Service/Service[jboss]: Unscheduling refresh on Service[jboss]

This is the directory structure it set up in /usr/local:


lrwxrwxrwx   1 root   root     31 May 26 13:25 /usr/local/jboss -> /usr/local/jboss-as-7.1.1.Final
drwxr-xr-x  10 root   root   4096 Mar 10  2012 /usr/local/jboss-as-7.1.1.Final


And this is the output of jboss when I try to run it manually:
Caused by: java.io.FileNotFoundException: /usr/local/jboss/standalone/log/boot.log (No such file or directory)

        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
        at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:152)
        at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:183)
        ... 23 more
java.lang.IllegalStateException: JBAS018704: Could not create server data directory: /usr/local/jboss/standalone/data
To unsubscribe from this group and stop receiving emails from it, send an email to example42-puppet-modules+unsub...@googlegroups.com.

Alessandro Franceschi

unread,
May 26, 2014, 3:36:27 PM5/26/14
to example42-pu...@googlegroups.com
This is wrong and is probably the reason why the service dosn’t start.
The owner of  /usr/local/jboss-as-7.1.1.Final should be jboss, not root.

I tried on a Vanilla machine and this code:
class { 'java': } ->
package { 'unzip': ensure => present } ->
        class { 'jboss':
          install             => 'source',
#          install_source      => 'http://test.ourdomain.com/jbosstest/jboss-as-7.1.1.Final.tar.gz',
          install_destination => '/usr/local',
          install_dirname     => 'jbosstest',
          version               => '7',
          bindaddr              => $ipaddress
        }


Seemed to work, permissions were correct:
[root@centos6-64 vagrant]# ls -l /usr/local/
total 44
drwxr-xr-x  10 jboss jboss 4096 Mar 10  2012 jboss-as-7.1.1.Final
lrwxrwxrwx   1 root  root    31 May 26 21:26 jbosstest -> /usr/local/jboss-as-7.1.1.Final


and jboss service running:
[root@centos6-64 vagrant]# ps -adef | grep java
jboss     3286  3233  2 21:31 ?        00:00:04 java -D[Standalone] -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Dorg.jboss.boot.log.file=/usr/local/jbosstest/standalone/log/boot.log -Dlogging.configuration=file:/usr/local/jbosstest/standalone/configuration/logging.properties -jar /usr/local/jbosstest/jboss-modules.jar -mp /usr/local/jbosstest/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/usr/local/jbosstest -b 10.0.2.15 -c standalone.xml



To unsubscribe from this group and stop receiving emails from it, send an email to example42-puppet-m...@googlegroups.com.

Jamie Ostrowski

unread,
May 26, 2014, 8:13:16 PM5/26/14
to example42-pu...@googlegroups.com


 Yes, thats what it was. Now that you point out permissions problem, I see there was a patch for that at github.

I installed that patched version and it worked.

Thank you! I apologize, I should have tried updating the jboss code to the latest version.
To unsubscribe from this group and stop receiving emails from it, send an email to example42-puppet-modules+unsubs...@googlegroups.com.

To post to this group, send email to example42-pu...@googlegroups.com.
Visit this group at http://groups.google.com/group/example42-puppet-modules.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages