Software Development Kit (SDK) and API Discussions

My perl install is missing . . . something

stuartlong
4,998 Views

I have a problem using the perl NMSDK interface.

I have two versions of perl installed on my server, 5.8.4 and 5.16.3.

The SDK is working fine with 5.8.4:

#/usr/bin/perl apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03 system-get-version

OUTPUT:
<results status="passed">
        <version>NetApp Release 8.1.3P2 7-Mode: Fri Aug 23 20:16:59 PDT 2013</version>
        <is-clustered>false</is-clustered>
</results>

The 5.16.3 version fails miserably:

#/usr/local/bin/perl apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03 system-get-version

OUTPUT:
<results status="failed" reason="in Zapi::invoke, cannot connect to socket" errno="13001"></results>

I have a suspicion that the problem may lay in the Net::SSLeay perl module and its interaction with the openssl library, but I'm at a loss as to how to proceed.

Anyone have any ideas?

1 ACCEPTED SOLUTION

stuartlong
4,998 Views

Progress!

After running my script through the Perl debugger, I found a run-time 'require' for module Socket6, which I did not have installed.  Since the require is inside an eval block, it silently leaves a couple of variables unset (particularly $na_can_use_ipv6), which later on leads to a failure creating a socket.

After installing Socket6, there is a Exporter warning (only when using -w) about a redefined subroutine, but I'm not going to sweat that right now, as the process works.

For comparison:

Perl v5.8.4 (with -w)

#/usr/bin/perl -w apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03pvt system-get-version
"my" variable $use_port masks earlier declaration in same scope at apitest.pl line 96.
"my" variable @option masks earlier declaration in same scope at apitest.pl line 147.
"my" variable $xo masks earlier declaration in same scope at apitest.pl line 344.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 183.
Use of uninitialized value in numeric eq (==) at apitest.pl line 187.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 229.
Use of uninitialized value in numeric eq (==) at apitest.pl line 311.
Use of uninitialized value in numeric eq (==) at apitest.pl line 316.
Use of uninitialized value in numeric gt (>) at apitest.pl line 319.
Use of uninitialized value in numeric eq (==) at apitest.pl line 332.
Use of uninitialized value in numeric eq (==) at ../../../../lib/perl/NetApp/NaServer.pm line 1827.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 350.

OUTPUT:
<results status="passed">
        <version>NetApp Release 8.1.3P2 7-Mode: Fri Aug 23 20:16:59 PDT 2013</version>
        <is-clustered>false</is-clustered>
</results>

Perl v5.16.3 (with -w)

#/usr/local/bin/perl -w apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03pvt system-get-version
Subroutine NaServer::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.16.3/Exporter.pm line 66.
at ../../../../lib/perl/NetApp/NaServer.pm line 66.
"my" variable $use_port masks earlier declaration in same scope at apitest.pl line 96.
"my" variable @option masks earlier declaration in same scope at apitest.pl line 147.
"my" variable $xo masks earlier declaration in same scope at apitest.pl line 344.
Use of uninitialized value $host_equiv in numeric ne (!=) at apitest.pl line 183.
Use of uninitialized value $inputxml in numeric eq (==) at apitest.pl line 187.
Use of uninitialized value $host_equiv in numeric ne (!=) at apitest.pl line 229.
Use of uninitialized value $host_equiv in numeric eq (==) at apitest.pl line 311.
Use of uninitialized value $showxml in numeric eq (==) at apitest.pl line 316.
Use of uninitialized value $inputxml in numeric gt (>) at apitest.pl line 319.
Use of uninitialized value $showxml in numeric eq (==) at apitest.pl line 332.
Use of uninitialized value $showxml in numeric ne (!=) at apitest.pl line 350.

OUTPUT:
<results status="passed">
        <version>NetApp Release 8.1.3P2 7-Mode: Fri Aug 23 20:16:59 PDT 2013</version>
        <is-clustered>false</is-clustered>
</results>

View solution in original post

3 REPLIES 3

yannb
4,998 Views

Shot in the dark : are you running perl 32bit on a 64bit install, which may require a 32bit version of SSLeay or openssl libraries ?

I think I remember something similar while playing around with perl SDK on a 64 bit CentOS installation.

stuartlong
4,998 Views

No dice.  Both Perl interpreters are compiled 32-bit, and so is the openssl library (0.9.7).

I'm downloading the latest openssl and compiling it.

stuartlong
4,999 Views

Progress!

After running my script through the Perl debugger, I found a run-time 'require' for module Socket6, which I did not have installed.  Since the require is inside an eval block, it silently leaves a couple of variables unset (particularly $na_can_use_ipv6), which later on leads to a failure creating a socket.

After installing Socket6, there is a Exporter warning (only when using -w) about a redefined subroutine, but I'm not going to sweat that right now, as the process works.

For comparison:

Perl v5.8.4 (with -w)

#/usr/bin/perl -w apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03pvt system-get-version
"my" variable $use_port masks earlier declaration in same scope at apitest.pl line 96.
"my" variable @option masks earlier declaration in same scope at apitest.pl line 147.
"my" variable $xo masks earlier declaration in same scope at apitest.pl line 344.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 183.
Use of uninitialized value in numeric eq (==) at apitest.pl line 187.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 229.
Use of uninitialized value in numeric eq (==) at apitest.pl line 311.
Use of uninitialized value in numeric eq (==) at apitest.pl line 316.
Use of uninitialized value in numeric gt (>) at apitest.pl line 319.
Use of uninitialized value in numeric eq (==) at apitest.pl line 332.
Use of uninitialized value in numeric eq (==) at ../../../../lib/perl/NetApp/NaServer.pm line 1827.
Use of uninitialized value in numeric ne (!=) at apitest.pl line 350.

OUTPUT:
<results status="passed">
        <version>NetApp Release 8.1.3P2 7-Mode: Fri Aug 23 20:16:59 PDT 2013</version>
        <is-clustered>false</is-clustered>
</results>

Perl v5.16.3 (with -w)

#/usr/local/bin/perl -w apitest.pl -C /.nacerts/nmsdk_crt.pem -K /.nacerts/nmsdk_key.pem spnabu03pvt system-get-version
Subroutine NaServer::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.16.3/Exporter.pm line 66.
at ../../../../lib/perl/NetApp/NaServer.pm line 66.
"my" variable $use_port masks earlier declaration in same scope at apitest.pl line 96.
"my" variable @option masks earlier declaration in same scope at apitest.pl line 147.
"my" variable $xo masks earlier declaration in same scope at apitest.pl line 344.
Use of uninitialized value $host_equiv in numeric ne (!=) at apitest.pl line 183.
Use of uninitialized value $inputxml in numeric eq (==) at apitest.pl line 187.
Use of uninitialized value $host_equiv in numeric ne (!=) at apitest.pl line 229.
Use of uninitialized value $host_equiv in numeric eq (==) at apitest.pl line 311.
Use of uninitialized value $showxml in numeric eq (==) at apitest.pl line 316.
Use of uninitialized value $inputxml in numeric gt (>) at apitest.pl line 319.
Use of uninitialized value $showxml in numeric eq (==) at apitest.pl line 332.
Use of uninitialized value $showxml in numeric ne (!=) at apitest.pl line 350.

OUTPUT:
<results status="passed">
        <version>NetApp Release 8.1.3P2 7-Mode: Fri Aug 23 20:16:59 PDT 2013</version>
        <is-clustered>false</is-clustered>
</results>

Public