Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7472

Websphere_application_server: Instance installation fails with nil conversion

    Details

      Description

      Basic Info
      Module Version: Websphere_application_manager 1.3.0, IBM_installation_manager 0.5.0
      Puppet Version:5.5.2
      OS Name/Version:Centos 7.5

      Desired Behavior: To create a WebSphere instance using the example from the forge readme using the root user.

      Actual Behavior: Error: Failed to apply catalog: no implicit conversion of nil into String

      When using customized versions of the examples from the readme where the installation has been unzipped at the repository location and the repository.config is readable.

        # Initialize the WAS class.
        class { 'websphere_application_server':
          user     => 'webadmin',
          group    => 'webadmin',
          base_dir => '/opt/IBM',
        }
       
       
        # Create some basic directory structure.
        file { [
          '/opt/IBM/WebSphere',
          '/opt/IBM/WebSphere/AppServer',
          '/opt/IBM/repo',
          ]:
          ensure => directory,
          owner  => 'webadmin',
          group  => 'webadmin',
        }
       
        # Create the WebSphere instance
        websphere_application_server::instance { 'WebSphere9':
          target              => '/opt/IBM/WebSphere/AppServer',
          package             => 'com.ibm.websphere.ND.v90',
          version             => '9.0.7.20180302_0440',
          profile_base        => '/opt/IBM/WebSphere/AppServer/profiles',
          jdk_package_name    => 'com.ibm.java.jdk.v8',
          jdk_package_version => '8.0.5016.20180606_1258',
          repository          => '/opt/IBM/repo/jdk8_was9_combined/repository.config',
          imcl_path           => '/opt/IBM/InstallationManager/eclipse/tools/imcl',
        }
      

      The puppet agent fails to run with no implicit conversion of nil into String.

      Error: Failed to apply catalog: no implicit conversion of nil into String
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:104:in `file?'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:104:in `find_installed_xml'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:116:in `installed_file'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:274:in `block in installed_packages'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:273:in `each'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:273:in `installed_packages'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:307:in `instances'
      /opt/puppetlabs/puppet/cache/lib/puppet/provider/ibm_pkg/imcl.rb:250:in `prefetch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:323:in `prefetch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:223:in `prefetch_if_necessary'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:107:in `block in evaluate'
      

      What we think is happening
      If we symlink /opt/IBM/var/ibm/ from /var/ibm the error is no longer seen, but it fails with a more visible error.

      Error: Execution of '/opt/IBM/InstallationManager/eclipse/tools/imcl install com.ibm.websphere.ND.v90_9.0.7.20180302_0440 com.ibm.java.jdk.v8_8.0.5016.20180606_1258 -repositories /opt/IBM/repo/jdk8_was9_combined/repository.config -installationDirectory /opt/IBM/WebSphere/AppServer -accessRights nonAdmin -acceptLicense' returned 1: ERROR: Unable to access the agent data location for the Installation Manager /var/ibm/InstallationManager. Ensure that you have at least read and write permissions to the agent data location and re-launch the Installation Manager.
      

      This indicates that installed_xml_path is not being set and is still nil on https://github.com/puppetlabs/puppetlabs-ibm_installation_manager/blob/0.5.0/lib/puppet/provider/ibm_pkg/imcl.rb#L104. This is likely because /opt/IBM/var/ibm does not exist and so no installed.xml was found. Catching the nil would have helped diagnose the issue by failing with a diagnostic message about where it was looking.

      It looks like MODULES-4903 broke the root behavior by passing the user into the ibm_pkg and now the package is not being installed for root, but whatever is configured in $websphere_application_server::user.

       
      Workaround
      Specify the root user in the websphere_application_server::instance and add a websphere_application_server::ownership resource to manage the permissions.

       websphere_application_server::instance { 'WebSphere9':
          target              => '/opt/IBM/WebSphere/AppServer',
          package             => 'com.ibm.websphere.ND.v90',
          version             => '9.0.7.20180302_0440',
          profile_base        => '/opt/IBM/WebSphere/AppServer/profiles',
          jdk_package_name    => 'com.ibm.java.jdk.v8',
          jdk_package_version => '8.0.5016.20180606_1258',
          repository          => '/opt/IBM/repo/jdk8_was9_combined/repository.config',
          imcl_path           => '/opt/IBM/InstallationManager/eclipse/tools/imcl',
          user                   => 'root',
        }
      websphere_application_server::ownership { '/opt/IBM/WebSphere/AppServer':
        user => 'webadmin',
        group => 'webadmin',
      }
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                loredana.ionce Loredana Ionce
                Reporter:
                jarret.lavallee Jarret Lavallee
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support