<div dir="ltr">Hi, Milton,<div>Just want to confirm (to keep you in the loop), your suggestion did fix the problem for me.</div><div>Thanks again,</div><div>Brian</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 15, 2020 at 3:41 PM Milton Ngan <<a href="mailto:milton@valvesoftware.com">milton@valvesoftware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_5594757416864807687divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<div id="gmail-m_5594757416864807687divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>I replicated the problem and added some additional debugging to illustrate the problem. The first time stamp is what is in the object and is in UTC, the second is the UTC timestamp for now, and the third is the local timestamp. You can see that the update
 time is in the "future" by about 37 minutes from the local time, but is about 7 hours old when compared to UTC. </p>
<p><br>
</p>
<p></p>
<div>Syncing to <a href="https://www.peeringdb.com/api" target="_blank">https://www.peeringdb.com/api</a></div>
<div>Updating resources: org fac net ix ixfac ixlan ixpfx netfac netixlan poc</div>
<div>Fetching & updating all: org</div>
<div>Updates to be processed: 10</div>
<div>Ignoring object updated after sync began: (org-26096)</div>
<div>UPDATED: 2020-05-15 14:59:14, UTC: 2020-05-15 21:22:31.806911, NOW: 2020-05-15 14:22:31.806908</div>
<div>Ignoring object updated after sync began: (org-26092)</div>
<div>UPDATED: 2020-05-15 15:29:39, UTC: 2020-05-15 21:22:31.806911, NOW: 2020-05-15 14:22:31.806908</div>
<div>Ignoring object updated after sync began: (org-26097)</div>
<div>UPDATED: 2020-05-15 15:55:02, UTC: 2020-05-15 21:22:31.806911, NOW: 2020-05-15 14:22:31.806908</div>
<div>Ignoring object updated after sync began: (org-26094)</div>
<br>
<p></p>
<p></p>
<p><br>
I think the problem is that because the code filters out objects that have "changed" after the sync time. However even if those objects existed prior to that time <span style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">they
 may not get inserted,</span> thus causing referential integrity issues. <span style="font-size:12pt">I think the intent was that in the worst case you would be some amount of time behind PeeringDB, but this is not the case. I think the logic that is there
 is pretty dangerous because within the window of you performing the sync, you might hit this case, but it is pretty rare since a full sync probably takes 3-4 minutes and an incremental less than a minute. </span></p>
