API Query TastyPie error

28 views
Skip to first unread message

Gregory LeBlanc

unread,
Jan 17, 2017, 4:15:57 PM1/17/17
to crits-users
Hi all -- I'm having a problem with the CRITs API. I'm making a POST request to submit an Indicator and only on certain requests does it fail with the following error:

{"error_message": "settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.", "traceback": "Traceback (most recent call last):\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie/resources.py\", line 219, in wrapper\n    response = callback(request, *args, **kwargs)\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie/resources.py\", line 450, in dispatch_list\n    return self.dispatch('list', request, **kwargs)\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie_mongoengine/resources.py\", line 430, in dispatch\n    return self._wrap_request(request, lambda: super(MongoEngineResource, self).dispatch(request_type, request, **kwargs))\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie_mongoengine/resources.py\", line 393, in _wrap_request\n    return fun()\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie_mongoengine/resources.py\", line 430, in <lambda>\n    return self._wrap_request(request, lambda: super(MongoEngineResource, self).dispatch(request_type, request, **kwargs))\n\n  File \"/usr/local/lib/python2.7/dist-packages/tastypie/resources.py\", line 482, in dispatch\n    response = method(request, **kwargs)\n\n  File \"/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py\", line 144, in inner\n    with self:\n\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/transaction.py\", line 150, in __enter__\n    if not connection.get_autocommit():\n\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py\", line 286, in get_autocommit\n    self.ensure_connection()\n\n  File \"/usr/local/lib/python2.7/dist-packages/django/db/backends/dummy/base.py\", line 21, in complain\n    raise ImproperlyConfigured(\"settings.DATABASES is improperly configured. \"\n\nImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.\n"}

It looks like it stopped working a few months ago, I don't remember making any changes on the box at that time. It's been pretty rock solid so far.

Keep in mind that I am submitting thousands of indicators per day, it only seems to be URL objects in the Indicator TLO that are failing. Same code, etc. 

My pip freeze looks like the following:
amqp==2.1.0
anyjson==0.3.3
billiard==3.5.0.1
biplist==1.0.1
celery==3.1.24
defusedxml==0.4.1
Django==1.8.15
django-celery==3.1.17
django-tastypie==0.13.3
django-tastypie-mongoengine==0.4.6
future==0.15.2
kombu==3.0.37
lxml==3.6.4
M2Crypto==0.25.1
mongoengine==0.8.8
olefile==0.43
pefile==2016.3.28
Pillow==3.4.1
pydeep==0.2
pyimpfuzzy==0.1
pymongo==2.7.2
pyparsing==2.1.10
python-dateutil==2.5.3
python-ldap==2.4.27
python-magic==0.4.6
python-mimeparse==1.5.3
pytz==2016.7
PyYAML==3.12
requests==2.11.1
simplejson==3.8.2
six==1.10.0
typing==3.5.2.2
ushlex==0.99
vine==1.1.2
You are using 

Gregory LeBlanc

unread,
Jan 18, 2017, 1:14:24 PM1/18/17
to crits-users
Stand down, I figured this out.

For anyone searching -- this is caused by trying to insert an Indicator TLO via the Indicator API with a "Type" that doesn't exist. Unsure why it provides that error, but there ya go!
Reply all
Reply to author
Forward
0 new messages