Reply
Accepted Solution

CSV export file contains duplicate hostrecords

Adviser
Posts: 65
3537     0

I've been doing a lot of work in the lab environment exporting csv files via the RESTful API.  One thing I have noticed is that when I export a zone's records, the csv file almost always contains duplicate hostrecords.  I discovered this by watching the csv import jobs (imported the file into a different view) and looking at the error count.  I then downloaded the errors and all of them were due to "Insertion aborted due to The record <insert record name here> already exists."

 

I then went back and looked at the original csv file that was exported, and indeed, it contains duplicate hostrecords.  Any idea why the csv export would contain duplicate records?  I don't know if this is a database problem or something specific to the csv export process.  This has me concerned because my lab environment is an exact copy of our production environment.

 

For now I will have to perform extra processing.  I'll have to sort the lines in the csv file and remove the duplicates.  Also have to set the import to "on error" "continue" or else it will abend.

 

I'd like to find out why I'm getting duplicate records.  Has anybody else seen this?  I'm running NIOS 7.3.8.

Re: CSV export file contains duplicate hostrecords

[ Edited ]
Adviser
Posts: 65
3538     0

I just verified this issue.  The unprocessed csv export file does contain duplicate records.   About 17% of the records are duplicate and the issue is repeatable.  Same duplicate records according to sample I checked.  The weird thing is that I do not get any duplicate records if I perform the csv export from the web gui.  This might be a bug with the API.

 

 

Re: CSV export file contains duplicate hostrecords

GHorne Community Manager
Community Manager
Posts: 248
3538     0

Can you provide a sample of the duplicates ?

the CSV export often puts out both host records and 'hostaddress' objects

(the latter being redundant and useful for corner case situations)

so you may just be seeing these.

Re: CSV export file contains duplicate hostrecords

Adviser
Posts: 65
3538     0

You are exactly right.  I'm getting duplicate host records and hostaddress records.  As long as my CSV imports are set to NOT stop on error, they proceed and complete.  I came to the conclusion the duplicates don't hurt anything.  I now preprocess my CSV files before importing them into a different DNS view to remove the duplicates.

 

I still get duplicates when I import a forward and reverse zone because the hostrecord creates the reverse entry for me.  Then, when importing the reverse zone, some of the records are already there, some aren't.  This has been a good learning experience.

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Demo: Infoblox IPAM plug-in integration with OpenStack Newton