# S3 Repository Plugin - curl: (52) Empty reply from server

**URL:** https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447
**Category:** Elasticsearch
**Created:** [December 23, 2020, 4:42am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447 "2020-12-23T04:42:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bigbansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigbansal/32/81288_2.png) [@bigbansal](https://discuss.elastic.co/u/bigbansal)
#### Post date: [December 23, 2020, 4:42am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/1 "2020-12-23T04:42:02Z")

</div>

Hi All,

I am struggling to put data node's data to S3 Bucket and getting empty response from server. can u please suggest what could be the reason ?

--elasticsearch.yml has

path.repo: $s3\_Bucket/$s3\_Prefix/docroot

-- keystore has

echo "$access\_key" | /usr/share/elasticsearch/bin/elasticsearch-keystore add --stdin s3.client.default.access\_key  
echo "$secret\_key" | /usr/share/elasticsearch/bin/elasticsearch-keystore add --stdin s3.client.default.secret\_key

bucket=$(echo $s3\_B)  
referenceStackName=$(echo $s3\_P)/docroot  
access\_key="{KEY}"  
secret\_key="{SECRET\_KEY}"  
--REQUEST  
curl -v -XPUT -u "USERNAME":"PASSWORD" "localhost:9200/\_snapshot/s3\_backup?pretty" -H 'Content-Type: application/json' -d'  
{  
"type": "s3",  
"settings": {  
"bucket": "$bucket",  
"base\_path": "$referenceStackName",  
"proxy.host": "{PROXY\_HOST}",  
"access\_key":"$access\_key",  
"secret\_key":"$secret\_key",  
"proxy.port": "{PROXY\_PORT}",  
"compress": "true"  
}  
}'

--Response

- Trying 127.0.0.1...
- TCP\_NODELAY set
- Connected to localhost (127.0.0.1) port 9200 (#0)
- Server auth using Basic with user 'XXXXXXX'

> PUT /\_snapshot/s3\_backup HTTP/1.1  
> Host: localhost:9200  
> Authorization: Basic XXXXXXXXXXXX  
> User-Agent: curl/7.61.1  
> Accept: _/_  
> Content-Type: application/json  
> Content-Length: 90

- upload completely sent off: 90 out of 90 bytes
- Empty reply from server
- Connection #0 to host localhost left intact  
curl: (52) Empty reply from server

---

<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: [December 29, 2020, 6:15am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/2 "2020-12-29T06:15:08Z")

</div>

What is in the Elasticsearch logs? Do you have a proxy in front of Elasticsearch at all?

---

<div class="post-metadata">

### Author: ![bigbansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigbansal/32/81288_2.png) [@bigbansal](https://discuss.elastic.co/u/bigbansal)
#### Post date: [December 29, 2020, 6:46am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/3 "2020-12-29T06:46:38Z")

</div>

Thanks for your reply.

I had found solution to above problem, using "https"

curl -k -v -XPUT -u "USERNAME":"PASSWORD" "[https://localhost:9200/\_snapshot/s3\_backup?pretty](https://localhost:9200/_snapshot/s3_backup?pretty)" -H 'Content-Type: application/json' -d'

But I am still not able to take backup on S3 due to

**path is not accessible on master node** Error

I am checking the root cause, but I am quite sure, IAM user has the right access.

I run below command -

curl -k -v -XPUT -u "USERNAME:PASSWORD" "[https://localhost:9200/\_snapshot/test3?pretty](https://localhost:9200/_snapshot/test3?pretty)" -H 'Content-Type: application/json' -d'

> {  
> "type": "s3",  
> "settings": {  
> "bucket": "mybucket",  
> "base\_path": "private/temp",  
> "proxy.host": "PROXYHOST",  
> "proxy.port": "PROXYPORT",  
> "compress": "true"
> 
> ```
> }
> 
> ```
> 
> }'

I face this error -  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "repository\_verification\_exception",  
"reason" : "[test3] path [private/temp] is not accessible on master node"  
}  
],  
"type" : "repository\_verification\_exception",  
"reason" : "[test3] path [private/temp] is not accessible on master node",  
"caused\_by" : {  
"type" : "i\_o\_exception",  
"reason" : "Unable to upload object [private/temp/tests-s1D3r1F2S-mA122xyltdww/master.dat] using a single upload",  
"caused\_by" : {  
"type" : "amazon\_s3\_exception",  
"reason" : "amazon\_s3\_exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: BBF014C7A886741A; S3 Extended Request ID: CrUNc9ojqdV6AJLEKP3453453454355k2AZ8iKC6csmocr/WahCjgg3DblnA=)"  
}  
}  
},  
"status" : 500

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 29, 2020, 7:50am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/4 "2020-12-29T07:50:43Z")

