brad-sp / cuckoo-modified

Modified edition of cuckoo
268 stars 100 forks source link

Cuckoo clean with Elasticsearch #221

Open ghost opened 8 years ago

ghost commented 8 years ago

Do you encounter this issue when performing "--clean"?

2015-10-06 15:44:21,408 [urllib3.connectionpool] INFO: Starting new HTTP connection (1): 127.0.0.1 2015-10-06 15:44:21,502 [elasticsearch] INFO: GET http://127.0.0.1:9200/cuckoo-*/analysis/_search?q=%2A [status:200 request:0.045s] No handlers could be found for logger "elasticsearch.trace" 2015-10-06 15:44:22,070 [elasticsearch] WARNING: DELETE /cuckoo-2015-09-29/calls/AVAZOroDN2XUIyzSqtvO [status:404 request:0.003s] Traceback (most recent call last): File "./cuckoo.py", line 96, in cuckoo_clean() File "/home/trender/sme/dev/cuckoo-modified/lib/cuckoo/core/startup.py", line 321, in cuckoo_clean id=call, File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 69, in _wrapped return func(_args, params=params, *kwargs) File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/init.py", line 672, in delete , data = self.transport.perform_request('DELETE', _make_path(index, doc_type, id), params=params) File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 307, in perform_request status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout) File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py", line 89, in perform_request self._raise_error(response.status, raw_data) File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py", line 105, in _raise_error raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info) elasticsearch.exceptions.NotFoundError: TransportError(404, u'{"found":false,"_index":"cuckoo-2015-09-29","_type":"calls","_id":"AVAZOroDN2XUIyzSqtvO","_version":1}')

KillerInstinct commented 8 years ago

I have not:

2015-10-06 06:47:18,251 [elasticsearch] INFO: DELETE http://127.0.0.1:9200/cuckoo-2015-09-16/analysis/13 [status:200 request:0.002s]

Version of ElasticSearch?

It almost looks like you manually deleted a task (from the admin tab or something) and the data didn't get removed from your Cuckoo DB. However, ES is reporting the data is not there, so a simple try/except block may be sufficient: https://gist.github.com/KillerInstinct/9a0787e24ca4995fbb05/revisions