# NullPointerException when create snapshots on S3

**URL:** <https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290>\
**Category:** Elasticsearch\
**Created:** [July 17, 2018, 9:08am UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290 "2018-07-17T09:08:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavlo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavlo/32/12176_2.png) [@Pavlo](https://discuss.elastic.co/u/Pavlo)\
**Post date:** [July 17, 2018, 9:08am UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290/1 "2018-07-17T09:08:18Z")

</div>

Hello  
We upgraded version of Elastisearch environment from 5.1 to 5.6.10 on [cloud.elastic.co](http://cloud.elastic.co). Everything started working correctly except snapshorts. There is a problem with default snapshort repository. I see that ones in 30 minutes the process starts creating the snapshort, but it fails with NullPointerException error. Finally snapshort is removed from the storage.

```
[2018-07-16T19:59:09,406][WARN][org.elasticsearch.snapshots.SnapshotsService] [found-snapshots:scheduled-1531770970-instance-0000000018/LohSOOovQWuSMFnK9fCATw] failed to finalize snapshot java.lang.NullPointerException: null 
at org.elasticsearch.repositories.RepositoryData.snapshotsToXContent(RepositoryData.java:357) ~[elasticsearch-5.6.10.jar:5.6.10] 
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.writeIndexGen(BlobStoreRepository.java:838) ~[elasticsearch-5.6.10.jar:5.6.10] 
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.finalizeSnapshot(BlobStoreRepository.java:568) ~[elasticsearch-5.6.10.jar:5.6.10] 
at org.elasticsearch.snapshots.SnapshotsService$5.run(SnapshotsService.java:978) [elasticsearch-5.6.10.jar:5.6.10] 
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:575) [elasticsearch-5.6.10.jar:5.6.10] 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144] 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144] 
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

```

We received the same error when we try to create snapshort by command from Kibana Dev Tools (or delete existing snapshort from storage).

```
{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[instance-0000000018][172.17.0.10:19056][cluster:admin/snapshot/delete]"
      }
    ],
    "type": "null_pointer_exception",
    "reason": null
  },
  "status": 500
}

```

We have another S3 repository, mounted to this elasticsearch claster, that was created manually and we are able to create snapshort on this repository with command from Kibana Dev Tools

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [July 17, 2018, 5:01pm UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290/2 "2018-07-17T17:01:42Z")

</div>

The repository has become corrupted (more details here: [https://github.com/elastic/elasticsearch/pull/30140](https://github.com/elastic/elasticsearch/pull/30140))  
This can happen if the lower-version cluster continues to write to the repository after the higher-version cluster has written to it.

Unfortunately, the only way to get back to a good state (where you can write into the repository) is to reset/clean the repository.

---

<div class="post-metadata">

**Author:** ![Pavlo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavlo/32/12176_2.png) [@Pavlo](https://discuss.elastic.co/u/Pavlo)\
**Post date:** [July 17, 2018, 7:32pm UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290/3 "2018-07-17T19:32:52Z")

</div>

Thank you for answer. Could you advice who can I clean default S3 repository? Do I have an access to it? It was generated automatically during creation of elasticsearch deployment.

---

<div class="post-metadata">

**Author:** ![neiljbrookes](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@neiljbrookes](https://discuss.elastic.co/u/neiljbrookes)\
**Post date:** [July 18, 2018, 2:17pm UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290/4 "2018-07-18T14:17:59Z")

</div>

Hi Pavlo,

If this is for an Elastic Cloud instance, it is probably best to open a support case via the "Help" section of the Elastic Cloud interface.

Thanks  
Neil

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 15, 2018, 2:18pm UTC](https://discuss.elastic.co/t/nullpointerexception-when-create-snapshots-on-s3/140290/5 "2018-08-15T14:18:10Z")

</div>

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