Smarts SAM 9.x: Cannot launch Perl script using standard Perl; Logs show "Can't locate loadable object for module InCharge...Compilation failed" message
search cancel

Smarts SAM 9.x: Cannot launch Perl script using standard Perl; Logs show "Can't locate loadable object for module InCharge...Compilation failed" message

book

Article ID: 331722

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:




Cannot launch Perl script in Smarts SAM 9.x using standard Perl.
When trying to use Perl script in Smarts SAM 9.x, the following can be seen in the logs:

Can't locate loadable object for module InCharge::I18NWrapper in @INC (@INC contains: /opt/InCharge/SAM/smarts/local/perl/5.8.8/lib /
opt/InCharge/SAM/smarts/perl/5.8.8/lib /opt/InCharge/SAM/smarts/local/perl/5.8.8 /opt/InCharge/SAM/smarts/perl/5.8.8 /usr/lib64/perl5
/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8
/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-mul
ti /usr/lib/perl5/5.8.8 . c:/InChargeBuild/smarts/perl/5.6.1/lib) at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/I18NWrapper.pm line
 11
Compilation failed in require at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/packer.pm line 18.
BEGIN failed--compilation aborted at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/packer.pm line 18.
Compilation failed in require at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/remote.pm line 19.
BEGIN failed--compilation aborted at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/remote.pm line 19.
Compilation failed in require at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/session.pm line 130.
BEGIN failed--compilation aborted at /opt/InCharge/SAM/smarts/perl/5.8.8/InCharge/session.pm line 130.
Compilation failed in require at /opt/InCharge/SAM/smarts/perl/5.8.8/samples/dashboard/dashboard.pl line 27.
BEGIN failed--compilation aborted at /opt/InCharge/SAM/smarts/perl/5.8.8/samples/dashboard/dashboard.pl line 27.

 


Environment

VMware Smart Assurance - SMARTS

Cause

In Smarts 7.x and 8.x, the Smarts Perl module was made to be loaded with standard Perl. With 9.x, the module must be loaded using sm_perl. Use of standard  Perl is no longer supported by the Smarts architecture in 9.x, sm_perl must be used.
 
The sm_perl module was designed especially for Smarts and has many additional parameters and configurations that are required to run the Smarts Perl API. To ensure that these required customizations are loaded, you must use sm_perl.
 
The PerlApi depends on two C modules:
  • FlowWrapper - For features like encrypted client-server communication, keepalives and so on.
  • I18NWrapper - I18N support - proper rendering of error messages etc. This was added in DMT 9.0.
The underlying issue is that the libI18NWrapper.so was compiled and linked against Perl 5.8.8 libraries. It relies on symbol Perl_Tstack_sp_ptr, which is defined in toolbox/perl/lib/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so in a Smarts server installation. This symbol is not defined on some later versions of Perl.

Resolution

If you need to run without sm_perl in Smarts 9.x while using the Smarts Perl API, you need to include the appropriate options on the perl command line. sm_perl includes the following, which can be seen by looking at SM_PREPEND_ARGS in [local/]bin/system/sm_perl.options in a Smarts server installation:

sm_edit bin/system/sm_perl.options

You will need to add some "-I" entries to the SM_PREPEND_ARGS variable as shown in the following:
 
SM_PREPEND_ARGS="-I "$SM_HOME"/local/perl/lib -I "$SM_HOME"/perl/lib -I "$SM_DEFHOME"/local/perl/lib -I "$SM_DEFHOME"/perl/lib -Msm_perl_init -I "$SM_HOME"/local/perl/5.8.8/lib -I "$SM_DEFHOME"/local/perl/5.8.8/lib -I "$SM_HOME"/perl/5.8.8/lib -I "$SM_DEFHOME"/perl/5.8.8/lib -I "$SM_HOME"/local/perl/5.8.8 -I "$SM_DEFHOME"/local/perl/5.8.8 -I "$SM_HOME"/perl/5.8.8 -I "$SM_DEFHOME"/perl/5.8.8 -I "$SM_PERL_BASE"/lib/5.8.8 -I "$SM_DEFHOME"/toolbox/perl/lib/5.8.8 -I "$SM_PERL_BASE"/lib/5.8.8/x86_64-linux-thread-multi -I "$SM_DEFHOME"/toolbox/perl/lib/5.8.8/x86_64-linux-thread-multi "
 
You also need to set your path and/or library path, which is usually handled by runcmd.
 
-I /usr/lib/perl5/vendor_perl/5.8.8/ -I /usr/lib/perl5/site_perl/5.8.8