matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

docker: db not exists #1517

Closed jtagcat closed 3 years ago

jtagcat commented 3 years ago
postgres_1   | FATAL:  database "dendrite_roomserver" does not exist
postgres_1   | FATAL:  database "dendrite_account" does not exist
postgres_1   | FATAL:  database "dendrite_signingkeyserver" does not exist
postgres_1   | FATAL:  database "dendrite_federationsender" does not exist
postgres_1   | FATAL:  database "dendrite_account" does not exist
postgres_1   | FATAL:  database "dendrite_keyserver" does not exist
postgres_1   | FATAL:  database "dendrite_mediaapi" does not exist
postgres_1   | FATAL:  database "dendrite_syncapi" does not exist
postgres_1   | FATAL:  database "dendrite_appservice" does not exist
postgres_1   | FATAL:  database "dendrite_account" does not exist

https://github.com/matrix-org/dendrite/blob/master/build/docker/README.md prob needs some additions other than the database note.

jtagcat commented 3 years ago

Can modify https://github.com/matrix-org/dendrite/blob/master/docs/INSTALL.md a bit:

for i in account device mediaapi syncapi roomserver signingkeyserver federationsender appservice e2ekey naffka keyserver; do
    docker-compose -f docker-compose.deps.yml exec -u postgres postgres createdb -h postgres -U dendrite -O dendrite dendrite_$i
done

Note: postgres asks pw for each command.

Edit: added dendrite_keyserver.

jtagcat commented 3 years ago

Would probably be smart to also map /var/lib/postgresql/data somewhere...

jtagcat commented 3 years ago

Probably want ports added to the monolith docker conf

jtagcat commented 3 years ago
$ ~/ndock/dendrite$ curl https://localhost:8448 -k
404 page not found
$ ~/ndock/dendrite$ curl https://localhost:8008 -k
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

stopping here, not going to do yet an another all-nighter for matrix

jtagcat commented 3 years ago

ref: https://github.com/matrix-org/dendrite/blob/master/docs/INSTALL.md ref: https://github.com/matrix-org/dendrite/blob/master/build/docker/README.md

jtagcat commented 3 years ago

update while closing tabs, seems that dbs can be auto-created with:

    environment:
      POSTGRES_DB: dendrite_something
jtagcat commented 3 years ago

there should be mentions of well known as well

jtagcat commented 3 years ago

note to docs editor (me?): example conf is dendrite-conf.yaml, expected is dendrite.yaml

neilalexander commented 3 years ago

I have fixed a couple of things in commits 2f57853 and 73bc28b1 — the create_db.sh script was not executable in Git, therefore it wasn't getting run properly when starting PostgreSQL. I've also added a mention of the /var/lib/postgresql/data mount in the sample Compose config.

jtagcat commented 3 years ago

Thanks, the issue is now in my backlog, feel free to close / split off / whatever.