Giter Site home page Giter Site logo

aventer-ug / docker-matrix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from silvio/docker-matrix

87.0 87.0 19.0 374 KB

docker image for matrix.org

Home Page: https://riot.im/app/#/room/#dockermatrix:matrix.aventer.biz

License: GNU General Public License v2.0

Shell 60.16% Dockerfile 29.18% Makefile 10.66%
docker matrix

docker-matrix's People

Contributors

andreaspeters avatar ara4n avatar firecat53 avatar fonata avatar jwillmer avatar muellermartin avatar mvgorcum avatar nebukadneza avatar ogarcia avatar pulsar256 avatar seth-priya avatar silvio avatar uhoreg avatar williamboman avatar xsteadfastx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-matrix's Issues

No module named synapse.app

After i updated docker image yesterday matrix is refusing to start with following errors:

-=> start turn
-=> start matrix
2019-06-05 08:12:43,902 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2019-06-05 08:12:43,902 INFO Included extra file "/conf/supervisord-matrix.conf" during parsing
2019-06-05 08:12:43,902 INFO Included extra file "/conf/supervisord-turnserver.conf" during parsing
2019-06-05 08:12:43,906 INFO supervisord started with pid 1
2019-06-05 08:12:44,909 INFO spawned: 'matrix' with pid 22
2019-06-05 08:12:44,911 INFO spawned: 'turnserver' with pid 23
/usr/bin/python: No module named synapse.app
2019-06-05 08:12:44,932 INFO exited: matrix (exit status 1; not expected)
2019-06-05 08:12:45,669 INFO reaped unknown pid 17
2019-06-05 08:12:46,674 INFO spawned: 'matrix' with pid 32
2019-06-05 08:12:46,674 INFO success: turnserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
/usr/bin/python: No module named synapse.app
2019-06-05 08:12:46,688 INFO exited: matrix (exit status 1; not expected)
2019-06-05 08:12:48,693 INFO spawned: 'matrix' with pid 33
/usr/bin/python: No module named synapse.app
2019-06-05 08:12:48,709 INFO exited: matrix (exit status 1; not expected)
2019-06-05 08:12:51,716 INFO spawned: 'matrix' with pid 34
/usr/bin/python: No module named synapse.app
2019-06-05 08:12:51,732 INFO exited: matrix (exit status 1; not expected)
2019-06-05 08:12:52,734 INFO gave up: matrix entered FATAL state, too many start retries too quickly

Docker version is 18.09.6

My docker compose is:

 matrix:
    container_name: matrix
    image: avhost/docker-matrix
    restart: unless-stopped
    ports:
      - 8743:3478
      - 8743:3478/udp
      - 8008:8008
      - 8448:8448
      - 5349:5349
      - 5349:5349/udp
      - 65000-65535:65000-65535/udp
    environment:
       - SERVER_NAME=<REDACTED>
       - REPORT_STATS=no
       - VIRTUAL_HOST=<REDACTED>
       - VIRTUAL_PORT=8008
       - LETSENCRYPT_HOST=<REDACTED>
       - LETSENCRYPT_EMAIL=<REDACTED>
    volumes:
      - /docker-data/matrix:/data
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - nginx-proxy
      - nginx-proxy-letsencrypt

I checked DIFF between current config file and mine but I didn't find anything that I assume could cause problem there, also there are no logs in homeserver.log since update so I assume it's not able to start at all.

EDIT:
I'm pulling avhost/docker-matrix:latest

Broken image

Running

docker run -v `pwd`/data:/data --rm -e SERVER_NAME=localhost -e REPORT_STATS=no avhost/docker-matrix generate

fails with the following

-=> generate turn config
-=> generate synapse config
/usr/bin/python: No module named synapse.app
-=> configure some settings in homeserver.yaml
awk: cannot open /data/homeserver.tmp (No such file or directory)
-=> configure some settings in localhost.log.config
sed: can't read /data/localhost.log.config: No such file or directory

-=> you have to review the generated configuration file homeserver.yaml

The weird thing is that it worked before until I removed the old image (from two weeks ago) and pulled a new one. This happens on Arch Linux & macOS with the latest docker versions.

Switch to GitHub Container Registry

As the 'avhost' account on Docker registry appears to be a community organization, and given the sunsetting of Docker Hub free tier for organizations, I'm suggesting that this and other repositories currently on Docker Hub get migrated to GitHub's registry. The packages listing on the sidebar alongside the source keeps it unified nicely. If you need someone to take care of any efforts needed, I can definitely do the research on using GitHub Actions to publish these.

Config incompatible after upgrade.

Hi,

I want to upgrade from an older version 1.43.0 to the version you providing today, however it stated some deprecation messages:

 /usr/local/lib/python3.7/dist-packages/twisted/conch/ssh/common.py:14: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes, int_to_bytes

Synapse no longer includes a web client. To enable a web client, configure
web_client_location. To remove this warning, remove 'webclient' from the 'listeners'
configuration.

WARNING: The 'room_invite_state_types' configuration setting is now deprecated,
and replaced with 'room_prejoin_state'. New features may not work correctly
unless 'room_invite_state_types' is removed. See the sample configuration file for
details of 'room_prejoin_state'.

I replaced this image with the version from today and it just crashed with:

Error in configuration:
  Unknown listener resource:
    ("'names' must be in {'media', 'static', 'replication', 'openid', 'consent', 'client', 'federation', 'keys', 'metrics'} (got 'webclient')", Attribute(name='names', default=Factory(factory=<class 'list'>, takes_self=False), validator=<deep_iterable validator for iterables of <in_ validator with options {'media', 'static', 'replication', 'openid', 'consent', 'client', 'federation', 'keys', 'metrics'}>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.List[str], converter=None, kw_only=False, inherited=False, on_setattr=None), {'media', 'static', 'replication', 'openid', 'consent', 'client', 'federation', 'keys', 'metrics'}, 'webclient')

So it look like something that was deprecated, is now gone. Unfortunately this is the last line of the logs, so I would be happy if you have some hints where to look at.

thanks Devzero

Update to v0.26.1

A malformed event caused a lot of federated servers to crash (including mine).
The new hotfix should fix the issue.

pwgen: command not found

I'm trying to generate the example turnserver.yaml and homeserver.yaml. But the generate command keeps failing with the pwgen: command not found. Tried installing it but it does not help.

docker run -v /path/to/matrix/data:/data --rm --user 1000:1000 -e SERVER_NAME=matrix.xx.example -e REPORT_STATS=no avhost/docker-matrix:latest generate
-=> generate turn config
/start.sh: line 205: pwgen: command not found
/start.sh: line 17: : No such file or directory
/start.sh: line 18: : No such file or directory
/start.sh: line 19: : No such file or directory
/start.sh: line 20: : No such file or directory
/start.sh: line 21: : No such file or directory
/start.sh: line 22: : No such file or directory
/start.sh: line 23: : No such file or directory
-=> generate synapse config
/start.sh: line 24: : No such file or directory
Generating config file /data/homeserver.tmp
A config file has been generated in '/data/homeserver.tmp' for server name 'matrix.xx.example'. Please review this file and customise it to your needs.
-=> configure some settings in homeserver.yaml
mv: cannot move '/tmp/tmp.41pwBCogTS' to '': No such file or directory
-=> configure some settings in matrix.xx.example.log.config

Server don´t come up

I installed the server, leave the generated config as it is and tryed to acces the matrix server, but i dont get a web page loaded on port 8008, and my nginx reverse proxy throws a 502 (of course it dows)

Logs:

-=> generate turn config
-=> generate synapse config
Generating config file /data/homeserver.tmp
Generating log config file /data/domain.de.log.config which will log to /homeserver.log
Generating signing key file /data/domain.de.signing.key
A config file has been generated in '/data/homeserver.tmp' for server name 'domain.de'. Please review this file and customise it to your needs.
-=> configure some settings in homeserver.yaml
-=> configure some settings in domain.de.log.config

-=> you have to review the generated configuration file homeserver.yaml
-=> start turn
-=> start matrix
Cannot create pid file: /var/run/turnserver.pid: Permission denied
socket: Protocol not supported
socket: Protocol not supported
socket: Protocol not supported
0: log file opened: /var/tmp/turn_9_2021-01-25.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.1.1 'dan Eider'
0:
Max number of open files/sockets allowed for this process: 40960
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 20000 (approximately)
0:

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 supported
0: TURN/STUN ALPN supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.1.1d 10 Sep 2019 (0x1010104f)
0:
0: SQLite supported, default database location is /var/lib/turn/turndb
0: Redis supported
0: PostgreSQL supported
0: MySQL supported
0: MongoDB is not supported
0:
0: Default Net Engine version: 3 (UDP thread per CPU core)

=====================================================

0: Domain name:
0: Default realm: turn.domain.de
0:
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methohds.
Shared secret overrides username/password based auth method. Check your configuration!
0: ERROR:
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: WARNING: cannot find certificate file: /data/domain.de.tls.crt (1)
0: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: WARNING: cannot find private key file: /data/domain.de.tls.key (1)
0: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: WARNING: cannot find DH key file: /data/domain.de.tls.dh (1)
0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering listener addresses: =========
0: Listener address to use: 127.0.0.1
0: Listener address to use: 172.17.0.47
0: =====================================================
0: Total: 1 'real' addresses discovered
0: =====================================================
0: NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering relay addresses: =============
0: Relay address to use: IP
0: =====================================================
0: Total: 1 relay addresses discovered
0: =====================================================
0: Cannot create pid file: /var/run/turnserver.pid
0: pid file created: /var/tmp/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: Wait for relay ports initialization...
0: relay IP initialization...
0: relay IP initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: turn server id=0 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=3 created
0: turn server id=2 created
0: turn server id=4 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=6 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=5 created
0: turn server id=7 created
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=9 created
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=8 created
0: turn server id=10 created
0: turn server id=11 created
0: Total General servers: 12
0: IO method (auth thread): epoll (with changelist)
0: ERROR: Cannot open SQLite DB connection: </var/lib/turn/turndb>, runtime error:
unable to open database file
(If your intention is to use an SQLite database for the TURN server, then
socket: Protocol not supported
socket: Protocol not supported
....
socket: Protocol not supported
socket: Protocol not supported
This server is configured to use 'matrix.org' as its trusted key server via the
'trusted_key_servers' config option. 'matrix.org' is a good choice for a key
server since it is long-lived, stable and trusted. However, some admins may
wish to use another server for this purpose.

To suppress this warning and continue using 'matrix.org', admins should set
'suppress_key_server_warning' to 'true' in homeserver.yaml.
--------------------------------------------------------------------------------

Docker command:

docker run -d --name='matrix' --net='bridge' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e 'SERVER_NAME'='domain.de' -e 'REPORT_STATS'='yes' -e 'SYNAPSE_CACHE_FACTOR'='0.5' -e 'MATRIX_UID'='99' -e 'MATRIX_GID'='100' -p '8008:8008/tcp' -p '8448:8448/tcp' -p '3478:3478/tcp' -p '3478:3478/udp' -v '/mnt/user/appdata/matrix/':'/data':'rw' 'avhost/docker-matrix:latest' 

of course i changed domains and ip´s.

i dont know what exactly is the problem, becouse i leave all as it is, in a earlyer try i edited the conf for my needs and for debugging i deleted all files and start over without changes.

Unable to start the container on arm64

As the title says, I'm unable to use this on arm host. I've tried platform:linux/arm64 but all I get is standard_init_linux.go:228: exec user process caused: exec format error

Unable to start and issues with generation on v1.74.0

Hi there,

A couple of issues:

  1. It would appear that the TLS certificate and DHparams are not being generated as part of the generate process.
  2. Even when I create those files manually, the container still will not start.

Before creating certificates manually:

-=> start turn
-=> start matrix
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: : 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : log file opened: /var/tmp/turn_8_2023-01-02.log
0: : 
Max number of open files/sockets allowed for this process: 1048576
0: : 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: : 
==== Show him the instruments, Practical Frost: ====
0: : TLS supported
0: : DTLS supported
0: : DTLS 1.2 supported
0: : TURN/STUN ALPN supported
0: : Third-party authorization (oAuth) supported
0: : GCM (AEAD) supported
0: : OpenSSL compile-time version: OpenSSL 3.0.5 5 Jul 2022 (0x30000050)
0: : 
0: : SQLite supported, default database location is /var/lib/turn/turndb
0: : Redis supported
0: : PostgreSQL supported
0: : MySQL supported
0: : MongoDB is not supported
0: : 
0: : Default Net Engine version: 3 (UDP thread per CPU core)
=====================================================
0: : Domain name: 
0: : Default realm: turn.matrix
0: : 
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods. 
Shared secret overrides username/password based auth method. Check your configuration!
0: : ERROR: 
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: : WARNING: cannot find certificate file: /data/matrix.tls.crt (1)
0: : WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: : WARNING: cannot find private key file: /data/matrix.tls.key (1)
0: : WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: : WARNING: cannot find DH key file: /data/matrix.tls.dh (1)
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 172.17.0.6
0: : Listener address to use: ::1
0: : =====================================================
0: : Total: 1 'real' addresses discovered
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 172.17.0.6
0: : Relay address to use: ::1
0: : =====================================================
0: : Total: 2 relay addresses discovered
0: : =====================================================
0: : Cannot create pid file: /var/run/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : Wait for relay ports initialization...
0: :   relay 172.17.0.6 initialization...
0: :   relay 172.17.0.6 initialization done
0: :   relay ::1 initialization...
0: :   relay ::1 initialization done
0: : Relay ports initialization done
Cannot create relay thread
: Operation not permitted

After creating certificates manually:

-=> start turn
-=> start matrix
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: : 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : log file opened: /var/tmp/turn_8_2023-01-02.log
0: : 
Max number of open files/sockets allowed for this process: 1048576
0: : 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
Cannot create relay thread
: Operation not permitted
0: : 
==== Show him the instruments, Practical Frost: ====
0: : TLS supported
0: : DTLS supported
0: : DTLS 1.2 supported
0: : TURN/STUN ALPN supported
0: : Third-party authorization (oAuth) supported
0: : GCM (AEAD) supported
0: : OpenSSL compile-time version: OpenSSL 3.0.5 5 Jul 2022 (0x30000050)
0: : 
0: : SQLite supported, default database location is /var/lib/turn/turndb
0: : Redis supported
0: : PostgreSQL supported
0: : MySQL supported
0: : MongoDB is not supported
0: : 
0: : Default Net Engine version: 3 (UDP thread per CPU core)
=====================================================
0: : Domain name: 
0: : Default realm: turn.matrix
0: : ERROR: 
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: : SSL23: Certificate file found: /data/matrix.tls.crt
0: : SSL23: Private key file found: /data/matrix.tls.key
0: : TLS1.0: Certificate file found: /data/matrix.tls.crt
0: : TLS1.0: Private key file found: /data/matrix.tls.key
0: : TLS1.1: Certificate file found: /data/matrix.tls.crt
0: : TLS1.1: Private key file found: /data/matrix.tls.key
0: : TLS1.2: Certificate file found: /data/matrix.tls.crt
0: : TLS1.2: Private key file found: /data/matrix.tls.key
0: : TLS cipher suite: HIGH
0: : DTLS: Certificate file found: /data/matrix.tls.crt
0: : DTLS: Private key file found: /data/matrix.tls.key
0: : DTLS1.2: Certificate file found: /data/matrix.tls.crt
0: : DTLS1.2: Private key file found: /data/matrix.tls.key
0: : DTLS cipher suite: HIGH
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 172.17.0.6
0: : Listener address to use: ::1
0: : =====================================================
0: : Total: 1 'real' addresses discovered
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 172.17.0.6
0: : Relay address to use: ::1
0: : =====================================================
0: : Total: 2 relay addresses discovered
0: : =====================================================
0: : Cannot create pid file: /var/run/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : Wait for relay ports initialization...
0: :   relay 172.17.0.6 initialization...
0: :   relay 172.17.0.6 initialization done
0: :   relay ::1 initialization...
0: :   relay ::1 initialization done
0: : Relay ports initialization done

docker run generate / start.sh: fails on systems running docker as non-root user

As per here: https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user my docker instance is set up to run as a non-root user. This is somewhat unusual but not uncommon. I'm pretty sure this is causing my attempts to run docker run -v /tmp/matrixdata:/data --rm -e SERVER_NAME=localhost -e REPORT_STATS=no avhost/docker-matrix:v1.9.1 generate (not my exact command, but you get the idea) to fail:

-=> generate turn config
/start.sh: line 14: /data/turnserver.conf: Permission denied
/start.sh: line 15: /data/turnserver.conf: Permission denied
/start.sh: line 16: /data/turnserver.conf: Permission denied
/start.sh: line 17: /data/turnserver.conf: Permission denied
/start.sh: line 18: /data/turnserver.conf: Permission denied
/start.sh: line 19: /data/turnserver.conf: Permission denied
/start.sh: line 20: /data/turnserver.conf: Permission denied
/start.sh: line 21: /data/turnserver.conf: Permission denied
-=> generate synapse config
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 639, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 634, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 319, in setup
    "Synapse Homeserver", config_options
  File "/usr/local/lib/python3.7/dist-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.tmp'
Generating config file /data/homeserver.tmp
-=> configure some settings in homeserver.yaml
awk: cannot open /data/homeserver.tmp (No such file or directory)
mv: cannot create regular file '/data/homeserver.tmp': Permission denied
mv: cannot stat '/data/homeserver.tmp': No such file or directory

I've tried running docker run -v /opt/appdata/matrix/synapse:/data... using sudo, without and have also tried this with previous docker builds (1.9.0 and 1.7.3) and the issue persists.

I'm pretty sure this is similar to #14 and #8 but comments in those issues don't indicate how users have resolved the problem. As per https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue I've also tried to reboot my system, restart docker, switch around group membership and shift directory permissions on /opt/appdata/matrix/*.

Has anyone resolved this before who can comment? Working with Debian 4.9.130-2.

Can't start the server/Generate Config

docker run -v ~/matrix-mmf:/data:rw --rm -e SERVER_NAME={domain} -e REPORT_STATS=no -e MATRIX_UID=1001 -e MATRIX_GID=1001 avhost/docker-matrix:v1.59.1 generate

Running that, gives me this:

-=> generate turn config
/start.sh: line 14: /data/turnserver.conf: Permission denied
/start.sh: line 15: /data/turnserver.conf: Permission denied
/start.sh: line 16: /data/turnserver.conf: Permission denied
/start.sh: line 17: /data/turnserver.conf: Permission denied
/start.sh: line 18: /data/turnserver.conf: Permission denied
/start.sh: line 19: /data/turnserver.conf: Permission denied
/start.sh: line 20: /data/turnserver.conf: Permission denied
-=> generate synapse config
/start.sh: line 21: /data/turnserver.conf: Permission denied
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/dist-packages/synapse/app/homeserver.py", line 460, in
main()
File "/usr/local/lib/python3.10/dist-packages/synapse/app/homeserver.py", line 450, in main
hs = setup(sys.argv[1:])
File "/usr/local/lib/python3.10/dist-packages/synapse/app/homeserver.py", line 326, in setup
config = HomeServerConfig.load_or_generate_config(
File "/usr/local/lib/python3.10/dist-packages/synapse/config/_base.py", line 666, in load_or_generate_config
with open(config_path, "w") as config_file:
PermissionError: [Errno 13] Permission denied: '/data/homeserver.tmp'
Generating config file /data/homeserver.tmp
-=> configure some settings in homeserver.yaml
awk: cannot open /data/homeserver.tmp (No such file or directory)
mv: cannot create regular file '/data/homeserver.tmp': Permission denied
mv: cannot stat '/data/homeserver.tmp': No such file or directory
-=> configure some settings in {domain}.log.config
sed: can't read /data/{domain}.log.config: No such file or directory

-=> you have to review the generated configuration file homeserver.yaml

ID 1001 is for the ade account.

Fatal Python Error after Upgrade to 1.49.1

Fatal Python error: GC object already tracked


Current thread 0x000014f0476d8740 (most recent call first):
File "/usr/local/lib/python3.7/dist-packages/attr/validators.py", line 356 in __call__
File "<attrs generated init synapse.types.RoomStreamToken>", line 12 in __init__
File "/usr/local/lib/python3.7/dist-packages/synapse/types.py", line 679 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/local/lib/python3.7/dist-packages/synapse/events/__init__.py", line 39 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1035 in _handle_fromlist
File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 28 in <module>
File "/usr/lib/python3.7/runpy.py", line 85 in _run_code
File "/usr/lib/python3.7/runpy.py", line 193 in _run_module_as_main

No homeserver.log is ever written.
Reverted to 1.49.0 for now which works just fine.

v1.35.1: Homeserver won't start

After updating to v1.35.1 the homeserver won't start up anymore. docker logs reveal the following:

/usr/bin/python3: Error while finding module specification for 'synapse.app.homeserver' (ModuleNotFoundError: No module named 'synapse')

Docker does not like at all such a big port range as -p 49152-65535

unless I missed something, on my setup, the "docker run -p 49152-65535:49152-65535 ", as decribed in the Example.configs doc file, takes ages, since docker insert one pair of iptable rules for each port.

I'm using docker-ce 18.03 on a debian stretch host, and dockerd is ruinning with the --userland-proxy=false option.

Is there a know trick for this?

Running the image with "generate" argument yields invalid yaml in <servername>.log.config file

filename key needs to be indented:

version: 1

formatters:
    precise:
        format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'

filters:
    context:
        (): synapse.util.logcontext.LoggingContextFilter
        request: ""

handlers:
    file:
        class: logging.handlers.RotatingFileHandler
        formatter: precise
    filename: /data/homeserver.log
        maxBytes: 104857600
        backupCount: 10
        filters: [context]
    console:
        class: logging.StreamHandler
        formatter: precise
        filters: [context]

loggers:
    synapse:
        level: INFO

    synapse.storage.SQL:
        # beware: increasing this to DEBUG will make synapse log sensitive
        # information such as access tokens.
        level: INFO

root:
    level: INFO
    handlers: [file, console]
/tmp/data/localhost.log.config (END)

LD_PRELOAD env variable

Is it possible to use the LD_PRELOAD env variable to help with RAM usage? Well, I know it possible. I mean for this container.

Here is the description from the readme:
https://github.com/matrix-org/synapse/blob/master/README.rst#id46

Looks like it requires the libjemalloc1 library and a pointer to it. I'm not sure it is included in this docker container or where it would be located.

Btw: thanks for the great container.

synapse newer than 1.64 doesn't start

I start synapse using avhost/docker-matrix as a service:

docker service create \
    --name synapse \
    --publish published=3478,target=3478,protocol=tcp \
    --publish published=3478,target=3478,protocol=udp \
    --publish published=8448,target=8448 \
    --mount type=volume,src=synapse-data,dst=/data \
    --mount type=bind,src=/etc/localtime,dst=/etc/localtime,ro \
    --mount type=volume,src=certbot-etc-letsencrypt,dst=/etc/letsencrypt,ro \
    --env REPORT_STATS=no \
    --env SERVER_NAME="MYDOMAIN.TLD" \
    --network matrix \
    avhost/docker-matrix:v1.68.0

Any image newer than 1.64.0 doesn't seem to try to start synapse:

# docker logs synapse.1.mdk3la8v8urmihcrlnz3umkyf
-=> start turn
-=> start matrix
Cannot create pid file: /var/run/turnserver.pid: Permission denied
Cannot create relay thread
: Operation not permitted
0: : Black listing: 172.16.0.0-172.31.255.255
0: : log file opened: /data/turnserver_2022-10-17.log
0: : 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.2 'dan Eider'
0: : 
Max number of open files/sockets allowed for this process: 1048576
0: : 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 524000 (approximately)
0: : 

==== Show him the instruments, Practical Frost: ====

0: : TLS supported
0: : DTLS supported
0: : DTLS 1.2 supported
0: : TURN/STUN ALPN supported
0: : Third-party authorization (oAuth) supported
0: : GCM (AEAD) supported
0: : OpenSSL compile-time version: OpenSSL 3.0.3 3 May 2022 (0x30000030)
0: : 
0: : SQLite supported, default database location is /var/lib/turn/turndb
0: : Redis supported
0: : PostgreSQL supported
0: : MySQL supported
0: : MongoDB is not supported
0: : 
0: : Default Net Engine version: 3 (UDP thread per CPU core)

=====================================================

0: : Domain name: 
0: : Default realm: turn.MYDOMAIN.TLD
0: : 
CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the same time.
Be aware that you could not mix the username/password and the shared secret based auth methods. 
Shared secret overrides username/password based auth method. Check your configuration!
0: : SSL23: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : SSL23: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : TLS1.0: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : TLS1.0: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : TLS1.1: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : TLS1.1: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : TLS1.2: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : TLS1.2: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : TLS cipher suite: HIGH
0: : DTLS: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : DTLS: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : DTLS1.2: Certificate file found: /etc/letsencrypt/live/MYDOMAIN.TLD/fullchain.pem
0: : DTLS1.2: Private key file found: /etc/letsencrypt/live/MYDOMAIN.TLD/privkey.pem
0: : DTLS cipher suite: HIGH
0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering listener addresses: =========
0: : Listener address to use: 127.0.0.1
0: : Listener address to use: 10.255.0.30
0: : Listener address to use: 172.18.0.7
0: : Listener address to use: 10.0.1.34
0: : =====================================================
0: : Total: 3 'real' addresses discovered
0: : =====================================================
0: : NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: : ===========Discovering relay addresses: =============
0: : Relay address to use: 10.255.0.30
0: : Relay address to use: 172.18.0.7
0: : Relay address to use: 10.0.1.34
0: : =====================================================
0: : Total: 3 relay addresses discovered
0: : =====================================================
0: : Cannot create pid file: /var/run/turnserver.pid
0: : pid file created: /var/tmp/turnserver.pid
0: : IO method (main listener thread): epoll (with changelist)
0: : Wait for relay ports initialization...
0: :   relay 10.255.0.30 initialization...
0: :   relay 10.255.0.30 initialization done
0: :   relay 172.18.0.7 initialization...
0: :   relay 172.18.0.7 initialization done
0: :   relay 10.0.1.34 initialization...
0: :   relay 10.0.1.34 initialization done
0: : Relay ports initialization done

1.64.0 works perfectly fine.

Switch to postgres

The community favors postgres as the database-backend of synapse for performance reasons. Why does this image not use postgres?

ldap module no longer present

It appears to be since 0.34.1.1 as I reverted back to v0.34.0 and all is well.

No handlers could be found for logger "synapse.config.server"
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 576, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 571, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 312, in setup
    config_options,
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 356, in load_or_generate_config
    generate_keys=generate_keys,
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 402, in read_config_files
    self.invoke_all("read_config", config)
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 146, in invoke_all
    results.append(getattr(cls, name)(self, *args, **kargs))
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/password_auth_providers.py", line 48, in read_config
    "config": provider['config'],
  File "/usr/local/lib/python2.7/dist-packages/synapse/util/module_loader.py", line 32, in load_module
    module = importlib.import_module(module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named ldap_auth_provider

Matrix group and user are already created in docker compile

Hello,

I am a bit new to docker but I am having a bit of an issue with this image on Unraid.

I spin up the docker image with the following... (UID/GID obfuscated)

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='matrix' --net='bridge' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'SERVER_NAME'='matrix' -e 'REPORT_STATS'='no' -e 'SYNAPSE_CACHE_FACTOR'='0.5' -e 'MATRIX_UID'='99' -e 'MATRIX_GID'='100' -p '8008:8008/tcp' -p '8448:8448/tcp' -p '3478:3478/tcp' -p '3478:3478/udp' -v '/mnt/user/appdata/matrix/':'/data':'rw' --user 0:0 'avhost/docker-matrix:latest' start

From what I have read on the docs this should spawn the instance using the root user and then configure the user "matrix" to 99 and the group "matrix" to 100.

The actual result is that the docker container spins up as root and the matrix UID:GID is the default of 991:991

In reviewing the logs when it tries to run the if statement based off the $EUID == 0, it tried to create a new group with the provided GID then uses &&'s to configure the user and folders. This fails.

I believe the issue is due to the group being created in the docker compose file and this causes the command to fail. Because the rest of the commands are based off a positive conditional AND they never run.

I would suggest modifying them with the following lines (85-86 and 109-110).

groupadd -r -g $MATRIX_GID matrix || groupmod -g $MATRIX_GID matrix \

&& useradd -r -d /data -M -u $MATRIX_UID -g matrix matrix || usermod -u $MATRIX_UID matrix \

There is probably a better option that I have no clue about due to my newness with docker but this is what I could figure out on my own.

Server not listeningon IP4

Hey i just fired up the container with the basicly no changes but i cant get the container listening to ip4:
docker run -v /volume1/homes/USER/matrix:/data --rm --user 1026:100 -e SERVER_NAME=matrix.xxx.com -e REPORT_STATS=no avhost/docker-matrix:latest generate

docker run -d --user 1026:100 -p 8448:8448 -p 8008:8008 -p 3478:3478 -v /volume1/homes/USER/matrix:/data avhost/docker-matrix:latest start

docker Log:

2021-01-28 15:30:27 | stdout | -=>   start matrix
2021-01-28   15:30:27 | stdout | -=> start turn
2021-01-28   15:30:27 | stderr | Cannot   create pid file: /var/run/turnserver.pid: Permission denied
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported
2021-01-28 15:39:36 | stderr | socket:   Protocol not supported
2021-01-28   15:39:36 | stderr | socket: Protocol not supported

homeserver.log:

2021-01-28 15:39:38,345 - root - 319 - WARNING - None - ***** STARTING SERVER *****
2021-01-28 15:39:38,345 - root - 320 - WARNING - None - Server /usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py version 1.25.0
2021-01-28 15:39:38,348 - twisted - 254 - ERROR - None - Traceback (most recent call last):
2021-01-28 15:39:38,348 - twisted - 254 - ERROR - None -   File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
2021-01-28 15:39:38,348 - twisted - 254 - ERROR - None -     "__main__", mod_spec)
2021-01-28 15:39:38,348 - twisted - 254 - ERROR - None -   File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
2021-01-28 15:39:38,348 - twisted - 254 - ERROR - None -     exec(code, run_globals)
2021-01-28 15:39:38,349 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 552, in <module>
2021-01-28 15:39:38,349 - twisted - 254 - ERROR - None -     main()
2021-01-28 15:39:38,349 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 547, in main
2021-01-28 15:39:38,349 - twisted - 254 - ERROR - None -     hs = setup(sys.argv[1:])
2021-01-28 15:39:38,349 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 374, in setup
2021-01-28 15:39:38,350 - twisted - 254 - ERROR - None -     hs.setup()
2021-01-28 15:39:38,350 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/server.py", line 262, in setup
2021-01-28 15:39:38,350 - twisted - 254 - ERROR - None -     self.datastores = Databases(self.DATASTORE_CLASS, self)
2021-01-28 15:39:38,350 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/storage/databases/__init__.py", line 49, in __init__
2021-01-28 15:39:38,350 - twisted - 254 - ERROR - None -     with make_conn(database_config, engine, "startup") as db_conn:
2021-01-28 15:39:38,351 - twisted - 254 - ERROR - None -   File "/usr/local/lib/python3.7/dist-packages/synapse/storage/database.py", line 122, in make_conn
2021-01-28 15:39:38,351 - twisted - 254 - ERROR - None -     native_db_conn = engine.module.connect(**db_params)
2021-01-28 15:39:38,351 - twisted - 254 - ERROR - None - sqlite3.OperationalError: unable to open database file
2021-01-28 15:39:38,345 - root - 321 - INFO - None - Server hostname: matrix.XXX.com2021-01-28 15:39:38,345 - root - 322 - INFO - None - Instance name: master
2021-01-28 15:39:38,345 - synapse.app.homeserver - 371 - INFO - None - Setting up server
2021-01-28 15:39:38,345 - synapse.server - 260 - INFO - None - Setting up.

netstat:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp6       0      0 :::8008                 :::*                    LISTEN      29945/docker-proxy
tcp6       0      0 :::3478                 :::*                    LISTEN      29965/docker-proxy
tcp6       0      0 :::8448                 :::*                    LISTEN      29925/docker-proxy

Any idea what might be wrong?

v1.174.0 fails with ModuleNotFoundError

Hi,

the latest container doesn't start, i get

Error while finding module specification for 'synapse.app.homeserver' (ModuleNotFoundError: No module named 'synapse.app'

It works fine with v1.173.0 and I assume some packaging error here.

How to configure for email sending?

Although entering the email during registration is optional, synapse provides it for password recovering and similar tasks. However, i am currently unable to configure the dockerized synapse to use emails. Per default, it has no knowledge about any SMTP servers to use.
I am not sure if this is a docker problem or a core synapse problem, but i am assuming that the email settings in around line 572 in the homeserver.yaml are the right place to configure an external SMTP connection. However, this fails due to no templates being available. Could it be that the docker run ... generate just doesn't populate the right directories with email templates, or is synapse just not providing templates on its own?

Healthcheck for docker-compose

i had the problem with docker compose, that the Postgres DB wasnt ready early enough sometimes and the synapse docker failed boot due to the not reachable DB.
The usual way of creating a simple healtcheck with a curl-command wasnt working, because curl isn't installed in the docker-matrix image.

I wrote a one liner in python to do the healtcheck:

python3 -c "import urllib.request;exec('try:\n\turllib.request.urlopen(\'http://127.0.0.1:8008\')\nexcept:\n\texit(1)')"

With that we can persuade the matrix-docker container to retry to connect to the db and the database has some more time to bootup

This is a simplified extract from my docker-compose file as an example

version: "2.1"
services:
  postgres:
    image: postgres:11
    restart: unless-stopped
    networks:
      - default
    volumes:
      -/whatever/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=synapse
      - POSTGRES_PASSWORD=xxxx
      - POSTGRES_USER=synapse
    healthcheck:
      test: "pg_isready -h localhost -p 5432 -q -U postgres"
      interval: 3s
      timeout: 5s
      retries: 5

  synapse:
    image: avhost/docker-matrix:v1.1.0
    restart: on-failure
    depends_on:
      - postgres
    healthcheck:
      test: python3 -c "import urllib.request;exec('try:\n\turllib.request.urlopen(\'http://127.0.0.1:8008\')\nexcept:\n\texit(1)')"
      interval: 1m
      timeout: 10s
      retries: 3
    networks:
      - web
      - default
[...]

This is just a documentation issue, if somebody runs in the same problem

sqlite error with turn server

hi,

the images works well thank for that, but the turn server reports:

0: ERROR: Cannot open SQLite DB connection: </var/lib/turn/turndb>, runtime error:
unable to open database file
(If your intention is to use an SQLite database for the TURN server, then
check and fix, if necessary, the effective permissions of the TURN server
process and of the DB directory and then re-start the TURN server)

is it possible to do a mkdir and chmod 777 of /var/lib/turn/
to get this away?

thanks Martin

v0.34.1.1 missing bleach module

It looks like the latest version also breaks if you have email configuration setup with the following error:

-=> start turn
The riot web client is now handled via silvio/matrix-riot-docker
-=> start matrix
2019-01-14 09:15:50,878 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2019-01-14 09:15:50,879 INFO Included extra file "/conf/supervisord-matrix.conf" during parsing
2019-01-14 09:15:50,879 INFO Included extra file "/conf/supervisord-turnserver.conf" during parsing
2019-01-14 09:15:50,898 INFO supervisord started with pid 1
2019-01-14 09:15:51,610 INFO spawned: 'matrix' with pid 22
2019-01-14 09:15:51,622 INFO spawned: 'turnserver' with pid 23
2019-01-14 09:15:51,623 INFO reaped unknown pid 17
2019-01-14 09:15:52,625 INFO success: matrix entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-01-14 09:15:52,632 INFO success: turnserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 576, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 571, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 312, in setup
    config_options,
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 356, in load_or_generate_config
    generate_keys=generate_keys,
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 402, in read_config_files
    self.invoke_all("read_config", config)
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 146, in invoke_all
    results.append(getattr(cls, name)(self, *args, **kargs))
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/emailconfig.py", line 40, in read_config
    import bleach
ImportError: No module named bleach
2019-01-14 09:15:55,935 INFO exited: matrix (exit status 1; not expected)

If I roll back to v0.34.0 everything launches correctly.

Support for power architecture

Hi,

I was able to build and run the docker-matrix container on power successfully with some minor changes to the Dockerfile. Will you be willing to support power architecture ?

Track latest stable release as tag

Hello,

thanks for the nice and convenient matrix-images you provide. I have one suggestion for them. In README.MD, you write that Please make sure to use our tagged docker images and not the latest one.. While this is true, it’d be great to have a tag that follows the latest stable version — let’s call it production, stable, or whatever. This would enable users to who automatically update all their docker images e.g. using https://github.com/circa10a/ouroboros or https://github.com/v2tec/watchtower to enter that tag in their docker-compose files and still follow the latest stable releases and build. This can be useful, as seen with the current release, which contains urgent security fixes ….

Thanks & Best,
-Dario

Unable to listen on port 8008

I've finally got Synapse to connect to my postgresql server running on the host, but now it throws an error when it tries to listen to port 8008:

2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  - Traceback (most recent call last):
2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1361, in startListening
2021-01-04 18:44:10,089 - twisted - 254 - ERROR -  -     skt.bind(addr)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - OSError: [Errno 99] Cannot assign requested address
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - 
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - During handling of the above exception, another exception occurred:
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - 
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  - Traceback (most recent call last):
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 278, in start
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     hs.start_listening(listeners)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 298, in start_listening
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     self._listening_services.extend(self._listener_http(config, listener))
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 160, in _listener_http
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     reactor=self.get_reactor(),
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 169, in listen_tcp
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -     check_bind_error(e, address, bind_addresses)
2021-01-04 18:44:10,090 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/__init__.py", line 51, in check_bind_error
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     raise e
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 167, in listen_tcp
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     r.append(reactor.listenTCP(port, factory, backlog, address))
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 495, in listenTCP
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     p.startListening()
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -   File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1363, in startListening
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  -     raise CannotListenError(self.interface, self.port, le)
2021-01-04 18:44:10,091 - twisted - 254 - ERROR -  - twisted.internet.error.CannotListenError: Couldn't listen on ::1:8008: [Errno 99] Cannot assign requested address.
2021-01-04 18:44:10,115 - twisted - 254 - CRITICAL -  - Unhandled error in Deferred:
2021-01-04 18:44:10,116 - twisted - 254 - CRITICAL -  - 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1361, in startListening
    skt.bind(addr)
OSError: [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 278, in start
    hs.start_listening(listeners)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 298, in start_listening
    self._listening_services.extend(self._listener_http(config, listener))
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 160, in _listener_http
    reactor=self.get_reactor(),
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 169, in listen_tcp
    check_bind_error(e, address, bind_addresses)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/__init__.py", line 51, in check_bind_error
    raise e
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 167, in listen_tcp
    r.append(reactor.listenTCP(port, factory, backlog, address))
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 495, in listenTCP
    p.startListening()
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 1363, in startListening
    raise CannotListenError(self.interface, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on ::1:8008: [Errno 99] Cannot assign requested address.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/homeserver.py", line 429, in start
    _base.start(hs, config.listeners)
  File "/usr/local/lib/python3.7/dist-packages/synapse/app/_base.py", line 308, in start
    sys.exit(1)
SystemExit: 1
2021-01-04 18:44:10,139 - twisted - 254 - INFO -  - Main loop terminated.

I've read this is probably due to some ipv6 issue, but is this something I can fix or something that needs to be fixed in the config of the docker image itself?

I started the image with this command:

docker run -v /home/matrix/data:/data --restart unless-stopped --user 4018:4018 -p 8448:8448 -p 8008:8008 -p 3478:3478 -e SERVER_NAME=elevenways.be -e REPORT_STATS=no --add-host=host.docker.internal:host-gateway avhost/docker-matrix start

1.3.1 image broken?

when trying to update to the newest avhost/docker-matrix:v1.3.1 image, it fails to start synapse
logs outputs:

-=> start turn
-=> start matrix
Cannot create pid file: /var/run/turnserver.pid: Permission denied

Unable to find template file /usr/local/lib/python3.5/dist-packages/synapse/res/templates/password_reset.html

Is that reproducible for somebody else?

/start.sh: line 14: /data/turnserver.conf: Permission denied

When running the example command

# docker run -v /tmp/data:/data --rm -e SERVER_NAME=localhost -e REPORT_STATS=no avhost/docker-matrix:v0.28.1 generate

It outputs

-=> generate turn config
/start.sh: line 14: /data/turnserver.conf: Permission denied
/start.sh: line 15: /data/turnserver.conf: Permission denied
/start.sh: line 16: /data/turnserver.conf: Permission denied
/start.sh: line 17: /data/turnserver.conf: Permission denied
/start.sh: line 18: /data/turnserver.conf: Permission denied
/start.sh: line 19: /data/turnserver.conf: Permission denied
/start.sh: line 20: /data/turnserver.conf: Permission denied
/start.sh: line 21: /data/turnserver.conf: Permission denied
-=> generate synapse config
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 511, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 506, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 287, in setup
    config_options,
  File "/usr/local/lib/python2.7/dist-packages/synapse/config/_base.py", line 284, in load_or_generate_config
    with open(config_path, "wb") as config_file:
IOError: [Errno 13] Permission denied: '/data/homeserver.tmp'
-=> configure some settings in homeserver.yaml
awk: cannot open /data/homeserver.tmp (No such file or directory)
mv: cannot create regular file '/data/homeserver.tmp': Permission denied
mv: cannot stat '/data/homeserver.tmp': No such file or directory
-=> configure some settings in localhost.log.config
sed: can't read /data/localhost.log.config: No such file or directory

-=> you have to review the generated configuration file homeserver.yaml

OS is Fedora 28

python3: can't open file 'synapse.app.homeserver'

Starting from version 0.99.4,

There is an error by launching the command generate

docker run -v /tmp/data:/data --rm \
  -e SERVER_NAME=example.com \
  -e REPORT_STATS=yes \
  avhost/docker-matrix:v0.99.4 \
  generate
-=> generate turn config
-=> generate synapse config
python3: can't open file 'synapse.app.homeserver': [Errno 2] No such file or directory
-=> configure some settings in homeserver.yaml
awk: cannot open /data/homeserver.tmp (No such file or directory)
-=> configure some settings in example.com.log.config
sed: can't read /data/example.com.log.config: No such file or directory

-=> you have to review the generated configuration file homeserver.yaml

Error on container boot

Morning, so I had some issues getting this up and running. I have fixed most of said issues but I am not sure about this one. I am not sure what the permission issue is with the turnserver or how to correct it, unless that is normal. But also the error during initialization has me stumped right now. Anyone know how to fix it or even where I should start?

Added my compose file at the end in case the error is there.

WARN[0000] /home/riffy/docker/matrix-synapse/compose.yaml: version is obsolete
[+] Running 0/0
⠋ Container matrix-synapse-docker-matrix-1 Recreated 0.1s
Attaching to docker-matrix-1
docker-matrix-1 | -=> start turn
docker-matrix-1 | -=> start matrix
docker-matrix-1 | Cannot create pid file: /var/run/turnserver.pid: Permission denied
docker-matrix-1 | This server is configured to use 'matrix.org' as its trusted key server via the
docker-matrix-1 | 'trusted_key_servers' config option. 'matrix.org' is a good choice for a key
docker-matrix-1 | server since it is long-lived, stable and trusted. However, some admins may
docker-matrix-1 | wish to use another server for this purpose.
docker-matrix-1 |
docker-matrix-1 | To suppress this warning and continue using 'matrix.org', admins should set
docker-matrix-1 | 'suppress_key_server_warning' to 'true' in homeserver.yaml.
docker-matrix-1 | --------------------------------------------------------------------------------
docker-matrix-1 | **********************************************************************************
docker-matrix-1 | Error during initialisation:
docker-matrix-1 | Traceback (most recent call last):
docker-matrix-1 | File "/matrix/venv/lib/python3.11/site-packages/synapse/app/homeserver.py", line 359, in setup
docker-matrix-1 | hs.setup()
docker-matrix-1 | File "/matrix/venv/lib/python3.11/site-packages/synapse/server.py", line 347, in setup
docker-matrix-1 | self.datastores = Databases(self.DATASTORE_CLASS, self)
docker-matrix-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-matrix-1 | File "/matrix/venv/lib/python3.11/site-packages/synapse/storage/databases/init.py", line 72, in init
docker-matrix-1 | with make_conn(database_config, engine, "startup") as db_conn:
docker-matrix-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-matrix-1 | File "/matrix/venv/lib/python3.11/site-packages/synapse/storage/database.py", line 165, in make_conn
docker-matrix-1 | native_db_conn = engine.module.connect(**db_params)
docker-matrix-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-matrix-1 | sqlite3.OperationalError: unable to open database file
docker-matrix-1 |
docker-matrix-1 | There may be more information in the logs.
docker-matrix-1 | **********************************************************************************
Gracefully stopping... (press Ctrl+C again to force)
[+] Stopping 1/1
✔ Container matrix-synapse-docker-matrix-1 Stopped 21.1s
canceled

version: "3.3"
services:
docker-matrix:
user: 991:991
ports:
- 8448:8448
- 8008:8008
- 3478:3478
- 3479:3479
- 5350:5350
- 5349:5349
- 49152-49300:49152-49300/udp
volumes:
- ./config:/data
- ./media:/media_store
image: avhost/docker-matrix:latest
command: start
networks: {}

new docker image is broken

The image tagged v0.26.0 still works.

The new docker image fails for me stating:
You need a conffile /data/riot.im.conf in you conf folder

Making an empty file still doesn't start synapse, but the log says:

-=> riot.im options: http-server 
Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8080
  http://172.17.0.2:8080
Hit CTRL-C to stop the server

It looks like somehow the riot image got pushed to the docker hub.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.