<div dir="ltr">The local database is empty. I'll make sure that's the case just to be safe.<div><br></div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"># peeringdb --version</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">peeringdb 1.0.0</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"># django-admin --version</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">
</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">2.2.12</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"># pip freeze</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">asgiref==3.2.7</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">certifi==2020.4.5.1</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">cfu==1.5.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">chardet==3.0.4</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">click==7.1.2</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Django==2.2.12</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">django-countries==6.1.2</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">django-handleref==0.5.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">django-inet==0.4.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">django-peeringdb==2.0.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">future==0.18.2</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">idna==2.9</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">munge==1.0.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">mysqlclient==1.4.4</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">peeringdb==1.0.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">PyMySQL==0.9.3</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">pytz==2020.1</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">PyYAML==5.3.1</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">requests==2.23.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">six==1.14.0</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">sqlparse==0.3.1</span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">twentyc.rpc==0.4.0</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">
</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">urllib3==1.25.9</span></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 15, 2020 at 10:55 AM Chris Caputo <<a href="mailto:ccaputo@alt.net">ccaputo@alt.net</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">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" rel="noreferrer" 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>
> </blockquote></div>