"Db does not exist" error after http request to musicbrainz server running on AWS ECS container

I have deployed musicbrainz server and the other 5 containers as AWS ECS containers. Server starts and db is setup with collections. The final log at this stage is initdb.pl successful.
When I make a request to the server, it crashes with the error dbname does not exist.
I have looked into the db container and I can see tables. I can see user permissions for musicBrainz user for musicbrainz_db database. I am keen to know what might be the problem and how to fix this if anyone knows.

Link to a post I made on another thead/forum: https://tickets.metabrainz.org/browse/MBVM-77