Closed TobiTenno closed 3 years ago
For Docker, you will want to start from ./build/docker/config/dendrite-config.yaml
rather than ./dendrite-config.yaml
.
Sorry I wasn't more specific on that, I didn't notice another. I started from the docker one (per the docker docs)
I've corrected my repro steps
I'm a bit puzzled - the default Docker config states:
connection_string: postgresql://dendrite:itsasecret@postgres/dendrite_naffka?sslmode=disable
... and the create-db.sh
script for PostgreSQL as used by docker-compose.deps.yml
states:
for db in ... naffka; do
createdb -U dendrite -O dendrite dendrite_$db
done
So the template setup for Docker definitely creates dendrite_naffka
.
Are you sure you haven't tweaked either of these two things?
yup, i even redid my steps ensuring no extra alterations. do i possibly need to wait longer after startup of the db for it to finish?
I am seeing the following in the database startup:
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/20-create_db.sh
/usr/local/bin/docker-entrypoint.sh: line 159: /docker-entrypoint-initdb.d/20-create_db.sh: Is a directory
PostgreSQL Database directory appears to contain a database; Skipping initialization
After my last build I did delete the volume that was created to make sure there were no dangling artifacts from previous containers, but something seems to be sticking around.
Just fully recloned everything and set up following the repro steps I listed, same result.
I even tried redoing it where I ran the whole deps startup.
@TobiTenno please re-open this if you can reproduce this on the latest version. Please give repro steps again as I can't repro this from the steps outlined here.
@Kegsay I can't re-open, but here's the repro steps again:
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
1) 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
Background information
go version
: go1.15.2 linux/amd64Description
Failing to start dendrite monolith, naffka database isn't created
Steps to reproduce
generate-keys
script./config
./build/docker/config/dendrite-config.yaml
to./config/dendrite.yaml
use_naffka
docker-compose -f docker-compose.deps.yml up -d postgres
docker-compose -f docker-compose.monolith.yml up
Expectation: server should start
Logs