[PDB Tech] Possible validation issue with Python wrapper

Chris Phillips cphillips at aptient.com
Sat Feb 25 00:13:43 PST 2017


Thanks.  I did that.  New error, which looks like a different validation 
error:

$ peeringdb sync
Operations to perform:
   Synchronize unmigrated apps: django_peeringdb
   Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
   Creating tables...
     Running deferred SQL...
   Installing custom SQL...
Running migrations:
   No migrations to apply.
syncing from https://www.peeringdb.com/api
only tables False
Starting new HTTPS connection (1): www.peeringdb.com
https://www.peeringdb.com:443 "GET /api/org?since=1488009421 HTTP/1.1" 
200 None
org last update 1488009421 0 changed
data to be processed 0
Starting new HTTPS connection (1): www.peeringdb.com
https://www.peeringdb.com:443 "GET /api/fac?since=0 HTTP/1.1" 200 None
fac last update 0 2347 changed
data to be processed 2347
{'org': [u'organization instance with id 8592 does not exist.']} : 
errors: {'org': [u'organization instance with id 8592 does not exist.']}
Organization matching query does not exist.
Traceback (most recent call last):
   File "/usr/local/bin/peeringdb", line 11, in <module>
     load_entry_point('peeringdb==0.5.0.1', 'console_scripts', 
'peeringdb')()
   File "/usr/local/lib/python2.7/site-packages/click/core.py", line 
722, in __call__
     return self.main(*args, **kwargs)
   File "/usr/local/lib/python2.7/site-packages/click/core.py", line 
697, in main
     rv = self.invoke(ctx)
   File "/usr/local/lib/python2.7/site-packages/click/core.py", line 
1066, in invoke
     return _process_result(sub_ctx.command.invoke(sub_ctx))
   File "/usr/local/lib/python2.7/site-packages/click/core.py", line 
895, in invoke
     return ctx.invoke(self.callback, **ctx.params)
   File "/usr/local/lib/python2.7/site-packages/click/core.py", line 
535, in invoke
     return callback(*args, **kwargs)
   File "/usr/local/lib/python2.7/site-packages/peeringdb/cli.py", line 
167, in sync
     db.sync()
   File "/usr/local/lib/python2.7/site-packages/peeringdb/localdb.py", 
line 128, in sync
     call_command('pdb_sync', interactive=False)
   File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 120, in call_command
     return command.execute(*args, **defaults)
   File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 445, in execute
     output = self.handle(*args, **options)
   File 
"/usr/local/lib/python2.7/site-packages/django_peeringdb/management/commands/pdb_sync.py", 
line 87, in handle
     self.sync(tables, pk)
   File 
"/usr/local/lib/python2.7/site-packages/django_peeringdb/management/commands/pdb_sync.py", 
line 94, in sync
     self.update_db(cls, self.get_objs(cls, pk=pk))
   File 
"/usr/local/lib/python2.7/site-packages/django_peeringdb/management/commands/pdb_sync.py", 
line 173, in update_db
     self._sync(cls, row)
   File 
"/usr/local/lib/python2.7/site-packages/django_peeringdb/management/commands/pdb_sync.py", 
line 142, in _sync
     sync.sync_obj(cls, row)
   File 
"/usr/local/lib/python2.7/site-packages/django_peeringdb/sync.py", line 
28, in sync_obj
     log.debug("{}: {}, dict: {}".format(k, getattr(obj, k), 
field.__dict__))
   File 
"/usr/local/lib/python2.7/site-packages/django/db/models/fields/related.py", 
line 614, in __get__
     rel_obj = qs.get()
   File 
"/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 
334, in get
     self.model._meta.object_name
django_peeringdb.models.concrete.DoesNotExist: Organization matching 
query does not exist.



On 2/25/2017 12:12 AM, Matt Griswold wrote:
> * Chris Phillips <cphillips at aptient.com> [170225 00:05 -0800]:
>> Is there documentation on how to properly upgrade?
>
> No, there's a github ticket on it not working tho :)
> https://github.com/peeringdb/peeringdb-py/issues/14
>
> try:
> pip install 'django>1.8,<1.9'
>
> That should fix it, we hope to have the underlying issues fixed by the
> end of the weekend.
>


More information about the Pdb-tech mailing list