Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Docker image, using "generate" doesn't work... #6365

Closed
flatline-studios opened this issue Nov 14, 2019 · 4 comments
Closed

Docker image, using "generate" doesn't work... #6365

flatline-studios opened this issue Nov 14, 2019 · 4 comments

Comments

@flatline-studios
Copy link

Description

Attempting to generate a Synapse config with the generate command, as per the Docker hub docs.

Steps to reproduce

Running the following command:

docker run -it --rm \
     --mount type=volume,src=synapse-data,dst=/data \
     -e SYNAPSE_SERVER_NAME=my.matrix.host \
     -e SYNAPSE_REPORT_STATS=no \
     -e SYNAPSE_CONFIG_DIR=/data/conf \
     -e SYNAPSE_CONFIG_PATH=/data/conf/homeserver.yaml \
     -e SYNAPSE_DATA_DIR=/data/data \
     matrixdotorg/synapse:latest generate

Results in:

Container running as UserID 0:0, ENV (or defaults) requests 991:991
Creating log config /data/conf/my.matrix.host.log.config
Traceback (most recent call last):
  File "/start.py", line 259, in <module>
    main(sys.argv, os.environ)
  File "/start.py", line 201, in main
    return run_generate_config(environ, ownership)
  File "/start.py", line 150, in run_generate_config
    convert("/conf/log.config", log_config_file, environ)
  File "/start.py", line 33, in convert
    with open(dst, "w") as outfile:
FileNotFoundError: [Errno 2] No such file or directory: '/data/conf/my.matrix.host.log.config'

Version information

  • Platform:

Docker version 19.03.2, build 6a30dfca03

@flatline-studios
Copy link
Author

In fact, even just running with the command listed on the Docker Hub page doesn't work (albeit with a different error).

~$ docker run -it --rm \
 >     --mount type=volume,src=synapse-data,dst=/data \
>     -e SYNAPSE_SERVER_NAME=my.matrix.host \
>     -e SYNAPSE_REPORT_STATS=yes \
>     matrixdotorg/synapse:latest generate
Container running as UserID 0:0, ENV (or defaults) requests 991:991
Creating log config /data/my.matrix.host.log.config
Generating config file /data/homeserver.yaml
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/site-packages/synapse/app/homeserver.py", line 659, in <module>
    main()
  File "/usr/local/lib/python3.7/site-packages/synapse/app/homeserver.py", line 654, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python3.7/site-packages/synapse/app/homeserver.py", line 333, in setup
    "Synapse Homeserver", config_options
  File "/usr/local/lib/python3.7/site-packages/synapse/config/_base.py", line 576, in load_or_generate_config
    with open(config_path, "w") as config_file:
PermissionError: [Errno 13] Permission denied: '/data/homeserver.yaml'

@flatline-studios flatline-studios changed the title Docker image, using "generate", with a custom SYNAPSE_CONFIG_DIR - Fails with: "FileNotFoundError: [Errno 2] No such file or directory Docker image, using "generate" doesn't work... Nov 14, 2019
@BlackWolfDEsign
Copy link

BlackWolfDEsign commented Nov 17, 2019

use "migrate_config"

docker run -it --name matrix -v $(pwd)/data/:/data/ -e SYNAPSE_SERVER_NAME=chat.domain.de -e SYNAPSE_REPORT_STATS=yes matrixdotorg/synapse:latest migrate_config
docker stop matrix
docker rm matrix
echo "starting:"
docker run -d --name matrix -v $(pwd)/data/:/data/ -p 8008:8008 matrixdotorg/synapse:latest

@richvdh
Copy link
Member

richvdh commented Nov 18, 2019

dup #6303

@richvdh richvdh closed this as completed Nov 18, 2019
@qknight
Copy link

qknight commented Sep 2, 2022

I now reinstalled git for windows and clicked:
[x] Checkout as-is, commit: Unix-style line endings
Then I cloned synapse again and it worked out of the box!

Thanks for your support.

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

No branches or pull requests

4 participants