Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not create config file: permission denied #94

Closed
AlexKalopsia opened this issue Apr 27, 2022 · 1 comment
Closed

Could not create config file: permission denied #94

AlexKalopsia opened this issue Apr 27, 2022 · 1 comment

Comments

@AlexKalopsia
Copy link

AlexKalopsia commented Apr 27, 2022

Hi everyone, I am running on this issue while trying to get Mattermost to run on my machine.

My docker-compose:

mattermost: 
    container_name: mattermost
    image: mattermost/mattermost-enterprise-edition:latest 
    ports:
    - 8065:8065
    volumes:
      - ${DOCKER_PATH}/mattermost/config:/mattermost/config:rw
      - ${DOCKER_PATH}/mattermost/data:/mattermost/data:rw
      - ${DOCKER_PATH}/mattermost/logs:/mattermost/logs:rw
      - ${DOCKER_PATH}/mattermost/plugins:/mattermost/plugins:rw
      - ${DOCKER_PATH}/mattermost/client-plugins:/mattermost/client/plugins:rw
      - ${DOCKER_PATH}/mattermost/bleve-indexes:/mattermost/bleve-indexes:rw
    environment:
      - TZ=${TZ}
      - PUID=${PUID}
      - PGID=${PGID}
      - APP_PORT=8065
      - MM_SQLSETTINGS_DRIVERNAME=postgres
      - MM_SQLSETTINGS_DATASOURCE=postgres://${MATTERMOST_USER}:${MATTERMOST_PSW}@${IP}:5438/${MATTERMOST_DB}?sslmode=disable&connect_timeout=10
      - MM_BLEVESETTINGS_INDEXDIR=/mattermost/bleve-indexes
      - MM_SERVICESETTINGS_SITEURL=${MATTERMOST_URL}
    security_opt:
      - no-new-privileges:true
    pids_limit: 200
    read_only: false
    tmpfs:
      - /tmp
    restart: unless-stopped
    depends_on:
      - postgres

Once I deploy the container I get:

Error: failed to load configuration: could not create config file: open /mattermost/config/config.json: permission denied
Usage:
  mattermost [flags]
  mattermost [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  db          Commands related to the database
  export      Export data from Mattermost
  help        Help about any command
  import      Import data.
  jobserver   Start the Mattermost job server
  server      Run the Mattermost server
  version     Display version information

Flags:
  -c, --config string   Configuration file to use.
  -h, --help            help for mattermost

Use "mattermost [command] --help" for more information about a command.

I have found some issues from the deprecated repo (mattermost/mattermost-docker#407) (mattermost/mattermost-docker#544 (comment)) that seem related to my current issue. The main difference is that the old repo would force users to manually build their image, but in this case I can't, since the image is already built.

I have tried setting the folder permissions manually, but with no luck.

I hope you can help me figure out how to fix this, thank you.

@AlexKalopsia
Copy link
Author

AlexKalopsia commented Apr 28, 2022

I solved the issue by giving permissions to 2000:2000 to all the mounted folders

chown -R 2000:2000 ./path/to/mattermost/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant