TAXIIProject / django-taxii-services

Installable taxii_services
http://taxiiproject.github.io/
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Verify Message/QueryHandler Registration #15

Open MarkDavidson opened 10 years ago

MarkDavidson commented 10 years ago

Per https://github.com/TAXIIProject/yeti/issues/65:

When initializing YETI, the line register_query_handler(StixXml111QueryHandler, name="StixXml111QueryHandler") in StixXml111QueryHandler.py was causing an exception to be raised: django.core.exceptions.AppRegistryNotReady.

This might be a bug in register_query_handler / register_message_handler in management.py

In those functions, depending on when in the application startup they are called, <Model>.objects.get_or_create( ... ) might succeed or fail. For known errors (currently, only DatabaseError), the logic is to "try again after the database is done initializing", which is done by hooking into the post_syncdb signal.

This issue is to: 1) Determine whether django.core.exceptions.AppRegistryNotReady is a "known" error that should be handled in the same way as DatabaseError. 2) If so, handle it the same way 3) If not, figure out a different way to prevent that from coming up

Unfortunately, I'm not able to reproduce the error on my system. If somebody can detail how to reproduce the error, that would be good.