Elasticsearch cannot restore existing snapshot. Blob not found










0














Elasticsearch version: 6.3.2



I was trying to restore an old snapshot (taken in January 2018) of Elasticsearch 5.2.2 from a read only S3 repository. The necessary permissions in the IAM role for the instance are setup.



Here is the repository definition:
```




"production_copy_old":
"type": "s3",
"settings":
"bucket": "elasticsearch-snapshot",
"readonly": "true",
"base_path": "snaps//"





```



The repository is setup well, because when I issue the GET snapshot on the repository, I get the right response:



GET _snapshot/production_copy_old/elasticsearch-snapshot-201804190000

"snapshots": [

"snapshot": "elasticsearch-snapshot-201804190000",
"uuid": "fT0oftdTQhi5sns704pg45",
"version_id": 5020299,
"version": "5.2.2",
"indices": [<huge list of indices>],
"state": "SUCCESS",
"start_time": "2018-04-19T00:00:20.726Z",
"start_time_in_millis": 1524096020726,
"end_time": "2018-04-19T00:09:30.210Z",
"end_time_in_millis": 1524096570210,
"duration_in_millis": 549484,
"failures": ,
"shards":
"total": 2875,
"failed": 0,
"successful": 2875


]




However, when I try to restore a snapshot, I get an error:



POST _snapshot/production_copy_old/elasticsearch-snapshot-201804190000/_restore


"indices": "myindex-201801",
"ignore_unavailable": false,
"include_global_state": false,
"index_settings":
"index.number_of_replicas": 0




"error":
"root_cause": [

"type": "remote_transport_exception",
"reason": "[s-elasticsearch-2][IP:9300][cluster:admin/snapshot/restore]"

],
"type": "no_such_file_exception",
"reason": "Blob object [meta-fT0oftdTQhi5ns70paP4pg.dat] not found: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID:<reqid>; S3 Extended Request ID:<extended-req-id)"
,
"status": 500



However, when I try aws s3 ls elasticsearch-snapshot/snaps//meta-fT0oftdTQhi5ns70paP4pg.dat, I see that the instance is able to see the object and also download it. From this we can know that the permissions are setup correctly.



Also, the reason why the prefix has a //towards the end is because we have been using this repository since Elasticsearch 2.3. In that version of elasticsearch we added a trailing slash to the repository definition prefix setting. We moved to a new repository in August with the correct prefix definition.



Is there any way we can work around this? Do i have to change the prefix?










