Forum Discussion

Brian_O_Kelley_'s avatar
Brian_O_Kelley_
Icon for Nimbostratus rankNimbostratus
Jan 02, 2008

No fault on VirtualServer.create but nothing happens

I saw this on a number of commands, usually when I had an incorrect parameter. This worries me - I'm making the assumption that if no SOAPFault occurs, my command completed successfully. I see the command reach the BigIP in the logs, but I don't see anything actually happening. I'm using BIG-IP 9.3.0 Build 178.5.

 

 

Here's an example (I'm using SOAP::Lite in perl):

 

sub addVirt($$$$$) {

 

my($name, $address, $port, $profile, $doit) = @_;

 

$virt_def = {name => $name, address => $address, port => $port, protocol => 'PROTOCOL_TCP'};

 

$virt_res = {type => "RESOURCE_TYPE_POOL", default_pool_name => $name};

 

$virt_prof = {profile_context => "PROFILE_CONTEXT_TYPE_CLIENT", profile_name => ""};

 

@virt_profs = [$virt_prof] ;

 

if ($doit) {

 

$soapResponse = $VirtualServer->create(SOAP::Data->name(definitions => [$virt_def]),

 

SOAP::Data->name(wildmasks => []),

 

SOAP::Data->name(resources => [$virt_res]),

 

SOAP::Data->name(profiles => [@virt_profs]));

 

if ($soapResponse->fault) {

 

print("SOAP fault: " , $soapResponse->faultcode , " " ,

 

$soapResponse->faultstring , "\n");

 

return 1;

 

}

 

}

 

print "Added virt $name at $address:$port with profile '$profile'\n";

 

return 0;

 

}

 

 

 

Here's what I see on the client side:

 

SOAPAction: "urn:iControl:LocalLB/VirtualServercreate"

 

 

 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

 

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"

 

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

 

soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

 

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

 

 

 

 

 

PROTOCOL_TCP

 

 

bob

 

 

34.23.23.2

 

 

80

 

 

 

 

 

 

 

 

bob

 

 

RESOURCE_TYPE_POOL

 

 

 

 

 

 

 

 

 

PROFILE_CONTEXT_TYPE_CLIENT

 

 

 

 

 

 

 

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x140d4c0)

 

SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK

 

Connection: close

 

Date: Wed, 02 Jan 2008 04:57:07 GMT

 

Server: Apache

 

Content-Type: text/xml; charset="UTF-8"

 

Client-Date: Wed, 02 Jan 2008 04:55:59 GMT

 

Client-Peer: 8.10.75.125:443

 

Client-Response-Num: 1

 

Client-SSL-Cert-Issuer: /C=--/ST=WA/L=Seattle/O=MyCompany/OU=1191895286/CN=dhcp-68/emailAddress=root@dhcp-68

 

Client-SSL-Cert-Subject: /C=--/ST=WA/L=Seattle/O=MyCompany/OU=1191895286/CN=dhcp-68/emailAddress=root@dhcp-68

 

Client-SSL-Cipher: DHE-RSA-AES256-SHA

 

Client-SSL-Warning: Peer certificate not verified

 

Client-Transfer-Encoding: chunked

 

Set-Cookie: BIGIPAuthCookie=732B56B828B5AD672030C450317E6098B0F8B53A; path=/;

 

SOAPServer: EasySoap++/0.6

 

 

xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"

 

xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"

 

xmlns:s="http://www.w3.org/2001/XMLSchema-instance"

 

xmlns:y="http://www.w3.org/2001/XMLSchema"

 

xmlns:iControl="urn:iControl"

 

E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

 

 

xmlns:m="urn:iControl:LocalLB/VirtualServer">

 

 

 

 

 

Here's what I see in the trace on the server side:

 

Jan 1 20:55:36 slb1b iControlPortal.cgi[27091]: icontrol_portal: PROTOCOL_TCP bob 34.23.23.2 80 bob RESOURCE_TYPE_POOL PROFILE_CONTEXT_TYPE_CLIENT

 

Jan 1 20:55:36 slb1b iControlPortal.cgi[27091]: LocalLB:+++++++++++++++++++++++++++++++++++++

 

Jan 1 20:55:36 slb1b iControlPortal.cgi[27091]: LocalLB:VirtualServer::create ( ) called by user "admin"

 

Jan 1 20:55:36 slb1b iControlPortal.cgi[27091]: LocalLB:-------------------------------------

 

