In-place major upgrade of PostgreSQL failed with error "error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory"
search cancel

In-place major upgrade of PostgreSQL failed with error "error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory"

book

Article ID: 438318

calendar_today

Updated On:

Products

Bitnami Premium (Bitnami Secure Images)

Issue/Introduction

While doing an in-place major upgrade of CloudnativePG PostgreSQL, from a version with an old PostgreSQL image based on Debian 11 to a Bitnami PostgreSQL image based on Photon OS, the following error was encountered:

{"level":"info","ts":"2026-04-22T23:43:29.753589092Z","msg":"Running pg_upgrade","logging_pod":"xxx"}
{"level":"info","ts":"2026-04-22T23:43:29.758710008Z","logger":"pg_upgrade","msg":"/controller/old/usr/lib/postgresql/17/bin/postgres: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory","pipe":"stderr","logging_pod":"xxx"}
{"level":"info","ts":"2026-04-22T23:43:29.759019814Z","logger":"pg_upgrade","msg":"no data was returned by command \"\"/controller/old/usr/lib/postgresql/17/bin/postgres\" -V\"","pipe":"stderr","logging_pod":"xxx"}
{"level":"info","ts":"2026-04-22T23:43:29.759068729Z","logger":"pg_upgrade","msg":"command not found","pipe":"stderr","logging_pod":"xxx"}
{"level":"info","ts":"2026-04-22T23:43:29.759208643Z","logger":"pg_upgrade","msg":"check for \"/controller/old/usr/lib/postgresql/17/bin/postgres\" failed: cannot execute","pipe":"stdout","logging_pod":"xxx"}
{"level":"info","ts":"2026-04-22T23:43:29.759226197Z","logger":"pg_upgrade","msg":"Failure, exiting","pipe":"stdout","logging_pod":"xxx"}
Error: error while running pg_upgrade: error while running "/opt/bitnami/postgresql/bin/pg_upgrade --link --username postgres --old-bindir /controller/old/usr/lib/postgresql/17/bin --old-datadir /var/lib/postgresql/data/pgdata --new-datadir /var/lib/postgresql/data/pgdata-new": exit status 1 

Environment

Bitnami Secure Images

Cause

The old PostgreSQL image is based on Debian 11 that includes the OpenSSL 1.1.1 library, whereas the Bitnami PostgreSQL based on Photon OS is using the OpenSSL 3 library.  This difference is the cause of the error around the loading of the shared libraries.

Also, in-place major upgrades between different distros are not supported by CloudnativePG.

Resolution

In order to perform the transition, two in-place upgrades will need to be performed.  First, move from upstream PostgreSQL 17 to Bitnami PostgreSQL 17 (based on Photon).  Second, switch from Bitnami PostgreSQL 17 to Bitnami PostgreSQL 18.