Error: EACCES: permission denied, open opensearch_dashboards.yml

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue:

I am trying to install my custom opensearch_dashboard.yml; however, I am getting the below error:

opensearch-dashboards | internal/fs/utils.js:332

opensearch-dashboards | throw err;

opensearch-dashboards | ^

opensearch-dashboards |

opensearch-dashboards | Error: EACCES: permission denied, open ‘/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml’

opensearch-dashboards | at Object.openSync (fs.js:498:3)

opensearch-dashboards | at Object.readFileSync (fs.js:394:35)

opensearch-dashboards | at readYaml (/usr/share/opensearch-dashboards/node_modules/@osd/apm-config-loader/target/utils/read_config.js:37:52)

opensearch-dashboards | at Object.exports.getConfigFromFiles (/usr/share/opensearch-dashboards/node_modules/@osd/apm-config-loader/target/utils/read_config.js:62:22)

opensearch-dashboards | at exports.loadConfiguration (/usr/share/opensearch-dashboards/node_modules/@osd/apm-config-loader/target/config_loader.js:43:38)

opensearch-dashboards | at module.exports (/usr/share/opensearch-dashboards/src/apm.js:58:15)

opensearch-dashboards | at Object. (/usr/share/opensearch-dashboards/src/cli/dist.js:32:18)

opensearch-dashboards | at Module._compile (internal/modules/cjs/loader.js:1085:14)

opensearch-dashboards | at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)

opensearch-dashboards | at Module.load (internal/modules/cjs/loader.js:950:32) {

opensearch-dashboards | errno: -13,

opensearch-dashboards | syscall: ‘open’,

opensearch-dashboards | code: ‘EACCES’,

opensearch-dashboards | path: ‘/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml’

opensearch-dashboards | }

opensearch-dashboards exited with code 1

Configuration:
This is taken from my docker-compose.yml file:

opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:latest
container_name: opensearch-dashboards
ports:
- 5601:5601
expose:
- “5601”
volumes:
- ./opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
#- …/resources/logo.png:/usr/share/opensearch-dashboards/src/plugins/home/public/assets/logos/logo.png
environment:
OPENSEARCH_HOSTS: ‘[“https://opensearch-node1:9200”,“https://opensearch-node2:9200”]’
networks:
- opensearch-net

Relevant Logs or Screenshots:

Hey!

Could you share the permissions for the file opensearch_dashboards.yml?

I figured out the problem. I just needed to move my project from my virtual box shared folders. I originally had my open search project in this shared folder, which is shared between my Linux VM and Windows machine. I moved it to another location in my Linux box. In my case I moved it to the ~/Desktop folder. After doing this I could then add my custom opensearch_dashboards.yml file successfully.

1 Like