Docker Community Forums

Share and learn in the Docker community.

Configuration file contains errors

Hey there
Situation: I want to set up two Postgres DB in docker-compose with different ports (for two applications).
I write some .yml:

       image: some_image
         - ./configs/postgresql_1.conf:/etc/postgresql/postgresql_1.conf
       command:  postgres -c config_file=/etc/postgresql/postgresql_1.conf
       image: some_image
         - ./configs/postgresql_2.conf:/etc/postgresql/postgresql_2.conf
       command:  postgres -c config_file=/etc/postgresql/postgresql_2.conf

My config file has two string:
listen_adress = “localhost”
port = 15432
listen_adress = “localhost”
port = 5432
And when I start command docker-compose up db1 I see this error:

LOG:  input in flex scanner failed at file "/etc/postgresql/postgresql_1.conf" line 1
FATAL:  configuration file "/etc/postgresql/postgresql_1.conf" contains errors

Please, tell me, how can I fix it?

Im not a big postgres guy, but i belive it sould be “listen_addresses” and not “listen_adress”

1 Like

I agree with @terpz. The parameter would be wrong, but I think this is not the issue yet. The error message indicates that the configuration file is probably not a file. Search always for the error message. In this case “postgresql input in flex scanner failed”

In your case it could happen if you use a wrong source path for the configuration file so docker creates a folder and mounts that.

I tried it and I got the same message.

1 Like