GispoCoding / tarmo

Tarmo - Tampere Mobilemap
https://ulkoilutampereenseutu.fi/
MIT License
11 stars 3 forks source link

pg_tileserv: database tarmo does not exist #46

Closed mvaaltola closed 2 years ago

mvaaltola commented 2 years ago

Following the readme, running docker-compose -f docker-compose.dev.yml up -d results in:

pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="pg_tileserv latest"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="Run with --help parameter for commandline options"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="Using database connection info from environment variable DATABASE_URL"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="Serving HTTP  at http://0.0.0.0:7800/"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="Serving HTTPS at http://0.0.0.0:7801/"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=info msg="Using CoordinateSystem.SRID 3857 with bounds [-2.00375083427892e+07, -2.00375083427892e+07, 2.00375083427892e+07, 2.00375083427892e+07]"
pg_tileserv_1   | time="2022-01-27T07:58:16Z" level=fatal msg="failed to connect to `host=db user=postgres database=tarmo`: server error (FATAL: database \"tarmo\" does not exist (SQLSTATE 3D000))"

Also tried starting other services first before running pg_tileserv, but with the same results.

Perhaps some data import or schema initialisation step missing from the readme?

Joonalai commented 2 years ago

Ah, the pg_tileserv does not work in the beginning, since the db and user are not created. Run make test-create-db and after that make test-lipas to create and populate the db. And you are right, these instructions should be in the README.md

mvaaltola commented 2 years ago

Running make test-create-db results in:

10:15:30 $ make test-create-db
curl -XPOST "http://localhost:8081/2015-03-31/functions/function/invocations" -d '"event_type" : 1}'
{"errorMessage": "Unable to unmarshal input: Extra data: line 1 column 14 - line 1 column 18 (char 13 - 17)", "errorType": "Runtime.UnmarshalError", "stackTrace": []}⏎
Joonalai commented 2 years ago

There is a typo in the Makefile. It should be -d '{"event_type" : 1}'...

mvaaltola commented 2 years ago

That's fixed it. I'll close this after updating the makefile and readme.