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

Startup failure: dendrite_naffka does not exist #1687

Closed TobiTenno closed 3 years ago

TobiTenno commented 3 years ago

Background information

Description

Failing to start dendrite monolith, naffka database isn't created

Steps to reproduce

1) go get github.com/matrix-org/dendrite/cmd/generate-keys 1) go build github.com/matrix-org/dendrite/cmd/generate-keys 1) a. create docker b. create docker/config c. cd docker/config d. go run github.com/matrix-org/dendrite/cmd/generate-keys --private-key=matrix_key.pem --tls-cert=server.crt --tls-key=server.key

1) clone dendrite 1) copy dendrite-config.yaml to docker/config/dendrite.yaml 1) copy docker-compose.deps.yml to docker/docker-compose.deps.yml 1) copy docker-compose.monolith.yml to docker/docker-compose.monolith.yml 1) sed 's/use_naffka: false/use_naffka: true/g' dendrite.yaml > dendrite.naffka.yaml 1) mv dendrite.naffka.yaml dendrite.yaml 1) a. cd docker b. run docker-compose -f docker-compose.deps.yml up -d postgres applicable logs:

  postgres_1   | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/20-create_db.sh
  postgres_1   | /usr/local/bin/docker-entrypoint.sh: line 160: /docker-entrypoint-initdb.d/20-create_db.sh: Is a directory

11) run docker-compose -f docker-compose.monolith.yml up -d applicable logs:

  monolith_1  | time="2021-01-06T22:28:53.904980100Z" level=info msg="Dendrite version 0.3.4" func="NewBaseDendrite\n\t" file=" [github.com/matrix-org/dendrite/setup/base.go:102]"
  monolith_1  | time="2021-01-06T22:28:53.907228800Z" level=panic msg="failed to connect to accounts db" func="CreateAccountsDB\n\t" file=" [github.com/matrix-org/dendrite/setup/base.go:243]" error="pq: database \"dendrite_account\" does not exist"

sh scripts that I'm using to test: gist

Expectation: server should start

Opened a new issue as I couldn't reopen #1534

aaronraimist commented 3 years ago

I may be blind but I don't see you creating the database in any of these steps. You have to create the database yourself and set it up in the config file. https://github.com/matrix-org/dendrite/blob/master/docs/INSTALL.md#postgresql-database-setup

TobiTenno commented 3 years ago

That's not what this says

TobiTenno commented 3 years ago

@aaronraimist are there instructions on manually constructing the database in the docker setup? i'm just not seeing any. i'm happy to add them to my script and test with that if there are

TobiTenno commented 3 years ago

Best I can tell, the issue is that I'm not working directly in the dendrite/build/docker folder, as it seems that there's an assumption that the user copies over the create_db.sh file, so I'll probably go submit a doc update to mention either symlinking or changing the compose file to the location of the sh script in the repository.

TobiTenno commented 3 years ago

yeah, i've updated my script. what i was missing was copying the create_db.sh over into the volume location.