[PDB-tech] peeringdb python library
Stefan Pratter
stefan at 20c.com
Fri Feb 26 07:31:41 PST 2016
Looks like the database is using the wrong collation
alter database peeringdb default character set utf8 default collate
utf8_unicode_ci;
can you try wiping the database (again), setting that, and then running
a fresh sync
On 26/02/16 17:24, Jeroen Valcke wrote:
> Hi Stefan,
>
> Thanks for the fast reply. Good suggestion. Dropped the peeringDB
> database and sync'ed again.
> on the initial sync. I got this error.
> File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line
> 36, in defaulterrorhandler
> raise errorclass, errorvalue
> django.db.utils.OperationalError: (1267, "Illegal mix of collations
> (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for
> operation '='")
>
> Which impacted the sync, because a couple of tables (peeringdb_network,
> peeringdb_network_ixlan) remained empty after that initial sync.
>
> Another sync gave the same error as before. However it error'ed on
> another organisation id.
>
> File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line
> 1171, in full_clean
> raise ValidationError(errors)
> django.core.exceptions.ValidationError: {'org': [u'organization instance
> with id 7238 does not exist.']}
>
> Best,
> -Jeroen-
>
> On Fri, Feb 26, 2016 at 3:53 PM, Stefan Pratter <stefan at 20c.com
> <mailto:stefan at 20c.com>> wrote:
>
> Depending on when you did the initial sync, we may have done a full
> re-import of v1 data since then which means some ids may have changed,
>
> Is it feasible for you to wipe your local db and do fresh peeringdb
> sync ? I just did a sync (and re-sync) on a fresh db and had no
> problems.
>
> As for peeringdb get net433 not working, i can confirm that this
> appears to be broken - i was able to reproduce it, will need to
> investigate further.
>
> Thanks for the feedback,
> Stefan
>
>
>
> On 26/02/16 16:33, Jeroen Valcke wrote:
>
> Hi,
>
> I've been giving the peeringdb python module a try. I ran into a
> couple
> of issues, perhaps somebody can help me out here. I'm using
> peeringdb,
> version 0.4.2
>
> - sync issue, "peeringdb sync" throws an error. I don't think I
> got this
> on the initial sync
>
> File
> "/usr/local/lib/python2.7/dist-packages/django_peeringdb/management/commands/pdb_sync.py",
> line 127, in update_db
> sync.sync_obj(cls, row)
> File
> "/usr/local/lib/python2.7/dist-packages/django_peeringdb/sync.py",
> line
> 25, in sync_obj
> obj.full_clean()
> File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py",
> line
> 1171, in full_clean
> raise ValidationError(errors)
> django.core.exceptions.ValidationError: {'org': [u'organization
> instance
> with id 4755 does not exist.']}
>
> - Errors on existing net objects. I keep getting errors when
> trying to
> retrieve net objects. For example
> $ peeringdb get net433
> ...
> File
> "/usr/local/lib/python2.7/dist-packages/twentyc/rpc/client.py",
> line 88, in _load
> self._throw(res, data)
> File
> "/usr/local/lib/python2.7/dist-packages/twentyc/rpc/client.py",
> line 68, in _throw
> raise NotFoundException("%d %s" % (res.status_code, err))
> twentyc.rpc.client.NotFoundException: 404 Unknown
>
> Org 433 is present in the local db
> mysql> select id, name, asn from peeringdb_network where id=433;
> +-----+-------------+-------+
> | id | name | asn |
> +-----+-------------+-------+
> | 433 | Google Inc. | 15169 |
> +-----+-------------+-------+
> 1 row in set (0.00 sec)
>
> - Is it possible to output all net objects on the cli?
> peeringdb get net --> doesn't work
>
> It seems to work in the client
>
> >>> from peeringdb.client import PeeringDB
> >>> pdb = PeeringDB()
> >>> pdb.all('net')
> ...
>
>
> Thanks,
> -Jeroen-
>
>
> _______________________________________________
> Pdb-tech mailing list
> Pdb-tech at lists.peeringdb.com <mailto:Pdb-tech at lists.peeringdb.com>
> http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
>
> _______________________________________________
> Pdb-tech mailing list
> Pdb-tech at lists.peeringdb.com <mailto:Pdb-tech at lists.peeringdb.com>
> http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
>
>
More information about the Pdb-tech
mailing list