<div dir="ltr">Hey Stefan,<div><br></div><div>Thanks for the reply.</div><div><br></div><div>I nuked my DB and re-sync'd - worked like a charm.</div><div><br></div><div>/Ruairi</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 April 2017 at 17:24, Stefan Pratter <span dir="ltr"><<a href="mailto:stefan@20c.com" target="_blank">stefan@20c.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
There have been bugs (some now fixed as of django-peeringdb 0.4.0 i believe) that would cause missing objects in the local db. Probably easiest and reasonable to reset the db and sync fresh, if that's an option for you.<br>
<br>
Furthermore the client currently has a few short comings when it comes to how it handles syncs for deleted objects so it sometimes can't correct itself from errors like the one described above.<br>
<br>
In this case it's cascading down a line of objects required by other objects (eg fac as parent of a netfac) and its trying to obtain it from the api, but since it's deleted and the endpoint /api/fac/3 returns a 404 and bails.<br>
<br>
This could be fixed by changing the query the client does to request missing objects to a ?since query, as that can retrieve soft-deleted objects.<br>
<br>
Also, as a side note, this issue is more likely to happen the longer you sit on a database without syncing.<br>
<br>
Not sure this was much help, but hope this gives some clarity anyhow.<br>
<br>
Stefan<span class=""><br>
<br>
<br>
On 14/04/2017 18.04, Ruairi Carroll wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hey,<br>
<br>
I'm trying to run a sync of the DB locally, and after some initial<br>
struggles, I'm finally able to start to sync the data.<br>
<br>
However, my sync bombs out when when trying to sync fac_id 3, as per my<br></span>
logs below (Full log is on PasteBin here <<a href="https://pastebin.com/r55K4r8Y" rel="noreferrer" target="_blank">https://pastebin.com/r55K4r8Y</a><wbr>>).<br>
<br>
{'fac': *[u'facility instance with id 3 does not exist.']*} : errors:<div><div class="h5"><br>
{'fac': [u'facility instance with id 3 does not exist.']}<br>
fac: Missing Object, dict: {'_validators': [], 'auto_created': False,<br>
'serialize': True, '_unique': False, 'unique_for_year': None, 'blank':<br>
False, 'help_text': u'', 'null': False, 'to_fields': ['id'],<br>
'db_tablespace': '', 'db_index': True, 'is_relation': True,<br>
'unique_for_month': None, 'unique_for_date': None, 'primary_key': False,<br>
'concrete': True, 'swappable': True, 'max_length': None, 'rel':<br>
<ManyToOneRel: django_peeringdb.networkfacili<wbr>ty>, 'from_fields':<br>
[u'self'], 'verbose_name': u'fac', '_choices': [], 'creation_counter':<br>
129, 'validators': [], 'editable': True, 'related_model': <class<br>
'django_peeringdb.models.concr<wbr>ete.Facility'>, 'error_messages':<br>
{u'unique': <django.utils.functional.__pro<wbr>xy__ object at 0x80a4d6a90>,<br>
u'invalid': <django.utils.functional.__pro<wbr>xy__ object at 0x80a55c550>,<br>
u'invalid_choice': <django.utils.functional.__pro<wbr>xy__ object at<br>
0x809ac0990>, u'blank': <django.utils.functional.__pro<wbr>xy__ object at<br>
0x80a4d6a50>, u'null': <django.utils.functional.__pro<wbr>xy__ object at<br>
0x80a4d6a10>, u'unique_for_date': <django.utils.functional.__pro<wbr>xy__<br>
object at 0x80a4d6ad0>}, '_related_fields':<br>
[(<django.db.models.fields.rel<wbr>ated.ForeignKey: fac>,<br>
<django.db.models.fields.AutoF<wbr>ield: id>)], '_error_messages': None,<br>
'db_constraint': True, '_verbose_name': None, 'name': 'fac',<br>
'db_column': None, 'default': 0, 'attname': u'fac_id', 'column':<br>
u'fac_id', 'model': <class<br>
'django_peeringdb.models.concr<wbr>ete.NetworkFacility'>, 'opts': <Options<br>
for NetworkFacility>}<br></div></div>
*fac.3 not found locally, trying to fetch object... *<span class=""><br>
Starting new HTTPS connection (1): <a href="http://www.peeringdb.com" rel="noreferrer" target="_blank">www.peeringdb.com</a><br></span>
<<a href="http://www.peeringdb.com" rel="noreferrer" target="_blank">http://www.peeringdb.com</a>><br>
*"GET /api/fac/3?depth=0 HTTP/1.1" 404 None*<span class=""><br>
<br>
<br>
When I look deeper here, I see that this is the core of the issue:<br>
<br>
Starting new HTTPS connection (1): <a href="http://www.peeringdb.com" rel="noreferrer" target="_blank">www.peeringdb.com</a><br></span>
<<a href="http://www.peeringdb.com" rel="noreferrer" target="_blank">http://www.peeringdb.com</a>><br>
"*GET /api/netfac?since=1484585605&l<wbr>imit=0* HTTP/1.1" 200 None<span class=""><br>
netfac last update 1484585605 1808 changed<br>
data to be processed 1808<br>
<br>
Which, if we look at the data this returns, contains "fac_id": 3.<br>
<br>
So, suggestions on how to proceed here?<br>
<br>
/Ruairi<br>
<br>
<br></span>
______________________________<wbr>_________________<br>
Pdb-tech mailing list<br>
<a href="mailto:Pdb-tech@lists.peeringdb.com" target="_blank">Pdb-tech@lists.peeringdb.com</a><br>
<a href="http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech" rel="noreferrer" target="_blank">http://lists.peeringdb.com/cgi<wbr>-bin/mailman/listinfo/pdb-tech</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<br>
Pdb-tech mailing list<br>
<a href="mailto:Pdb-tech@lists.peeringdb.com" target="_blank">Pdb-tech@lists.peeringdb.com</a><br>
<a href="http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech" rel="noreferrer" target="_blank">http://lists.peeringdb.com/cgi<wbr>-bin/mailman/listinfo/pdb-tech</a><br>
</blockquote></div><br></div>