element-hq / element-hq/synapse
Error when generating config with docker mounted config dir
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
### Description
Mounting a directory from the host to use as the config dir fails to generate a config.
### Steps to reproduce
```sh
mkdir conf
podman run --rm --name synapse \
--mount type=volume,src=synapse-data,dst=/data \
--mount type=bind,src=./conf,dst=/conf \
-e SYNAPSE_SERVER_NAME=matrix.example.com \
-e SYNAPSE_REPORT_STATS=yes \
-e SYNAPSE_CONFIG_DIR=/conf \
-e SYNAPSE_ENABLE_METRICS=1 \
docker.io/matrixdotorg/synapse:v1.147.0 generate
```
This crashes with the following traceback:
```
Traceback (most recent call last):
File "/start.py", line 321, in
main(sys.argv, os.environ)
~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/start.py", line 251, in main
return run_generate_config(environ, ownership)
File "/start.py", line 200, in run_generate_config
convert("/conf/log.config", log_config_file, environ)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/start.py", line 61, in convert
with open(src) as infile:
~~~~^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/conf/log.config'
```
### Homeserver
N/A
### Synapse Version
1.147
### Installation Method
Docker (matrixdotorg/synapse)
### Database
N/A
### Workers
Single process
### Platform
KDE Neon 24.04 running on bare metal
### Configuration
_No response_
### Relevant log output
```shell
See repro steps.
```
### Anything else that would be useful to know?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.