Postgres: [10.1] Container won't start: syntax error in configuration file

Created on 9 Feb 2018  路  3Comments  路  Source: docker-library/postgres

Hi,

I changed a couple lines in the configuration file. After an unexpected PC reboot, the container won't start with exit code 1 and below logs:

2018-02-09 02:14:35.833 GMT [1] LOG: syntax error in file "/var/lib/postgresql/data/postgresql.conf" line 672, near token """
2018-02-09 02:14:35.833 GMT [1] FATAL: configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors

I tried to commit the container to a new image and run that image with bash entrypoint, to access the configuration file. However the data directory "/var/lib/postgresql/data" is empty...
Anyway that I can still access the container and recover the data?

Any input is appreciated.

Most helpful comment

This should get you access to the /var/lib/postgresql/data/ folder from your postgres container:

$ # could use almost any image here, like one with vim or emacs installed
$ docker run -it --rm --volumes-from postgres-container postgres bash

All 3 comments

This should get you access to the /var/lib/postgresql/data/ folder from your postgres container:

$ # could use almost any image here, like one with vim or emacs installed
$ docker run -it --rm --volumes-from postgres-container postgres bash

@yosifkit It works. Thank you very much.

Glad it worked for you! :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiffingomez picture jiffingomez  路  4Comments

AndriiOmelianenko picture AndriiOmelianenko  路  4Comments

alexisrolland picture alexisrolland  路  3Comments

rap2hpoutre picture rap2hpoutre  路  3Comments

qwang07 picture qwang07  路  4Comments