4 Replies

  • The issue you are having is that the wildmasks parameter you are passing in converting to an zero length array. The server side logic will parse loop over the input arrays and expects that all the arrays are of equal size and will ignore entries where the sizes don't match.

    $soapResponse = $VirtualServer->create(SOAP::Data->name(definitions => [$virt_def]),
    SOAP::Data->name(wildmasks => []),
    SOAP::Data->name(resources => [$virt_res]),
    SOAP::Data->name(profiles => [@virt_profs]));

    If you look at the trace, the definitions, resources, and profiles parameters are all array sized one, while the wildmasks parameter is array sized zero.

    This get's to a philosophical question on how we designed the APIs in handling zero sized arrays. This is really the same behavior as if you would call a method with a single array and the size is 0. Should we throw an exception or just ignore the call as a noop? I can see the argument either way but in your case it probably would have been best to toss back a fault to warn you. But, the thing with this type of error is that it will never work so you should find it out in your development process before you move it to production. If you feel strongly about us adding exceptions in the case of incorrect sized input arrays, please submit a support case and it can get passed on to dev to look at.

    In the mean time, this should work for you.

    $soapResponse = $VirtualServer->create(SOAP::Data->name(definitions => [$virt_def]),
    SOAP::Data->name(wildmasks => [""]),
    SOAP::Data->name(resources => [$virt_res]),
    SOAP::Data->name(profiles => [@virt_profs]));

    An empty string is how you should pass in the no wildmask option.

    I haven't tested this out but everything else looks ok from first glance.

    -Joe
  • As for your second post about Pool.add_member, this is the same issue. The members array is getting converted to a list of scalars , not a soapenc:Array.

     

     

    
      
        bob
      
      
        8.10.72.5
        80
      
      
        192.168.1.12
        80
      

     

     

    The server is trying to convert the first members parameter into an array and since it doesn't have an associated soapenc:arrayType attribute, the server is treating this like a zero-sized array.

     

     

    This is one of the down sides of using a loosely typed languate like Perl. There are issues that you must determine at debug time that tightly coupled languages will catch. The fix for your code is easy though, just make sure you surround your array parameter values to make sure that the SOAP::Lite client library will treat that variable as a soap array.

     

     

     $soapResponse = $Pool->add_member(
      SOAP::Data->name(pool_names => [$pool]),
      SOAP::Data->name(members => [@members]));

     

     

    then soap trace should look something like this:

     

     

    
      
        bob
      
      
        
          8.10.72.5
          80
        
        
          192.168.1.12
          80
        
      

     

     

    -Joe
  • Joe, I hear you on loosely-typed. Not a huge perl fan, but it's what I'm stuck with at the moment. To your response, I did try it this way too - I think it looks the same way yours does, but I do get an error here:

     

     

    SOAPAction: "urn:iControl:LocalLB/Pooladd_member"

     

     

     

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

     

    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"

     

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

     

    soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

     

    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

     

     

     

     

    bob

     

     

     

     

     

    8.10.72.5

     

     

    80

     

     

     

     

    192.168.1.12

     

     

    80

     

     

     

     

     

     

    SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x13cb960)

     

    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error

     

    Connection: close

     

    Date: Wed, 02 Jan 2008 18:32:46 GMT

     

    Server: Apache

     

    Content-Type: text/xml; charset="UTF-8"

     

    Client-Date: Wed, 02 Jan 2008 18:31:45 GMT

     

    Client-Peer: 8.10.75.125:443

     

    Client-Response-Num: 1

     

    Client-SSL-Cert-Issuer: /C=--/ST=WA/L=Seattle/O=MyCompany/OU=1191895286/CN=dhcp-68/emailAddress=root@dhcp-68

     

    Client-SSL-Cert-Subject: /C=--/ST=WA/L=Seattle/O=MyCompany/OU=1191895286/CN=dhcp-68/emailAddress=root@dhcp-68

     

    Client-SSL-Cipher: DHE-RSA-AES256-SHA

     

    Client-SSL-Warning: Peer certificate not verified

     

    Client-Transfer-Encoding: chunked

     

    Set-Cookie: BIGIPAuthCookie=717BE7F6F54A84A60CBB9676A3D9A8EB082EDA9E; path=/;

     

    SOAPServer: EasySoap++/0.6

     

     

    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

     

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

     

    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

     

     

     

    xsi:type="xsd:string">SOAP-ENV:Server

     

    xsi:type="xsd:string">Could not find element by name: address