# Azure repository creation issue in 7.10.2

**URL:** <https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [September 10, 2021, 1:55pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896 "2021-09-10T13:55:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![margold](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/margold/32/79595_2.png) [@margold](https://discuss.elastic.co/u/margold)\
**Post date:** [September 10, 2021, 1:55pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/1 "2021-09-10T13:55:55Z")

</div>

(I'm using this image: amazon/opendistro-for-elasticsearch:1.13.2)

Following the docs on setting up an azure repository:

1. Added storage account name and key and reloaded settings ([Azure Repository | Elasticsearch Plugins and Integrations [7.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/plugins/7.10/repository-azure-usage.html))

```auto
# on the elasticsearch node; I have one node in this test cluster
bin/elasticsearch-keystore add azure.client.default.account
bin/elasticsearch-keystore add azure.client.default.key
curl -X POST "localhost:9200/_nodes/reload_secure_settings"

```

1. Tried to register the Azure repository using the simplest settings ([Repository settings | Elasticsearch Plugins and Integrations [7.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/plugins/7.10/repository-azure-repository-settings.html))

```auto
# on the elasticsearch node
curl -X PUT "localhost:9200/_snapshot/my_backups_repository" -H 'Content-Type: application/json' -d '{
  "type": "azure"
}'

```

Getting

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "repository_verification_exception",
        "reason": "[my_backups_repository] path is not accessible on master node"
      }
    ],
    "type": "repository_verification_exception",
    "reason": "[my_backups_repository] path is not accessible on master node",
    "caused_by": {
      "type": "null_pointer_exception",
      "reason": "Cannot invoke \"String.length()\" because \"host\" is null"
    }
  },
  "status": 500
}

```

and in the logs I see

```auto
[2021-09-10T13:50:42,456][WARN][r.suppressed] [elasticsearch-0] path: /_snapshot/my_backups_repository, params: {repository=my_backups_repository}
org.elasticsearch.repositories.RepositoryVerificationException: [my_backups_repository] path is not accessible on master node
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1276) ~[elasticsearch-7.10.2.jar:7.10.2]
	at org.elasticsearch.repositories.RepositoriesService$3.doRun(RepositoriesService.java:268) ~[elasticsearch-7.10.2.jar:7.10.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:743) [elasticsearch-7.10.2.jar:7.10.2]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.10.2.jar:7.10.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "host" is null
	at com.microsoft.azure.storage.core.Utility.isHostDnsName(Utility.java:533) ~[?:?]
	at com.microsoft.azure.storage.core.Utility.determinePathStyleFromUri(Utility.java:521) ~[?:?]
	at com.microsoft.azure.storage.StorageUri.<init>(StorageUri.java:71) ~[?:?]
	at com.microsoft.azure.storage.core.PathUtility.appendPathToUri(PathUtility.java:124) ~[?:?]
	at com.microsoft.azure.storage.core.PathUtility.appendPathToUri(PathUtility.java:108) ~[?:?]
	at com.microsoft.azure.storage.blob.CloudBlobContainer.<init>(CloudBlobContainer.java:169) ~[?:?]
	at com.microsoft.azure.storage.blob.CloudBlobClient.getContainerReference(CloudBlobClient.java:123) ~[?:?]
	at org.elasticsearch.repositories.azure.AzureBlobStore.writeBlob(AzureBlobStore.java:333) ~[?:?]
	at org.elasticsearch.repositories.azure.AzureBlobContainer.writeBlob(AzureBlobContainer.java:115) ~[?:?]
	at org.elasticsearch.repositories.azure.AzureBlobContainer.writeBlobAtomic(AzureBlobContainer.java:123) ~[?:?]
	at org.elasticsearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1271) ~[elasticsearch-7.10.2.jar:7.10.2]
	... 6 more

```

Can't figure out what `host` might refer to. Are there more settings I need to provide?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 13, 2021, 6:12am UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/2 "2021-09-13T06:12:12Z")

</div>

> [@margold](#):
>
> (I'm using this image: amazon/opendistro-for-elasticsearch:1.13.2)

opendistro is an aws project, you may need to ask them on their support forums.

However, did you create a custom `container` or are you using the default?

---

<div class="post-metadata">

**Author:** ![margold](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/margold/32/79595_2.png) [@margold](https://discuss.elastic.co/u/margold)\
**Post date:** [September 13, 2021, 2:03pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/3 "2021-09-13T14:03:27Z")

</div>

I tried both the default container (`elasticsearch-snapshots` based on what the docs say) and a custom container (`backups`)

```auto
# checking that the containers exist
az storage container list --account-name xyz -o table      
Name Lease Status Last Modified
----------------------- -------------- -------------------------
backups 2021-08-19T11:22:07+00:00
elasticsearch-snapshots 2021-09-13T13:26:02+00:00

```

```auto
PUT _snapshot/my_backups_repository
{
  "type": "azure"
}

PUT _snapshot/my_backups_repository
{
  "type": "azure",
  "settings": {
    "container": "backups",
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 13, 2021, 11:11pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/4 "2021-09-13T23:11:20Z")

</div>

You might need to ask the opendistro devs then sorry.

---

<div class="post-metadata">

**Author:** ![margold](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/margold/32/79595_2.png) [@margold](https://discuss.elastic.co/u/margold)\
**Post date:** [September 15, 2021, 1:30pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/5 "2021-09-15T13:30:57Z")

</div>

So turns out I had a typo in the container name. After fixing that, everything works. Just leaving this here in case anybody else has the same problem as `Cannot invoke \"String.length()\" because \"host\" is null` is not the clearest error message.

---

<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:** [October 13, 2021, 1:31pm UTC](https://discuss.elastic.co/t/azure-repository-creation-issue-in-7-10-2/283896/6 "2021-10-13T13:31:48Z")

</div>

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