No internet connection
  1. Home
  2. Issues

Problems starting rdb container - could not open configuration file "/var/lib/postgresql/conf/postgresql.conf"

By @mzafkismugi
    2021-03-11 19:02:53.310Z

    So I was following and when starting my rdb container dies with:

    rdb_1     | 2021-03-11 18:56:34.606 GMT [1] LOG:  could not open configuration file "/var/lib/postgresql/conf/postgresql.conf": No such file or directory
    rdb_1     | 2021-03-11 18:56:34.607 GMT [1] FATAL:  configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors

    much to my surprise the file does not exist within the container

    root@blog:/opt/talkyard# docker-compose run --rm rdb /bin/bash
    bash-4.4# ls /var/lib/postgresql/conf/postgresql.conf
    ls: /var/lib/postgresql/conf/postgresql.conf: No such file or directory

    I think that you wanted to include /var/lib/postgresql/data/postgresql.conf.orig instead of /var/lib/postgresql/conf/postgresql.conf

    Solved in post #5, click to view
    • 4 replies
    1. KajMagnus @KajMagnus2021-03-12 04:11:14.205Z2021-03-12 04:25:33.082Z

      Oh I didn't push some changes in talkyard-prod-one to the master Git branch yet. I'll have a look and then I'll push to master.

      If you don't want to wait: There's another branch, in the talkyard-prod-one repo that you can use instead: w-km2. "w" here means "work in progress" and "km" means "kajmagnus", that is, my work in progress branch number 2.

      There wil be another change included too — namely auto HTTPS certs via a Lua plugin (so you won't need to generate any cert manually via certbot, although you can do that instead, should you want to).


      The purpose with this change, was to make it simpler to edit & backup the PostgreSQL configuration (In particular, log levels) by keeping the config in the /opt/talkyard/conf/ directory on the host (where it gets included in the daily backups).

      Previously, thew whole config file was in /var/lib/postgresql/data/postgresql.conf in the container, but in February I changed it to just this: include '/var/lib/postgresql/conf/postgresql.conf',
      (for new installations only, won't affect already existing installations),
      meaning, the config is now instead supposed to be in /var/lib/postgresql/conf/postgresql.conf — in the container, ...

      ... On the host, the Postgresql config is supposed to be in: /opt/talkyard/conf/rdb/ which then gets mounted in /var/lib/postgresql/conf/ in the container. And this is the change I forgot to push to master.

      (Sorry for the troubles; thanks for posting about this.)

      1. ZZoubin Irani @zoubinirani
          2021-03-15 17:53:11.245Z

          FYI: I tried these steps and they worked except I believe there is an error in the script.

          As a result, I had to comment out set -e to get it to run.

          1. What's the error? Thanks for mentioning

        • In reply tomzafkismugi:

          Status update: I've merged the w-km2 changes into in the main branch in talkyard-prod-one (two? weeks ago actually, I forgot to mention here, sorry).

          And updated the instructions so one installs Ubuntu 20.04 (instead of 18.04), and Docker 20.x instead of 19.x.

          So this should have been solved now.