Very late reply to this, but if anyone else runs into this issue here's the explanation + solution I came up with:
That error is being thrown when szurubooru-api tries reading your POSTGRES_HOST IP. szurubooru expects database URLs in a specific format, as specified in the repo's config.yaml.dist:
## usage: schema://user:password@host:port/database_name
## example: postgres://szuru:dog@localhost:5432/szuru_test
Once you provide the postgres address in the specified format, that error should go away.