Description
When using the docker documentation to run new a matrix server on v1.99.0 it fails with [Errno 13] Permission denied: '/data/localhost.signing.key'
This is because of the changes in 10ada2f which adjusts the file permissions to 0640 instead of the previous 0644 which in itself is a great change but leaves this documentation broken. The docker container runs with a UID and GID of 991 but the generate steps run as root, therefore neither the group nor the user sufficiently overlaps with the generated files permissions.
The fix is to adjust the permissions of the volume / folder before generating the files and to use the right user when generating the files (eg. -u 991:991). Or another simple fix is to run chown -R 991:991 ./your-data-dir after the files have been generated.
This should be noted somewhere in the documentation.
Steps to reproduce
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
docker run -d --name synapse \
--mount type=volume,src=synapse-data,dst=/data \
-p 8008:8008 \
matrixdotorg/synapse:latest
Homeserver
Synapse Version
v1.99.0
Installation Method
Docker (matrixdotorg/synapse)
Database
SQLite
Workers
Single process
Platform
Arch
Configuration
No response
Relevant log output
$ 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
Setting ownership on /data to 991:991
Creating log config /data/my.matrix.host.log.config
Generating config file /data/homeserver.yaml
Generating signing key file /data/my.matrix.host.signing.key
A config file has been generated in '/data/homeserver.yaml' for server name 'my.matrix.host'. Please review this file and customise it to your needs.
$ docker run --name synapse \
--mount type=volume,src=synapse-data,dst=/data \
-p 8008:8008 \
matrixdotorg/synapse:latest
Starting synapse with args -m synapse.app.homeserver --config-path /data/homeserver.yaml
Error in configuration at 'signing_key':
Error accessing file '/data/my.matrix.host.signing.key':
[Errno 13] Permission denied: '/data/my.matrix.host.signing.key'
Anything else that would be useful to know?
No response
Description
When using the docker documentation to run new a matrix server on v1.99.0 it fails with
[Errno 13] Permission denied: '/data/localhost.signing.key'This is because of the changes in 10ada2f which adjusts the file permissions to 0640 instead of the previous 0644 which in itself is a great change but leaves this documentation broken. The docker container runs with a UID and GID of 991 but the generate steps run as root, therefore neither the group nor the user sufficiently overlaps with the generated files permissions.
The fix is to adjust the permissions of the volume / folder before generating the files and to use the right user when generating the files (eg.
-u 991:991). Or another simple fix is to runchown -R 991:991 ./your-data-dirafter the files have been generated.This should be noted somewhere in the documentation.
Steps to reproduce
Homeserver
Synapse Version
v1.99.0
Installation Method
Docker (matrixdotorg/synapse)
Database
SQLite
Workers
Single process
Platform
Arch
Configuration
No response
Relevant log output
$ 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 Setting ownership on /data to 991:991 Creating log config /data/my.matrix.host.log.config Generating config file /data/homeserver.yaml Generating signing key file /data/my.matrix.host.signing.key A config file has been generated in '/data/homeserver.yaml' for server name 'my.matrix.host'. Please review this file and customise it to your needs. $ docker run --name synapse \ --mount type=volume,src=synapse-data,dst=/data \ -p 8008:8008 \ matrixdotorg/synapse:latest Starting synapse with args -m synapse.app.homeserver --config-path /data/homeserver.yaml Error in configuration at 'signing_key': Error accessing file '/data/my.matrix.host.signing.key': [Errno 13] Permission denied: '/data/my.matrix.host.signing.key'Anything else that would be useful to know?
No response