[PDB-tech] peeringdb sync - sometimes gets errors.

Matt Griswold grizz at 20c.com
Fri Apr 15 22:37:54 PDT 2016


This should function as expected with the 2.0.8 release - please test
and get back to us. I'm glad you guys found and posted work arounds,
but the goal is to never have to drop and do a fresh sync :)

Cheers!

* Chris Caputo <ccaputo at alt.net> [160413 21:40 +0000]:
> And if a dedicated sqlite file, you can just remove the sqlite3 file
>   to start from scratch.
> 
> I normally cron run "peeringdb sync" hourly with "> /dev/null 2>&1"
>   which masks these errors, so once per day I run without a filter.
>   Ex.:
> 
> # Hourly update to peeringdb file
> 00 1-23 * * * sleep
>   $[RANDOM\%300] ; /home/seaix/src/wiki_ip_converter/pdbvenv/bin/peeringdb
>   sync > /dev/null 2>&1 # Do a daily run without error filtering, so
>   we can learn about any errors. 00 00   * * * sleep
>   $[RANDOM\%300] ; /home/seaix/src/wiki_ip_converter/pdbvenv/bin/peeringdb
>   sync
> 
> Martin, I opened an issue and added your error to it:
> 
>   https://github.com/peeringdb/peeringdb-py/issues/6
> 
> Thanks,
> Chris
> 
> On Wed, 13 Apr 2016, Martin J. Levy wrote:
> > All,
> > Occasionally I get errors from doing a sync command.  
> > > django.core.exceptions.ValidationError: {'name': [u'Organization
> > >   with this Name already exists.']}  
> >  
> > I've gone back-n-forth on trying to fix this; however I realized I
> >   should share this sql script that I run prior to "sync" in order
> >   to fix this. Once you run "sync" you have a clean copy of
> >   PeeringDB.
> > 
> > This can be found
> >   at https://github.com/peeringdb/peeringdb-py/pull/7
> > 
> > Enjoy,
> > 
> > Martin
> > 
> > -----------
> > $ cat drop-tables-peeringdb.sql 
> > DROP TABLE IF EXISTS peeringdb_facility;
> > DROP TABLE IF EXISTS peeringdb_ix;
> > DROP TABLE IF EXISTS peeringdb_ix_facility;
> > DROP TABLE IF EXISTS peeringdb_ixlan;
> > DROP TABLE IF EXISTS peeringdb_ixlan_prefix;
> > DROP TABLE IF EXISTS peeringdb_network;
> > DROP TABLE IF EXISTS peeringdb_network_contact;
> > DROP TABLE IF EXISTS peeringdb_network_facility;
> > DROP TABLE IF EXISTS peeringdb_network_ixlan;
> > DROP TABLE IF EXISTS peeringdb_organization;
> > DROP TABLE IF EXISTS auth_group;
> > DROP TABLE IF EXISTS auth_group_permissions;
> > DROP TABLE IF EXISTS auth_permission;
> > DROP TABLE IF EXISTS auth_user;
> > DROP TABLE IF EXISTS auth_user_groups;
> > DROP TABLE IF EXISTS auth_user_user_permissions;
> > DROP TABLE IF EXISTS django_admin_log;
> > DROP TABLE IF EXISTS django_content_type;
> > DROP TABLE IF EXISTS django_migrations;
> > DROP TABLE IF EXISTS django_session;
> > $  



More information about the Pdb-tech mailing list