</div>

The repository need to be configured on all master and data nodes and it seems this may not be the case here.Please check your node configuration.

---

<div class="post-metadata">

### Author: ![bigbansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigbansal/32/81288_2.png) [@bigbansal](https://discuss.elastic.co/u/bigbansal)
#### Post date: [December 30, 2020, 8:39am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/5 "2020-12-30T08:39:56Z")

</div>

I did configure the repository.

I issue to capture Snapshot was resloved after removing proxy url and port.  
Thanks for @warkolm.

However now I am not able to restore the snapshots. Following is the policy I have applied

curl -k -v -XPUT -u "es\_account":"ES\_ACCOUNT\_PASSWORD" "[https://localhost:9200/\_slm/policy/night-snpsht1?pretty](https://localhost:9200/_slm/policy/night-snpsht1?pretty)" -H 'Content-Type: application/json' -d'  
{  
"schedule": "0 30 1 \* \* ?",  
"name": "\<n-s1-{now/d}\>",  
"repository": "s3\_backup",  
"config": {  
"indices": ["\*"]  
},  
"retention": {  
"expire\_after": "15d",  
"min\_count": 5,  
"max\_count": 50  
}  
}'

Request -  
After executing -  
[https://localhost:9200/\_slm/policy/night-snpsht1/\_execute](https://localhost:9200/_slm/policy/night-snpsht1/_execute)

Response  
{  
"snapshot\_name": "n-s1-2020.12.30-d52\_0hv9qmsemma75yfqtw"  
}

However when I run below

Request -

[https://localhost:9200/\_snapshot/s3\_backup/n-s1-2020.12.30-d52\_0hv9qmsemma75yfqtw/\_restore](https://localhost:9200/_snapshot/s3_backup/n-s1-2020.12.30-d52_0hv9qmsemma75yfqtw/_restore)

I get below response -  
{  
"error": {  
"root\_cause": [  
{  
"type": "snapshot\_restore\_exception",  
"reason": "[s3\_backup:n-s1-2020.12.30-d52\_0hv9qmsemma75yfqtw/sZpqtI8\_S7y-kbO28cSZ5Q] cannot restore index [.slm-history-1-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"  
}  
],  
"type": "snapshot\_restore\_exception",  
"reason": "[s3\_backup:n-s1-2020.12.30-d52\_0hv9qmsemma75yfqtw/sZpqtI8\_S7y-kbO28cSZ5Q] cannot restore index [.slm-history-1-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"  
},  
"status": 500  
}

---

<div class="post-metadata">

### Author: ![bigbansal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigbansal/32/81288_2.png) [@bigbansal](https://discuss.elastic.co/u/bigbansal)
#### Post date: [January 6, 2021, 8:34am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/6 "2021-01-06T08:34:59Z")

</div>

I was able to restore indexes, when I specified specific indexes.

---

<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: [February 3, 2021, 8:35am UTC](https://discuss.elastic.co/t/s3-repository-plugin-curl-52-empty-reply-from-server/259447/7 "2021-02-03T08:35:13Z")

</div>

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