Skip to content

Cannot start Synapse through docker-compose: Permission denied: '/data/homeserver.yaml' #15202

@matrixbot

Description

@matrixbot

This issue has been migrated from #15202.


Description

Every time I attempt to start a new synapse server from docker-compose I receive the below error.

Steps to reproduce

  1. Create docker-compose with parameters (volume and network is defined earlier as synapse):
  synapse-server:
    image: matrixdotorg/synapse:latest
    container_name: synapse
    environment:
      - SYNAPSE_SERVER_NAME=my.domain.com
      - SYNAPSE_REPORT_STATS=no
    restart: unless-stopped
    networks:
      - synapse
    volumes:
      - synapse:/data
    ports:
      - "8008:8008"
  1. Attempt to start the server through sudo docker-compose up
  2. Receive error in logs below

Homeserver

Custom hostserver

Synapse Version

Latest from matrixdotorg/synapse

Installation Method

Docker (matrixdotorg/synapse)

Database

SQLite

Workers

Single process

Platform

Debian 11 Bullseye
Docker (docker-compose)

Configuration

Stock/vanilla config

Relevant log output

synapse             | Traceback (most recent call last):
synapse             |   File "<frozen runpy>", line 198, in _run_module_as_main
synapse             |   File "<frozen runpy>", line 88, in _run_code
synapse             |   File "/usr/local/lib/python3.11/site-packages/synapse/app/homeserver.py", line 389, in <module>
synapse             |     main()
synapse             |   File "/usr/local/lib/python3.11/site-packages/synapse/app/homeserver.py", line 379, in main
synapse             |     hs = setup(sys.argv[1:])
synapse             |          ^^^^^^^^^^^^^^^^^^^
synapse             |   File "/usr/local/lib/python3.11/site-packages/synapse/app/homeserver.py", line 287, in setup
synapse             |     config = HomeServerConfig.load_or_generate_config(
synapse             |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse             |   File "/usr/local/lib/python3.11/site-packages/synapse/config/_base.py", line 792, in load_or_generate_config
synapse             |     config_dict = read_config_files(config_files)
synapse             |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
synapse             |   File "/usr/local/lib/python3.11/site-packages/synapse/config/_base.py", line 874, in read_config_files
synapse             |     with open(config_file) as file_stream:
synapse             |          ^^^^^^^^^^^^^^^^^
synapse             | PermissionError: [Errno 13] Permission denied: '/data/homeserver.yaml'

Anything else that would be useful to know?

I have created the volume from scratch multiple times, manually set permissions on the directory in the volume as suggested by ma-fl in #6303, and generated a new config by manually running the docker container with generate or migrate_config commands.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions