AVENTER-UG / docker-matrix

docker image for matrix.org
https://riot.im/app/#/room/#dockermatrix:matrix.aventer.biz
GNU General Public License v2.0
93 stars 19 forks source link

Server not listeningon IP4 #51

Closed oschmidteu closed 3 years ago

oschmidteu commented 3 years ago

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?

andreaspeters commented 3 years ago

Hi @oschmidteu, it's quite usual that if the port binds to every interface, netstat only show it as tcp6. To prove it, you should get a response if you try it with curl.

curl 127.0.0.1:8008
oschmidteu commented 3 years ago

Hey @andreaspeters thanks for the speedy reply. The output is more or less the same ;) root@DSM:~# curl 127.0.0.1:8008 curl: (7) Failed to connect to 127.0.0.1 port 8008: Connection refused

andreaspeters commented 3 years ago

Your welcome. Thats not what I expected to see. :-) Can u show us the generated homeserver.yml? These failure "sqlite3.OperationalError: unable to open database " should also not be there. Can u tell us which environment u are using? Just a normal linux (centos)?

andreaspeters commented 3 years ago

ok, I had a look into a new generated homeserver.yml at my system. I already found two issues:

1) In line 246: Change bind_address to bind_addresses: ['0.0.0.0'] 2) In line 759: Change the database path to: database: /data/homeserver.db

After that, my netstat looks like this:

sudo netstat -tulpen | grep dock
tcp6       0      0 :::8008                 :::*                    LISTEN      0          1043819    44392/docker-proxy  

But a curl is working:

curl 127.0.0.1:8008 

<html>
    <head>
        <meta http-equiv="refresh" content="0;URL=/_matrix/static">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <a href="/_matrix/static">click here</a>
    </body>
</html>
oschmidteu commented 3 years ago

Oh yeah i should have pointet to the sqlite error, sorry. Well line 246 and 759 made the difference. image

Thanks a lot for the awesome work and your help.

andreaspeters commented 3 years ago

Your welcome and thanks for your nice feedback. :smiley: