Skip to content

ElasticClient.GetSnapshot() #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jweder opened this issue Dec 16, 2014 · 1 comment
Closed

ElasticClient.GetSnapshot() #1154

jweder opened this issue Dec 16, 2014 · 1 comment
Assignees

Comments

@jweder
Copy link

jweder commented Dec 16, 2014

Getting all Snapshots like this

var allSnapshots = myElasticClient.GetSnapshot("live-backup", "_all");

Throws a JsonReaderException, if there is a Snapshot in it, that has "failures".

Calling the Elasticsearch API like this:

http://blubb:9200/_snapshot/live-backup/_all

returns this:

    {
        "snapshots": [
        ...some snapshots
            ,
            {
                "snapshot": "snap_2014_12_14_00_00_03",
                "indices": [
                    "hf-active_38479029",
                    "af-product_459559",
                    "cf-ad_930307",
                    "cf-ad_2741513",
                    "hf-resultforecast_2614803",
                    "hf-historic_2646605",
                    "hf-active_37836499",
                    "hf-resultforecast_2647422",
                    "hf-historic_2612632",
                    "af-product_2747475"
                ],
                "state": "PARTIAL",
                "start_time": "2014-12-13T23:00:03.109Z",
                "start_time_in_millis": 1418511603109,
                "end_time": "2014-12-13T23:00:26.274Z",
                "end_time_in_millis": 1418511626274,
                "duration_in_millis": 23165,
                "failures": [
                    {
                        "node_id": "919MrTdaT3WYJ9VPKwRgfg",
                        "index": "hf-historic_2646605",
                        "reason": "IndexShardSnapshotFailedException[[hf-historic_2646605][0] null]; nested: NullPointerException; ",
                        "shard_id": 0,
                        "status": "INTERNAL_SERVER_ERROR"
                    }
                ],
                "shards": {
                    "total": 58,
                    "failed": 1,
                    "successful": 57
                }
            },
            ... some more snapshots
        ]
    }
@gmarz gmarz added Bug labels Dec 16, 2014
@gmarz gmarz self-assigned this Dec 16, 2014
@gmarz gmarz closed this as completed in 923a516 Dec 16, 2014
Mpdreamz added a commit that referenced this issue Dec 16, 2014
Fix #1154: snapshot failures are objects, not strings
@gmarz
Copy link
Contributor

gmarz commented Dec 16, 2014

@jweder Good catch. The issue was that our GetSnapshotResponse treated failures as strings when really they are objects. I just pushed a fix. For backwards compatibility sake, I left original IEnumerable<string> Failures property which now just returns the failure reasons, and added IEnumerable<SnapshotShardFailure> ShardFailures which contains the actual response objects.

Thanks for reporting this 👍

@gmarz gmarz added v1.4.0 and removed v1.3.2 labels Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants