Central service image build fails due to missing stretch-pgdg repository

1. What is the issue? Please be detailed.
I updated Central to version 1.5.3 today and the service image failed to build as the repository for stretch-pgdg has been archived. It is now hosted at apt-archive.postgresql.org/pub/repos/apt/

2. What steps can we take to reproduce this issue?
Upgrade to latest version.

3. What have you tried to fix the issue?
Changing to the apt-archive subdomain

4. Upload any test forms or screenshots below.

Step 3/13 : RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list;   wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -;   apt-get update;   apt-get install -y cron gettext postgresql-client-9.6
---> Running in c5d0298f155b
deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
Get:3 http://security.debian.org/debian-security buster/updates InRelease [34.8 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]
Ign:5 http://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
Get:7 http://security.debian.org/debian-security buster/updates/main amd64 Packages [390 kB]
Err:8 http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release
  404  Not Found [IP: 72.32.157.246 80]
Reading package lists...
E: The repository 'http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release' does not have a Release file.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package postgresql-client-9.6
E: Couldn't find any package by glob 'postgresql-client-9.6'
E: Couldn't find any package by regex 'postgresql-client-9.6'
The command '/bin/sh -c echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list;   wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -;   apt-get update;   apt-get install -y cron gettext postgresql-client-9.6' returned a non-zero code: 100
ERROR: Service 'service' failed to build : Build failed
1 Like

I am getting a similar error when installing central on DigitalOcean! This was not happening a few months ago. Can someone please help

Solution is to change the url in the service docker file.

cd central
nano service.dockerfile
add -archive to url on third row after apt. So that it reads http://apt-archive.postgresql.org/pub/repos/apt/
Save & exit
docker-compose build service
docker-compose stop service
docker-compose up -d
1 Like

Definitely seems like problem. We're investigating the root cause and a fix and will report back ASAP.

1 Like

Thank you very much - this has worked. You have saved me a third sleepless night in a row!

1 Like

Cannot build odk central from the github link given on the internet, after cloning , and making the env file as mentioned , when running docker-compose build , as given in the instruction on line its gives the below error, attached is the screen shoot of the same.

is there a sudden problem in the odk central codebase because i have build odk central before from scratch this di not happen , but now when tried from yesterday evening this is not a success ,can odk development tea what has gone wrong suddenly on the odk code base

Thanks to everyone for reporting this issue.

I have pending fix that is undergoing review and I'm hoping we can have a fix out in a few hours.

If you don't want to wait for the fix, you can manually change line 5 in service.dockerfile to this:

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list; \``

The change is to replace stretch with $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release). Below is a diff to make the change easier to see.

I'll update this topic when the pending fix has been released.

2 Likes

If you are having this problem, upgrade to Central v1.5.4 for a fix. See upgrading Central for the necessary steps.

1 Like

Debian Stretch has been removed from PostgreSQL apt (https://wiki.postgresql.org/wiki/Apt#News):

News
2022-11-07: Debian stretch (9) has been removed: https://www.postgresql.org/message-id/Y2kmqL%2BpCuSZiQBV%40msg.df7cb.de