Hello,
When I try to delete old indices, I get the following error:
2019-09-07 18:13:34,959 INFO Preparing Action ID: 2, "delete_indices"
2019-09-07 18:13:34,965 INFO Trying Action ID: 2, "delete_indices": Delete indices older than 45 days
2019-09-07 18:13:34,983 ERROR Failed to complete action: delete_indices. <class 'ValueError'>: Invalid epoch received, unable to convert None to int
It seems like Curator is getting the value 'None' from an Elasticsearch API call:
2019-09-07 18:26:14,275 DEBUG curator.indexlist _get_field_stats_dates:306 Getting index date by querying indices for min & max value of timestamp field
2019-09-07 18:26:14,278 DEBUG curator.indexlist _get_field_stats_dates:318 RESPONSE: {'took': 0, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': None, 'hits': []}, 'aggregations': {'min': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}, 'max': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}}}
2019-09-07 18:26:14,278 DEBUG curator.indexlist _get_field_stats_dates:322 r: {'min': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}, 'max': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}}
2019-09-07 18:26:14,278 DEBUG curator.indexlist _get_field_stats_dates:326 s: {'creation_date': 1567872058, 'min_value': 1567872175, 'max_value': 1567872175}
2019-09-07 18:26:14,280 DEBUG curator.indexlist _get_field_stats_dates:318 RESPONSE: {'took': 0, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 7, 'relation': 'eq'}, 'max_score': None, 'hits': []}, 'aggregations': {'min': {'value': None}, 'max': {'value': None}}}
2019-09-07 18:26:14,280 DEBUG curator.indexlist _get_field_stats_dates:322 r: {'min': {'value': None}, 'max': {'value': None}}
2019-09-07 18:26:14,280 ERROR curator.cli run:191 Failed to complete action: delete_indices. <class 'ValueError'>: Invalid epoch received, unable to convert None to int
You can see Curator is getting back valid time for the first index:
2019-09-07 18:26:14,278 DEBUG curator.indexlist _get_field_stats_dates:322 r: {'min': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}, 'max': {'value': 1567872175000.0, 'value_as_string': '20190907T160255Z'}}
And for the second index it gets None:
2019-09-07 18:26:14,280 DEBUG curator.indexlist _get_field_stats_dates:322 r: {'min': {'value': None}, 'max': {'value': None}}
I cannot figure out where None is coming from though, as all indices have filled timestamp
fields.
My Curator config:
2:
action: delete_indices
description: >-
Delete indices older than 45 days
options:
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: age
source: field_stats
field: 'timestamp'
direction: older
unit: minutes
unit_count: 1
exclude:
As you can see, the timestamp
field is filled:
root@es0-0:~# curl -X GET http://localhost:9200/mail/_search | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 608 100 608 0 0 83642 0 --:--:-- --:--:-- --:--:-- 86857
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "mail",
"_type": "_doc",
"_id": "6KpoDG0Bz4cMnJ9oGSRr",
"_score": 1,
"_source": {
"hostname": "mail0.emdmz.cyberfusion.cloud",
"domain": "example.com",
"mailbox": "tet@example.com",
"timestamp": "20190907T174650Z",
"diskusage": 69
}
},
{
"_index": "mail",
"_type": "_doc",
"_id": "6apoDG0Bz4cMnJ9oHCRH",
"_score": 1,
"_source": {
"hostname": "mail0.emdmz.cyberfusion.cloud",
"domain": "test.nl",
"mailbox": "tset@test.nl",
"timestamp": "20190907T174652Z",
"diskusage": 523
}
}
]
}
}
How can I debug which index is giving me 'None' and why it is doing so? I'm stuck.