Error: cannot POST (400)

Hey all,

I recently took a snapshot of an index, then restored that snapshot with a different name by doing the following:

curl -XPOST 'localhost:9200/_snapshot/test_backup/snapshot_1_gl2/_restore?pretty' -H 'Content-Type: application/json' -d'
    {
     "indices": "graylog_2",
     "ignore_unavailable": "true",
     "include_global_state": false,
     "rename_pattern": "graylog_2",
     "rename_replacement": "graylog_old_2"
     }
'

When I run curl -XGET ‘localhost:9200/_cat/indices?v&s=docs.count:desc&pretty’, I can see the index just fine and its in green health.
The issue is that in System > Indices > Default Index Set, when I try to recalculate index ranges I get the following:

Could not create a job to start index ranges recalculation for graylog_old_2, reason: Error: cannot POST https://myURL/api/system/indices/ranges/graylog_old_2/rebuild (400)

I am able reindex other indices, just not this one and I am not sure why.

That index (“graylog_old_2”) doesn’t match any index set you have and thus Graylog will ignore it because it’s “unmanaged”.

I was just thinking about this on my way into work this morning.
So because it has the name structure that doesn’t match graylog_# then graylog isn’t managing it?

If that’s the case, what might I need to do to get graylog to manage it?

Yes, exactly.

Either use a name with a managed index prefix (see your index sets configuration) or create a dedicated index set for these restored indices which has a matching index prefix.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.