# Unable to register NFS for snapshot

**URL:** <https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026>\
**Category:** Elasticsearch\
**Created:** [June 17, 2019, 9:16am UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026 "2019-06-17T09:16:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 17, 2019, 9:16am UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/1 "2019-06-17T09:16:46Z")

</div>

Hi guys,

I'm unable to do the following cURL command:

```auto
curl -XPUT http://localhost:9200/_snapshot/backup -H 'Content-Type: application/json' -d '
{
    "type": "fs",
    "settings": {
        "location": "/mnt/NFS/NFS/logs",
        "compress": true
    }
}
'

```

The NFS is mounted at `/mnt/NFS` and the `logs` directory was created by the cURL command on all nodes. However, it presented me with this error:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "repository_verification_exception",
        "reason": "[backup] [[CbSAF_DDT869p9o4x9zFhg, 'RemoteTransportException[[logs-data-1][10.130.52.12:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[backup] store location [/mnt/NFS/NFS/logs] is not accessible on the node [{logs-data-1}{CbSAF_DDT869p9o4x9zFhg}{8si9G_SkSdqjpPbLhPqqdA}{10.130.52.12}{10.130.52.12:9300}{ml.machine_memory=8352534528, xpack.installed=true, ml.max_open_jobs=20}]]; nested: AccessDeniedException[/mnt/NFS/NFS/logs/tests-ZwoKJ3FNT8SCokXRnjfsRg/data-CbSAF_DDT869p9o4x9zFhg.dat];'], [Q75cM9JEQJSC4JofvAbNSA, 'RemoteTransportException[[logs-data-2][10.130.52.13:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[backup] store location [/mnt/NFS/NFS/logs] is not accessible on the node [{logs-data-2}{Q75cM9JEQJSC4JofvAbNSA}{2441G-fPTKa_wOFQMBhLXQ}{10.130.52.13}{10.130.52.13:9300}{ml.machine_memory=8353415168, xpack.installed=true, ml.max_open_jobs=20}]]; nested: AccessDeniedException[/mnt/NFS/NFS/logs/tests-ZwoKJ3FNT8SCokXRnjfsRg/data-Q75cM9JEQJSC4JofvAbNSA.dat];']]"
      }
    ],
    "type": "repository_verification_exception",
    "reason": "[backup] [[CbSAF_DDT869p9o4x9zFhg, 'RemoteTransportException[[logs-data-1][10.130.52.12:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[backup] store location [/mnt/NFS/NFS/logs] is not accessible on the node [{logs-data-1}{CbSAF_DDT869p9o4x9zFhg}{8si9G_SkSdqjpPbLhPqqdA}{10.130.52.12}{10.130.52.12:9300}{ml.machine_memory=8352534528, xpack.installed=true, ml.max_open_jobs=20}]]; nested: AccessDeniedException[/mnt/NFS/NFS/logs/tests-ZwoKJ3FNT8SCokXRnjfsRg/data-CbSAF_DDT869p9o4x9zFhg.dat];'], [Q75cM9JEQJSC4JofvAbNSA, 'RemoteTransportException[[logs-data-2][10.130.52.13:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[backup] store location [/mnt/NFS/NFS/logs] is not accessible on the node [{logs-data-2}{Q75cM9JEQJSC4JofvAbNSA}{2441G-fPTKa_wOFQMBhLXQ}{10.130.52.13}{10.130.52.13:9300}{ml.machine_memory=8353415168, xpack.installed=true, ml.max_open_jobs=20}]]; nested: AccessDeniedException[/mnt/NFS/NFS/logs/tests-ZwoKJ3FNT8SCokXRnjfsRg/data-Q75cM9JEQJSC4JofvAbNSA.dat];']]"
  },
  "status": 500
}

```

I also tried to first change the `logs` directory owner to `elasticsearch:elasticsearch` and was able to create file in it. However, once I ran the cURL command, the permissions changed and I was no longer able to write into it.

Could anyone tell me what I am doing wrong here? Thanks!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 17, 2019, 9:21am UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/2 "2019-06-17T09:21:48Z")

</div>

NFS permission issues are often because the Elasticsearch process is not running as the same numerical UID or GID on each node, without compensating for this in the NFS configuration, meaning that when one node creates a subdirectory of the repository it is not possible for the other nodes to modify it. That is the first thing I would check.

> [@Error when creating a Snapshot Repository](https://discuss.elastic.co/t/error-when-creating-a-snapshot-repository/152587/2):
>
> It's better to share the whole stack trace of the exception and the whole error message - even though they can be quite long, they also include useful information. I'm going to guess that the Elasticsearch process is not running as the same numerical UID or GID on each node, and your NFS configuration does not compensate for this, meaning that when one node creates a subdirectory of the repository it is not possible for the other nodes to modify it.

---

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 18, 2019, 7:25am UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/3 "2019-06-18T07:25:12Z")

</div>

Hi @DavidTurner,

Thanks! That is indeed the problem. I used `usermod -u [uid] elasticsearch` and `groupmod -g [gid] elasticsearch` to change the UID and GID. I did need to stop the cluster, re-chown directories and files that Elasticsearch uses and restart the cluster but that fixed it.

---

<div class="post-metadata">

**Author:** ![Vineeth\_Ananthula1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_ananthula1/32/47851_2.png) [@Vineeth\_Ananthula1](https://discuss.elastic.co/u/Vineeth_Ananthula1)\
**Post date:** [June 18, 2019, 10:27am UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/4 "2019-06-18T10:27:50Z")

</div>

@aqiank I have also changed the user id of the elasticsearch and the folder /var/lib/elasticsearch. But I am unable start my elasticsearch . Please tell me the solution

---

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 18, 2019, 1:23pm UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/5 "2019-06-18T13:23:18Z")

</div>

Hi @Vineeth_Ananthula1,

I also chown `/etc/default/elasticsearch`, `/etc/elasticsearch/` and `/var/log/elasticsearch`.

---

<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:** [July 16, 2019, 1:23pm UTC](https://discuss.elastic.co/t/unable-to-register-nfs-for-snapshot/186026/6 "2019-07-16T13:23:28Z")

</div>

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