Issue updating postgresql

I am trying to upgrade postgres using the instructions here: https://github.com/kobotoolbox/kobo-docker/blob/master/doc/November-2022-Upgrade.md

When I got to step 2, I noticed that my docker-compose.backend.template.yml already had the line

image: postgis/postgis:9.5-2.5

And didn’t have the line

image: postgis/postgis:14-3.2

As implied in the instructions. I still carried on with the instructions with my file looking like this:

services:
  postgres:
    image: postgis/postgis:9.5-2.5
    hostname: postgres
    env_file:
      - ../kobo-env/envfile.txt
      - ../kobo-env/envfiles/databases.txt
      - ../kobo-env/envfiles/aws.txt
    volumes:
      - ./.vols/db:/var/lib/postgresql/data
      - ./.vols/db14:/var/lib/postgresql/data

But when I got to step 16, running the following command:

root@postgres:/# su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/data/ start'

Causes the error:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
  in "/home/administrator/kobo-docker/docker-compose.backend.template.yml", line 10, column 13

Changing the yml file back to how it was in step 3 lets me start the container but running

su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/data/ start'

causes the error that it can’t the directory. And indeed, /usr/lib/postgresql/14 doesn’t exist. Only /usr/lib/postgresql/9.5

Did I do something wrong? I did not customize my installation. My original version is (from going to ee.mydomain) is [2.8.1] - 2021-09-10

1 Like

Any takers?

I have the same issue, so I postponed the upgrade process.

Does anyone have an advise to solve this issue.

Thanks in advance

In my case I abandoned upgrading and I just did a fresh install. But that has its own issues as the newest version of MongoDB requires a processor with AVX instruction set enabled as noted here: https://www.mongodb.com/docs/manual/administration/production-notes/#x86_64

So before doing a fresh install of the newest Kobo-install, check that your CPU supports AVX by running the following in a terminal:

grep avx /proc/cpuinfo

If nothing shows up, then your CPU may not support AVX and MongoDB probably won’t work.