# An error occurred curl: (52) Empty reply from server

**URL:** https://discuss.elastic.co/t/an-error-occurred-curl-52-empty-reply-from-server/372965
**Category:** Elastic Search
**Tags:** docker
**Created:** [January 9, 2025, 2:39am UTC](https://discuss.elastic.co/t/an-error-occurred-curl-52-empty-reply-from-server/372965 "2025-01-09T02:39:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Input\_Studios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/input_studios/32/140551_2.png) [@Input\_Studios](https://discuss.elastic.co/u/Input_Studios)
#### Post date: [January 9, 2025, 2:39am UTC](https://discuss.elastic.co/t/an-error-occurred-curl-52-empty-reply-from-server/372965/1 "2025-01-09T02:39:22Z")

</div>

Good day, a problem arose when requesting the following address: curl -X GET "[http://localhost:9200](http://localhost:9200)" an error occurs curl: (52) Empty reply from server. The code for connecting to the elasticsearch service is launched from the Docker container:

```auto
elasticsearch:
 container_name: elasticsearch_container
 image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3
 restart: always
 environment:
 ES_JAVA_OPTS: -Xmx2g -Xms2g
 bootstrap.memory_lock: "true"
 discovery.type: single-node
 xpack.security.enabled: "false"
 xpack.security.authc.api_key.enabled: "true"
 xpack.monitoring.collection.enabled: "true"
 xpack.security.enrollment.enabled: "true"
 xpack.security.authc.token.enabled: "true"
 ports:
 - 9300:9300
 - 9200:9200
 volumes:
 - ./docker-volumes/elasticsearch-data:/usr/share/elasticsearch/data
 networks:
 - elastic
 kibana:
 container_name: kibana_container
 image: docker.elastic.co/kibana/kibana:8.15.3
 restart: always
 environment:
 - ELASTICSEARCH_HOSTS=["http://elasticsearch_container:9200"]
 ports:
 - 5601:5601
 networks:
 - elastic
 volumes:
 - ./kibana.yml/:/usr/share/kibana/config/kibana.yml:ro
 depends_on:
 - elasticsearch

```

For some reason, the elasticsearch-data directory is empty and the console displays errors:

failed to obtain node locks, tried [/usr/share/elasticsearch/data]; maybe these locations are not writable or multiple nodes were started on the same data path?  
...  
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/node.lock  
...  
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/node.lock

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [January 9, 2025, 3:09am UTC](https://discuss.elastic.co/t/an-error-occurred-curl-52-empty-reply-from-server/372965/2 "2025-01-09T03:09:13Z")

</div>

> [@Input\_Studios](#):
>
> ```auto
> volumes:
> - ./docker-volumes/elasticsearch-data:/usr/share/elasticsearch/data
> 
> ```

You have a volume / permissions / paths error etc...

Try absolute paths, make sure docker user has permissions to ready write... that is what the error is telling you...

Also when you mess up a volume it can create a bad file or directory that needs to be cleaned up...

BTW this is my single node node security

`TAG=8.17.0 docker compose`

```auto
# version: '2.26.0'
services:
  elasticsearch:
    container_name: es01
    image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
    # 8.x
    environment: ['ES_JAVA_OPTS=-Xms8g -Xmx8g','bootstrap.memory_lock=true','discovery.type=single-node','xpack.security.enabled=false', 'xpack.security.enrollment.enabled=false']
    ports:
      - 9200:9200
    networks:
      - elastic
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'

  kibana:
    image: docker.elastic.co/kibana/kibana:${TAG}
    container_name: kib01
    environment:
      XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
      # LOGGING_ROOT_LEVEL: debug
    ports:
      - 5601:5601
    networks:
      - elastic
    deploy:    
      resources:
          limits:
            cpus: '2.0'
          reservations:
            cpus: '1.0'

networks:
  elastic:

```

In other compose were I want to maintain the volume

```auto
    volumes:
      - certs:/usr/share/elasticsearch/config/certs
      - esdata01:/usr/share/elasticsearch/data
....
volumes:
  certs:
    driver: local
  esdata01:
    driver: local
  kibanadata:
    driver: local

```

---

<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 6, 2025, 3:09am UTC](https://discuss.elastic.co/t/an-error-occurred-curl-52-empty-reply-from-server/372965/3 "2025-02-06T03:09:15Z")

</div>

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