Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

Security

Reply
Highlighted

host->add : XML parsing error

Authority
Posts: 37
2625     0

While trying to add DNS hosts via perl I'm getting errorcode 1012 - XML parsing error: not well-formed (invalid token). However, I cannot find any big differences between those that succeed and those that fail.

This one fails (output after add action) :

$VAR1 = bless( {
  'extensible_attributes' => {
    'DB_GUID' => 'ID005056010104iTRtUQs20CCwJJgK',
    'Device Type' => 'Switch',
    'SiteCode' => 'ABC',
    'Owner' => 'we own it',
    'Site' => 'ABCDEF',
    'Location' => 'AB-12-34-567',
    'Source' => 'Inventory',
    'Device Model' => 'WS-C3750V2-48PS',
    'DB_modified_date' => '1366111374'
  },
  'ipv4addrs' => [
    '10.97.188.99'
  ],
  'comment' => 'Imported from Database',
  'name' => 'hostname1.zone.domain.com'
}, 'Infoblox:Smiley Very HappyNS::Host' );

This one succeeds (output after add action) :

$VAR1 = bless( {
  'extensible_attributes' => {
    'DB_GUID' => 'ID005056010104sTBtUQDGzzCge3YK',
    'Device Type' => 'Switch',
    'SiteCode' => 'ABC',
    'Owner' => 'we own it',
    'Site' => 'ABCDEF',
    'Location' => 'AB-12-00-071',
    'Source' => 'Inventory',
    'Device Model' => 'WS-CBS3120X-S',
    'DB_modified_date' => '1366110750'
  },
  'ipv4addrs' => [
    '10.102.74.86'
  ],
  'comment' => 'Imported from Database',
  'name' => 'hostname2.zone.domain.com',
  '__object_id__' => 'dns.host$._default.com.domain.zone.hostname2'
}, 'Infoblox:Smiley Very HappyNS::Host' );

There is only a difference in the network size. The first one is a /28, the second one a /24. But shouldn't be an issue as it is irrelevant to DNS. Both are in the same zone and both have an existing reverse zone.

Below you'll find the code with which I create the new DNS objects :

Source, Owner, Site, SiteCode and Device Type are required attributes.

Manually adding the host with the same values as generated by the script works fine.

Highlighted

Re: host->add : XML parsing

Employee
Employee
Posts: 171
2626     0

I don't see anything in that code that should be causing that error. Not sure why you're seeing it based on this. 

Highlighted

Re: host->add : XML parsing

Authority
Posts: 37
2626     0

I've been doing some more testing. I've tried to let the script add hosts from several other networks and it seems to be isolated to only the hosts in the entire 10.97.188.0/24 network not only the /28 network from the original post.

Other networks regardless of their size seem to accept hosts from the script without any issue.

Could there be a configuration error for the reverse zone of 10.97.188.0?

 

Highlighted

Re: host->add : XML parsing

Employee
Employee
Posts: 171
2626     0

That's possible, but I'm not sure why that'd throw an XML format error. that's what doesn't make sense to me. 

Highlighted

Re: host->add : XML parsing

Authority
Posts: 37
2626     0

Solution found :

The problem lies in the value of $model.

Apparently some values in the source database end with a NULL character. After stripping the NULL character (s/\x00//g) from the $model variable I no longer get the XML parsing error when adding a new host to the Infoblox grid.

 

Highlighted

Re: host->add : XML parsing

Employee
Employee
Posts: 171
2626     0

yeah, that would dfeinitely cause a problem and not be easy to find. Glad you tracked it down!

Showing results for 
Search instead for 
Do you mean 

Recommended for You