share|improve this question


























    0














    Elasticsearch version: 6.3.2



    I was trying to restore an old snapshot (taken in January 2018) of Elasticsearch 5.2.2 from a read only S3 repository. The necessary permissions in the IAM role for the instance are setup.



    Here is the repository definition:
    ```




    "production_copy_old":
    "type": "s3",
    "settings":
    "bucket": "elasticsearch-snapshot",
    "readonly": "true",
    "base_path": "snaps//"





    ```



    The repository is setup well, because when I issue the GET snapshot on the repository, I get the right response:



    GET _snapshot/production_copy_old/elasticsearch-snapshot-201804190000

    "snapshots": [

    "snapshot": "elasticsearch-snapshot-201804190000",
    "uuid": "fT0oftdTQhi5sns704pg45",
    "version_id": 5020299,
    "version": "5.2.2",
    "indices": [<huge list of indices>],
    "state": "SUCCESS",
    "start_time": "2018-04-19T00:00:20.726Z",
    "start_time_in_millis": 1524096020726,
    "end_time": "2018-04-19T00:09:30.210Z",
    "end_time_in_millis": 1524096570210,
    "duration_in_millis": 549484,
    "failures": ,
    "shards":
    "total": 2875,
    "failed": 0,
    "successful": 2875


    ]




    However, when I try to restore a snapshot, I get an error:



    POST _snapshot/production_copy_old/elasticsearch-snapshot-201804190000/_restore


    "indices": "myindex-201801",
    "ignore_unavailable": false,
    "include_global_state": false,
    "index_settings":
    "index.number_of_replicas": 0




    "error":
    "root_cause": [

    "type": "remote_transport_exception",
    "reason": "[s-elasticsearch-2][IP:9300][cluster:admin/snapshot/restore]"

    ],
    "type": "no_such_file_exception",
    "reason": "Blob object [meta-fT0oftdTQhi5ns70paP4pg.dat] not found: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID:<reqid>; S3 Extended Request ID:<extended-req-id)"
    ,
    "status": 500



    However, when I try aws s3 ls elasticsearch-snapshot/snaps//meta-fT0oftdTQhi5ns70paP4pg.dat, I see that the instance is able to see the object and also download it. From this we can know that the permissions are setup correctly.



    Also, the reason why the prefix has a //towards the end is because we have been using this repository since Elasticsearch 2.3. In that version of elasticsearch we added a trailing slash to the repository definition prefix setting. We moved to a new repository in August with the correct prefix definition.



    Is there any way we can work around this? Do i have to change the prefix?










    share|improve this question
























      0












      0








      0







      Elasticsearch version: 6.3.2



      I was trying to restore an old snapshot (taken in January 2018) of Elasticsearch 5.2.2 from a read only S3 repository. The necessary permissions in the IAM role for the instance are setup.



      Here is the repository definition:
      ```




      "production_copy_old":
      "type": "s3",
      "settings":
      "bucket": "elasticsearch-snapshot",
      "readonly": "true",
      "base_path": "snaps//"





      ```



      The repository is setup well, because when I issue the GET snapshot on the repository, I get the right response:



      GET _snapshot/production_copy_old/elasticsearch-snapshot-201804190000

      "snapshots": [

      "snapshot": "elasticsearch-snapshot-201804190000",
      "uuid": "fT0oftdTQhi5sns704pg45",
      "version_id": 5020299,
      "version": "5.2.2",
      "indices": [<huge list of indices>],
      "state": "SUCCESS",
      "start_time": "2018-04-19T00:00:20.726Z",
      "start_time_in_millis": 1524096020726,
      "end_time": "2018-04-19T00:09:30.210Z",
      "end_time_in_millis": 1524096570210,
      "duration_in_millis": 549484,
      "failures": ,
      "shards":
      "total": 2875,
      "failed": 0,
      "successful": 2875


      ]




      However, when I try to restore a snapshot, I get an error:



      POST _snapshot/production_copy_old/elasticsearch-snapshot-201804190000/_restore


      "indices": "myindex-201801",
      "ignore_unavailable": false,
      "include_global_state": false,
      "index_settings":
      "index.number_of_replicas": 0




      "error":
      "root_cause": [

      "type": "remote_transport_exception",
      "reason": "[s-elasticsearch-2][IP:9300][cluster:admin/snapshot/restore]"

      ],
      "type": "no_such_file_exception",
      "reason": "Blob object [meta-fT0oftdTQhi5ns70paP4pg.dat] not found: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID:<reqid>; S3 Extended Request ID:<extended-req-id)"
      ,
      "status": 500



      However, when I try aws s3 ls elasticsearch-snapshot/snaps//meta-fT0oftdTQhi5ns70paP4pg.dat, I see that the instance is able to see the object and also download it. From this we can know that the permissions are setup correctly.



      Also, the reason why the prefix has a //towards the end is because we have been using this repository since Elasticsearch 2.3. In that version of elasticsearch we added a trailing slash to the repository definition prefix setting. We moved to a new repository in August with the correct prefix definition.



      Is there any way we can work around this? Do i have to change the prefix?










      share|improve this question













      Elasticsearch version: 6.3.2



      I was trying to restore an old snapshot (taken in January 2018) of Elasticsearch 5.2.2 from a read only S3 repository. The necessary permissions in the IAM role for the instance are setup.



      Here is the repository definition:
      ```




      "production_copy_old":
      "type": "s3",
      "settings":
      "bucket": "elasticsearch-snapshot",
      "readonly": "true",
      "base_path": "snaps//"





      ```



      The repository is setup well, because when I issue the GET snapshot on the repository, I get the right response:



      GET _snapshot/production_copy_old/elasticsearch-snapshot-201804190000

      "snapshots": [

      "snapshot": "elasticsearch-snapshot-201804190000",
      "uuid": "fT0oftdTQhi5sns704pg45",
      "version_id": 5020299,
      "version": "5.2.2",
      "indices": [<huge list of indices>],
      "state": "SUCCESS",
      "start_time": "2018-04-19T00:00:20.726Z",
      "start_time_in_millis": 1524096020726,
      "end_time": "2018-04-19T00:09:30.210Z",
      "end_time_in_millis": 1524096570210,
      "duration_in_millis": 549484,
      "failures": ,
      "shards":
      "total": 2875,
      "failed": 0,
      "successful": 2875


      ]




      However, when I try to restore a snapshot, I get an error:



      POST _snapshot/production_copy_old/elasticsearch-snapshot-201804190000/_restore


      "indices": "myindex-201801",
      "ignore_unavailable": false,
      "include_global_state": false,
      "index_settings":
      "index.number_of_replicas": 0




      "error":
      "root_cause": [

      "type": "remote_transport_exception",
      "reason": "[s-elasticsearch-2][IP:9300][cluster:admin/snapshot/restore]"

      ],
      "type": "no_such_file_exception",
      "reason": "Blob object [meta-fT0oftdTQhi5ns70paP4pg.dat] not found: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID:<reqid>; S3 Extended Request ID:<extended-req-id)"
      ,
      "status": 500



      However, when I try aws s3 ls elasticsearch-snapshot/snaps//meta-fT0oftdTQhi5ns70paP4pg.dat, I see that the instance is able to see the object and also download it. From this we can know that the permissions are setup correctly.



      Also, the reason why the prefix has a //towards the end is because we have been using this repository since Elasticsearch 2.3. In that version of elasticsearch we added a trailing slash to the repository definition prefix setting. We moved to a new repository in August with the correct prefix definition.



      Is there any way we can work around this? Do i have to change the prefix?







      elasticsearch amazon-s3






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 4:39









      Anish MashankarAnish Mashankar

      12




      12






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256049%2felasticsearch-cannot-restore-existing-snapshot-blob-not-found%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256049%2felasticsearch-cannot-restore-existing-snapshot-blob-not-found%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo