Skip to content

Failing even though extensions are built into image #175

@anna-is-cute

Description

@anna-is-cute

Hi! I've used this image to upgrade from 16 to 17 without issue in the past. Today I tried to upgrade to 18 with no luck, however. I was hoping someone might be able to explain what's going wrong here.

FROM docker.io/pgautoupgrade/pgautoupgrade:18-alpine

RUN apk add --no-cache build-base clang19 llvm19 \
    && mkdir build \
    && cd build \
    && wget https://api.pgxn.org/dist/semver/0.40.0/semver-0.40.0.zip \
    && unzip semver-0.40.0.zip \
    && cd semver-0.40.0 \
    && make \
    && make install \
    && cd ../.. \
    && rm -rf build \
    && mkdir build \
    && cd build \
    && wget https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.2.tar.gz \
    && tar -xvf 1.4.2.tar.gz \
    && cd hypopg-1.4.2 \
    && make \
    && make install \
    && cd ../.. \
    && rm -rf build \
    && mkdir build \
    && cd build \
    && wget https://github.com/supabase/index_advisor/archive/refs/tags/v0.2.0.tar.gz \
    && tar -xvf v0.2.0.tar.gz \
    && cd index_advisor-0.2.0 \
    && make \
    && make install \
    && cd ../.. \
    && rm -rf build \
    && apk del build-base clang19 llvm19 \
    && rm -f /sbin/apk \
    && rm -rf /etc/apk \
    && rm -rf /lib/apk \
    && rm -rf /usr/share/apk \
    && rm -rf /var/lib/apk

Basically I just install the three extensions used by my prod database into the image. This is actually the same Dockerfile I use for the prod database but with the FROM line changed.

I build that image as upgrade-db, and then run it as follows.

podman run --name pgauto -it \
    --volume database-data:/var/lib/postgresql \
    -e POSTGRES_PASSWORD=redacted \
    -e PGAUTO_ONESHOT=true \
    upgrade-db

It fails on not finding the semver extension.

command: "/usr/local/bin/pg_dump" --host /var/run/postgresql --port 50432 --username postgres --no-data --sequence-data  --quote-all-identifiers --binary-upgrade --format=custom --statistics --no-sync --file="/var/lib/postgresql/18/docker/new/pg_upgrade_output.d/20251028T152537.575/dump/pg_upgrade_dump_17805.custom" 'dbname=generic' >> "/var/lib/postgresql/18/docker/new/pg_upgrade_output.d/20251028T152537.575/log/pg_upgrade_dump_17805.log" 2>&1
pg_dump: error: query failed: ERROR:  could not access file "semver": No such file or directory
pg_dump: detail: Query was: EXECUTE getAttributeStats('[truncated]

Any idea what's going wrong here? The extension is definitely there!

podman run --rm -it --entrypoint /bin/bash upgrade-db
544c23c11e06:/var/lib/postgresql# ls /usr/local/share/postgresql/extension/ | grep -i semver
semver.control

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions