# Permission error while trying to access file which is under mounted volume

**URL:** <https://discuss.elastic.co/t/permission-error-while-trying-to-access-file-which-is-under-mounted-volume/312881>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 25, 2022, 8:05am UTC](https://discuss.elastic.co/t/permission-error-while-trying-to-access-file-which-is-under-mounted-volume/312881 "2022-08-25T08:05:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cihady](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cihady](https://discuss.elastic.co/u/cihady)\
**Post date:** [August 25, 2022, 8:05am UTC](https://discuss.elastic.co/t/permission-error-while-trying-to-access-file-which-is-under-mounted-volume/312881/1 "2022-08-25T08:05:40Z")

</div>

I cant access the files that are in mounted volume

```auto
elasticsearch | {"type": "server", "timestamp": "2022-08-25T07:52:51,332Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "docker-cluster", "node.name": "elasticsearch", "message": "uncaught exception in thread [main]",
elasticsearch | "stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.security.AccessControlException: access denied (\"java.io.FilePermission\" \"/usr/share/elasticsearch/cert\" \"read\")",

```

here is my docker compose file

```auto
version: '2.2'

services:

  elasticsearch:
    image: elastic:7.9.2
    container_name: elasticsearch
    environment:
      - node.name=elasticsearch
      - discovery.seed_hosts=elasticsearch
      - cluster.initial_master_nodes=elasticsearch
      - cluster.name=docker-cluster
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms4g -Xmx4g"
      - ELASTIC_PASSWORD=1@123
      - path.logs=/usr/share/elasticsearch/logs
      - xpack.security.enabled=true
      - xpack.security.http.ssl.keystore.path=/usr/share/elasticsearch/cert/elastic-certificates.p12
      - xpack.security.http.ssl.truststore.path=/usr/share/elasticsearch/cert/elastic-certificates.p12
      - xpack.security.http.ssl.client_authentication=optional
    volumes:
      - /home/elasticsearch/data:/usr/share/elasticsearch/data
      - /home/elasticsearch/logs:/usr/share/elasticsearch/logs
      - /home/elasticsearch/config:/usr/share/elasticsearch/cert

    user : "1000:1000"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: "65536"
        hard: "65536"
    ports:
      - 9200:9200
      - 9300:9300

  kibana:
    image: kibana:7.9.2
    container_name: kibana
    environment:
            - ELASTICSEARCH_URL="https://elasticsearch:9200"
            - ELASTICSEARCH_USERNAME=elastic
            - ELASTICSEARCH_PASSWORD=1@123
            - server.ssl.enabled=true
            - server.ssl.certificate=/usr/share/elasticsearch/cert/newfile.crt.pem
            - server.ssl.key=/usr/share/elasticsearch/cert/newfile.key.pem
            - elasticsearch.ssl.verificationMode=none
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
    volumes:
      - /home/elasticsearch/config:/usr/share/elasticsearch/cert

```

---

<div class="post-metadata">

**Author:** ![cihady](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cihady](https://discuss.elastic.co/u/cihady)\
**Post date:** [August 25, 2022, 11:08am UTC](https://discuss.elastic.co/t/permission-error-while-trying-to-access-file-which-is-under-mounted-volume/312881/2 "2022-08-25T11:08:26Z")

</div>

creating new folder was cause of the permission error, instead of mounting folder, I mount files and problem solved.

---

<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:** [September 22, 2022, 11:08am UTC](https://discuss.elastic.co/t/permission-error-while-trying-to-access-file-which-is-under-mounted-volume/312881/3 "2022-09-22T11:08:45Z")

</div>

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