Forum Discussion
Error while establishing device trust
Not sure what's going on here. Any ideas?
Thanks in advance,
Chris
[chris@luckylx02 bin]$ f5bdt2 "$sglb" "$mg2" "$b1n" "$b2n"
SOAP-ENV:Server Exception caught in Management::urn:iControl:Management/Trust::add_authority_device()
Exception: Common::OperationFailed
primary_error_code : 16908289 (0x01020001)
secondary_error_code : 0
error_string : Trust daemon returned an error: Could not examine network interfaces: CsO/w78D
Code:
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
use SOAP::Lite;
use MIME::Base64;
BEGIN { push (@INC, '/home/chris'); }
use iControlTypeCast;
$sHost = $ARGV[1];
my $sUID = admin;
my $sPWD = $ARGV[0];
my $b1n = $ARGV[2];
my $b2n = $ARGV[3];
----------------------------------------------------------------------------
checkResponse makes sure the error isn't a SOAP error
----------------------------------------------------------------------------
sub checkResponse() {
my ($soapResponse) = (@_);
if ( $soapResponse->fault )
{
print $soapResponse->faultcode, " ", $soapResponse->faultstring, "\n";
exit();
}
}
sub buildtrust {
$soapResponse =
$dtrmgmt->add_authority_device
(
SOAP::Data->name (address => 10.255.255.3),
SOAP::Data->name ( username => admin ),
SOAP::Data->name ( password => XXXXXXXX ),
SOAP::Data->name ( device_object_name => "$b1n" ),
SOAP::Data->name ( browser_cert_serial_number => "" ),
SOAP::Data->name ( browser_cert_signature => "" ),
SOAP::Data->name ( browser_cert_sha1_fingerprint => "" ),
SOAP::Data->name ( browser_cert_md5_fingerprint => "" ),
);
&checkResponse($soapResponse);
$soapResponse =
$dgmgmt->create
(
SOAP::Data->name (device_groups => [sg-sf] ),
SOAP::Data->name ( type => [DGT_FAILOVER] ),
);
&checkResponse($soapResponse);
$soapResponse =
$dgmgmt->add_device
(
SOAP::Data->name (device_groups => [sg-sf] ),
SOAP::Data->name ( devices => [$b1n , $b2n] ),
);
&checkResponse($soapResponse);
}
$dtrmgmt = SOAP::Lite
-> uri('urn:iControl:Management/Trust')
-> readable(1)
-> proxy("");
eval {
$dtrmgmt->transport->http_request->header( 'Authorization' => 'Basic '
. MIME::Base64::encode("$sUID:$sPWD", ''));
};
$dgmgmt = SOAP::Lite
-> uri('urn:iControl:Management/DeviceGroup')
-> readable(1)
-> proxy("");
eval {
$dgmgmt->transport->http_request->header( 'Authorization' => 'Basic '
. MIME::Base64::encode("$sUID:$sPWD", ''));
};
Main Program Logic
&buildtrust;
[chris@luckylx02 bin]$ f5bdt2 "$sglb" "$mg2" "$b1n" "$b2n"
SOAP-ENV:Server Exception caught in Management::urn:iControl:Management/Trust::add_authority_device()
Exception: Common::OperationFailed
primary_error_code : 16908289 (0x01020001)
secondary_error_code : 0
error_string : Trust daemon returned an error: Could not examine network interfaces: CsO/w78D
8 Replies
- Faintly_Lucky
Nimbostratus
Here's what I got out of the LTM log: Which method is returning the error, the call to add_authority_device(), create(), or add_device()? From the code it looks good since I don't know what you are passing in for parameters, not sure where the "CsO/w78B" interface is coming from. Have you gone through the same process in the GUI with the same parameters and does that work?
- Faintly_Lucky
Nimbostratus
Joe: In looking at the server code, it looks like your value for "address" is getting garbled at some point. Not sure if it's on the client side, or on the server. The one thing that sticks out is that you aren't enclosing your "string" values with quotes, specifically for the "address" parameter. Just for kicks, could you try surrounding the strings with quotes?
$soapResponse =$dtrmgmt->add_authority_device(SOAP::Data->name (address => "10.255.255.3"),SOAP::Data->name ( username => "admin" ),SOAP::Data->name ( password => "XXXXXXXX" ),SOAP::Data->name ( device_object_name => "$b1n" ),SOAP::Data->name ( browser_cert_serial_number => "" ),SOAP::Data->name ( browser_cert_signature => "" ),SOAP::Data->name ( browser_cert_sha1_fingerprint => "" ),SOAP::Data->name ( browser_cert_md5_fingerprint => "" ),);And see if that takes care of it. It could be that SOAP::Lite is doing something wonky with the value 10.255.255.3 and not passing it as a string but converting it somehow.
If that doesn't work for you, could you enable SOAP::Lite tracing and look for what's passed in the SOAPRequest for the address parameter? Toss this at the top of your script when you import the SOAP::Lite lib and that will dump the full request/response to the console.
use SOAP::Lite + trace => qw(method debug);
Hopefully the string enclosing will work, but if not the trace should get us a little further.
-Joe
OK, I'm almost 100% sure that enclosing the strings will solve the problem. I tried another iControl call with SOAP::Lite to a method that took an IP address. When I passed the string as
SOAP::Data->name(self_ips => ["10.255.255.3"])
it passed in the trace correctly,
[self_ips ...="" soapenc:arraytype="xsd:string[1]"][item xsi:type="xsd:string"]10.255.255.3[/item][/self_ips]
But, when I omitted the quotes
SOAP::Data->name(self_ips => [10.255.255.3])
it was converted into Base64binary
[self_ips ...="" soapenc::arraytype="xsd:base64Binary[1]"][item xsi:type="xsd:base64Binary"]CsO/w78D[/item][/self_ips]
The "CsO/w78D" is the error you were getting for an invalid address.
-Joe
- Faintly_Lucky
Nimbostratus
Joe, - Faintly_Lucky
Nimbostratus
Joe, - Awesome, glad to help!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com