<p><br>
</p>
<ol style="margin-bottom:0px;margin-top:0px">
<li>Object A gets created at time X and is referenced by Object B</li><li>Start sync at time X+1</li><li>Object A gets updated at X+2</li><li>Try to sync object A at X+3 but is skipped leaving Object B with a dangling reference to Object A </li></ol>
<div></div>
<div><br>
</div>
<p></p>
Now in combination with the timezone issue, the window where you can get inconsistent changes is like 8 hours for people here in on the West Coast of the US. A lot of changes can happen in 8 hours...</div>
<div id="gmail-m_5594757416864807687divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
<br>
<div style="color:rgb(0,0,0)">
<div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_5594757416864807687x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Pdb-tech <<a href="mailto:pdb-tech-bounces@lists.peeringdb.com" target="_blank">pdb-tech-bounces@lists.peeringdb.com</a>> on behalf of Chris Caputo <<a href="mailto:ccaputo@alt.net" target="_blank">ccaputo@alt.net</a>><br>
<b>Sent:</b> Friday, May 15, 2020 2:42 PM<br>
<b>To:</b> Brian Dickson<br>
<b>Cc:</b> <a href="mailto:pdb-tech@lists.peeringdb.com" target="_blank">pdb-tech@lists.peeringdb.com</a><br>
<b>Subject:</b> [External Mail] Re: [PDB Tech] Problem doing initial 'peeringdb sync', foreign key constraint fails?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div>Any better with Milton's 'self.start_time = datetime.utcnow()' change?<br>
<br>
Thanks,<br>
Chris<br>
<br>
On Fri, 15 May 2020, Brian Dickson wrote:<br>
> On Fri, May 15, 2020 at 12:57 PM Brian Dickson <<a href="mailto:brian.peter.dickson@gmail.com" target="_blank">brian.peter.dickson@gmail.com</a>> wrote:<br>
>       The local database is empty. I'll make sure that's the case just to be safe.<br>
> <br>
> # peeringdb --version<br>
> <br>
> peeringdb 1.0.0<br>
> <br>
> <br>
> # django-admin --version<br>
> <br>
> 2.2.12<br>
> <br>
> <br>
> # pip freeze<br>
> <br>
> asgiref==3.2.7<br>
> <br>
> certifi==2020.4.5.1<br>
> <br>
> cfu==1.5.0<br>
> <br>
> chardet==3.0.4<br>
> <br>
> click==7.1.2<br>
> <br>
> Django==2.2.12<br>
> <br>
> django-countries==6.1.2<br>
> <br>
> django-handleref==0.5.0<br>
> <br>
> django-inet==0.4.0<br>
> <br>
> django-peeringdb==2.0.0<br>
> <br>
> future==0.18.2<br>
> <br>
> idna==2.9<br>
> <br>
> munge==1.0.0<br>
> <br>
> mysqlclient==1.4.4<br>
> <br>
> peeringdb==1.0.0<br>
> <br>
> PyMySQL==0.9.3<br>
> <br>
> pytz==2020.1<br>
> <br>
> PyYAML==5.3.1<br>
> <br>
> requests==2.23.0<br>
> <br>
> six==1.14.0<br>
> <br>
> sqlparse==0.3.1<br>
> <br>
> twentyc.rpc==0.4.0<br>
> <br>
> urllib3==1.25.9<br>
> <br>
> <br>
> <br>
> Here is the result when running the sync on a clean empty local database:<br>
> <br>
> bash-3.2# peeringdb drop-tables<br>
> <br>
> bash-3.2# peeringdb sync<br>
> <br>
> Syncing to <a href="https://www.peeringdb.com/api" id="gmail-m_5594757416864807687LPlnk993981" target="_blank">
https://www.peeringdb.com/api</a><br>
> <br>
> Updating resources: org fac net ix ixfac ixlan ixpfx netfac netixlan poc<br>
> <br>
> Fetching & updating all: org<br>
> <br>
> Updates to be processed: 18439<br>
> <br>
> Ignoring object updated after sync began: (org-6864)<br>
> <br>
> Ignoring object updated after sync began: (org-13687)<br>
> <br>
> Ignoring object updated after sync began: (org-23582)<br>
> <br>
> Ignoring object updated after sync began: (org-26092)<br>
> <br>
> Ignoring object updated after sync began: (org-26094)<br>
> <br>
> Ignoring object updated after sync began: (org-26095)<br>
> <br>
> Ignoring object updated after sync began: (org-26096)<br>
> <br>
> Ignoring object updated after sync began: (org-26097)<br>
> <br>
> Ignoring object updated after sync began: (org-26098)<br>
> <br>
> Fetching & updating all: fac<br>
> <br>
> Updates to be processed: 3714<br>
> <br>
> Ignoring object updated after sync began: (fac-3634)<br>
> <br>
> Ignoring object updated after sync began: (fac-8262)<br>
> <br>
> Ignoring object updated after sync began: (fac-8582)<br>
> <br>
> Ignoring object updated after sync began: (fac-8583)<br>
> <br>
> Ignoring object updated after sync began: (fac-8584)<br>
> <br>
> Ignoring object updated after sync began: (fac-8585)<br>
> <br>
> Ignoring object updated after sync began: (fac-8586)<br>
> <br>
> Ignoring object updated after sync began: (fac-8587)<br>
> <br>
> Ignoring object updated after sync began: (fac-8588)<br>
> <br>
> Ignoring object updated after sync began: (fac-8591)<br>
> <br>
> Ignoring object updated after sync began: (fac-8592)<br>
> <br>
> Ignoring object updated after sync began: (fac-8593)<br>
> <br>
> Ignoring object updated after sync began: (fac-8594)<br>
> <br>
> Ignoring object updated after sync began: (fac-8595)<br>
> <br>
> Ignoring object updated after sync began: (fac-8597)<br>
> <br>
> Ignoring object updated after sync began: (fac-8598)<br>
> <br>
> Ignoring object updated after sync began: (fac-8599)<br>
> <br>
> Ignoring object updated after sync began: (fac-8600)<br>
> <br>
> Ignoring object updated after sync began: (fac-8601)<br>
> <br>
> Ignoring object updated after sync began: (fac-8602)<br>
> <br>
> Ignoring object updated after sync began: (fac-8603)<br>
> <br>
> Fetching & updating all: net<br>
> <br>
> Updates to be processed: 18845<br>
> <br>
> Ignoring object updated after sync began: (net-2913)<br>
> <br>
> Ignoring object updated after sync began: (net-3087)<br>
> <br>
> Ignoring object updated after sync began: (net-4823)<br>
> <br>
> Ignoring object updated after sync began: (net-5442)<br>
> <br>
> Ignoring object updated after sync began: (net-7482)<br>
> <br>
> Ignoring object updated after sync began: (net-9435)<br>
> <br>
> Ignoring object updated after sync began: (net-13681)<br>
> <br>
> Ignoring object updated after sync began: (net-14816)<br>
> <br>
> Ignoring object updated after sync began: (net-19500)<br>
> <br>
> Ignoring object updated after sync began: (net-20575)<br>
> <br>
> Ignoring object updated after sync began: (net-21292)<br>
> <br>
> Ignoring object updated after sync began: (net-21916)<br>
> <br>
> Ignoring object updated after sync began: (net-23222)<br>
> <br>
> Ignoring object updated after sync began: (net-23266)<br>
> <br>
> Ignoring object updated after sync began: (net-23280)<br>
> <br>
> Ignoring object updated after sync began: (net-23283)<br>
> <br>
> Ignoring object updated after sync began: (net-23284)<br>
> <br>
> Ignoring object updated after sync began: (net-23285)<br>
> <br>
> Traceback (most recent call last):<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/bin/peeringdb", line 8, in <module><br>
> <br>
>     sys.exit(main())<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/cli.py", line 62, in main<br>
> <br>
>     return handler(config=cfg, **vars(options))<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/commands.py", line 20, in _wrapped<br>
> <br>
>     r = func(*a, **k)<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/commands.py", line 219, in handle<br>
> <br>
>     client.update_all(rs)<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 66, in update_all<br>
> <br>
>     self._atomic_update(lambda: ctx.sync_resource(r, since=since))<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 78, in _atomic_update<br>
> <br>
>     sync_func()<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 66, in <lambda><br>
> <br>
>     self._atomic_update(lambda: ctx.sync_resource(r, since=since))<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_tasks_async.py", line 65, in _wrapped<br>
> <br>
>     return loop.run_until_complete(func(*a, **k))<br>
> <br>
>   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 488, in run_until_complete<br>
> <br>
>     return future.result()<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_tasks_async.py", line 41, in _wrapped<br>
> <br>
>     item = gen.send(r)<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 287, in sync_row<br>
> <br>
>     B.clean(obj)<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django_peeringdb/client_adaptor/backend.py", line 145, in clean<br>
> <br>
>     obj.full_clean()<br>
> <br>
>   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/base.py", line 1203, in full_clean<br>
> <br>
>     raise ValidationError(errors)<br>
> <br>
> django.core.exceptions.ValidationError: {'org': ['organization instance with id 13687 does not exist.']}<br>
> <br>
>  <br>
> <br>
>       On Fri, May 15, 2020 at 10:55 AM Chris Caputo <<a href="mailto:ccaputo@alt.net" target="_blank">ccaputo@alt.net</a>> wrote:<br>
>       Hi.  Does restarting with a fresh/empty local database help at all?<br>
> <br>
>       Also, what does the following show?:<br>
> <br>
>       peeringdb --version<br>
>       django-admin --version<br>
>       pip freeze<br>
> <br>
>       Thanks,<br>
>       Chris<br>
> <br>
>       On Fri, 15 May 2020, Brian Dickson wrote:<br>
>       > Arnold Nipper said to send to this list.<br>
>       ><br>
>       > (This is kind of urgent for me, my goal is to get a snapshot of the data, so any alternative workaround would be helpful in the<br>
>       > meantime.)<br>
>       ><br>
>       > I'm in the process of setting up a local copy, and have run into a problem after getting the peeringdb-py stuff set up.<br>
>       ><br>
>       > When I do peeringdb sync (with the correct mysql database UTF8 stuff and everything,), I am currently getting a persistent error<br>
>       > which aborts the sync with no data in the tables:<br>
>       ><br>
>       > (Apologies in advance for the long error output text.)<br>
>       > Syncing to <a href="https://www.peeringdb.com/api" id="gmail-m_5594757416864807687LPlnk324959" target="_blank">https://www.peeringdb.com/api</a><br>
>       > Updating resources: org fac net ix ixfac ixlan ixpfx netfac netixlan poc<br>
>       > Fetching & updating all: org<br>
>       > Updates to be processed: 5<br>
>       > Ignoring object updated after sync began: (org-26015)<br>
>       > Ignoring object updated after sync began: (org-26052)<br>
>       > Ignoring object updated after sync began: (org-17918)<br>
>       > Ignoring object updated after sync began: (org-26053)<br>
>       > Fetching & updating all: fac<br>
>       > Updates to be processed: 0<br>
>       > Fetching & updating all: net<br>
>       > Updates to be processed: 18800<br>
>       > Ignoring object updated after sync began: (net-1356)<br>
>       > Ignoring object updated after sync began: (net-3684)<br>
>       > Ignoring object updated after sync began: (net-7924)<br>
>       > Ignoring object updated after sync began: (net-10733)<br>
>       > Ignoring object updated after sync began: (net-13084)<br>
>       > Ignoring object updated after sync began: (net-14581)<br>
>       > Ignoring object updated after sync began: (net-15702)<br>
>       > Traceback (most recent call last):<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/utils.py",<br>
>       > line 84, in _execute<br>
>       >     return self.cursor.execute(sql, params)<br>
>       >   File<br>
>       > "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line<br>
>       > 71, in execute<br>
>       >     return self.cursor.execute(query, args)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 209, in<br>
>       > execute<br>
>       >     res = self._query(query)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 315, in<br>
>       > _query<br>
>       >     db.query(q)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/connections.py", line<br>
>       > 226, in query<br>
>       >     _mysql.connection.query(self, query)<br>
>       > MySQLdb._exceptions.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails<br>
>       > (`peeringdb`.`peeringdb_network`, CONSTRAINT `peeringdb_network_org_id_404d6106_fk_peeringdb_organization_id` FOREIGN KEY<br>
>       > (`org_id`) REFERENCES `peeringdb_organization` (`id`))')<br>
>       ><br>
>       > The above exception was the direct cause of the following exception:<br>
>       ><br>
>       > Traceback (most recent call last):<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/bin/peeringdb", line 8, in <module><br>
>       >     sys.exit(main())<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/cli.py", line 62, in<br>
>       > main<br>
>       >     return handler(config=cfg, **vars(options))<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/commands.py", line 20,<br>
>       > in _wrapped<br>
>       >     r = func(*a, **k)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/commands.py", line 219,<br>
>       > in handle<br>
>       >     client.update_all(rs)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 66,<br>
>       > in update_all<br>
>       >     self._atomic_update(lambda: ctx.sync_resource(r, since=since))<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 78,<br>
>       > in _atomic_update<br>
>       >     sync_func()<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 66,<br>
>       > in <lambda><br>
>       >     self._atomic_update(lambda: ctx.sync_resource(r, since=since))<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_tasks_async.py", line<br>
>       > 65, in _wrapped<br>
>       >     return loop.run_until_complete(func(*a, **k))<br>
>       >   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 488, in<br>
>       > run_until_complete<br>
>       >     return future.result()<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_tasks_async.py", line<br>
>       > 41, in _wrapped<br>
>       >     item = gen.send(r)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/peeringdb/_update.py", line 274,<br>
>       > in sync_row<br>
>       >     B.save(obj)<br>
>       >   File"/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django_peeringdb/client_adaptor/backend<br>
>       > .py", line 148, in save<br>
>       >     obj.save()<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/base.py", line<br>
>       > 741, in save<br>
>       >     force_update=force_update, update_fields=update_fields)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/base.py", line<br>
>       > 779, in save_base<br>
>       >     force_update, using, update_fields,<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/base.py", line<br>
>       > 870, in _save_table<br>
>       >     result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/base.py", line<br>
>       > 908, in _do_insert<br>
>       >     using=using, raw=raw)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/manager.py",<br>
>       > line 82, in manager_method<br>
>       >     return getattr(self.get_queryset(), name)(*args, **kwargs)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/query.py", line<br>
>       > 1186, in _insert<br>
>       >     return query.get_compiler(using=using).execute_sql(return_id)<br>
>       >   File<br>
>       > "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line<br>
>       > 1375, in execute_sql<br>
>       >     cursor.execute(sql, params)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/utils.py",<br>
>       > line 67, in execute<br>
>       >     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/utils.py",<br>
>       > line 76, in _execute_with_wrappers<br>
>       >     return executor(sql, params, many, context)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/utils.py",<br>
>       > line 84, in _execute<br>
>       >     return self.cursor.execute(sql, params)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/utils.py", line 89, in<br>
>       > __exit__<br>
>       >     raise dj_exc_value.with_traceback(traceback) from exc_value<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/utils.py",<br>
>       > line 84, in _execute<br>
>       >     return self.cursor.execute(sql, params)<br>
>       >   File<br>
>       > "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line<br>
>       > 71, in execute<br>
>       >     return self.cursor.execute(query, args)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 209, in<br>
>       > execute<br>
>       >     res = self._query(query)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/cursors.py", line 315, in<br>
>       > _query<br>
>       >     db.query(q)<br>
>       >   File "/Users/bdickson1/Documents/projects/site-selection/pdbvenv/lib/python3.6/site-packages/MySQLdb/connections.py", line<br>
>       > 226, in query<br>
>       >     _mysql.connection.query(self, query)<br>
>       > django.db.utils.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails<br>
>       > (`peeringdb`.`peeringdb_network`, CONSTRAINT `peeringdb_network_org_id_404d6106_fk_peeringdb_organization_id` FOREIGN KEY<br>
>       > (`org_id`) REFERENCES `peeringdb_organization` (`id`))')<br>
>       ><br>
>       > Please let me know if this is a problem on my end, or a problem with the data in the master db itself...<br>
>       ><br>
>       > If there is something I should do to fix this on my end, any advice would be greatly appreciated.<br>
>       > (If there is any other way to grab a copy of the tables in mysql format, that's all I'm really trying to get, just a snapshot of<br>
>       > the current peeringdb database to process with some perl scripts I have.)<br>
>       ><br>
>       > Thanks in advance,<br>
>       ><br>
>       > Brian Dickson<br>
>       ><br>
>       ><br>
>       ><br>
> <br>
> <br>
> </div>
</span></font></div>
</div>
</div>
</div>

</blockquote></div>