UNCLASSIFIED - NO CUI

Upgrade bug found with image

While using older bitnami images and doing an upgrade causes the below error. The database was originally initialized with locales that do not exist on the Ironbank version of this container.

Please also see pgpool#168

[2025-11-03 19:57:38] [ERROR] connection to database failed
[2025-11-03 19:57:38] [DETAIL] 
connection to server at "gitea-postgresql-ha-postgresql-0.gitea-postgresql-ha-postgresql-headless.dataplane-gitea.svc.cluster.local" (10.42.0.84), port 5432 failed: FATAL:  database locale is incompatible with operating system
DETAIL:  The database was initialized with LC_COLLATE "en_US.UTF-8",  which is not recognized by setlocale().
HINT:  Recreate the database with another locale or install the missing locale.

[2025-11-03 19:57:38] [DETAIL] attempted to connect using:
  user=repmgr password=changeme2 connect_timeout=5 dbname=repmgr host=gitea-postgresql-ha-postgresql-0.gitea-postgresql-ha-postgresql-headless.dataplane-gitea.svc.cluster.local port=5432 fallback_application_name=repmgr options=-csearch_path=

I was able to get around this issue by doing creating a custom image with the following in it but I feel like these changes should be put in a newer upstream image.

FROM registry1.dso.mil/ironbank/bitnami/postgresql-repmgr:17.4.0
# Ensure locales package is installed and en_US.UTF-8 is generated
USER root
RUN apt-get update && \
    apt-get install -y locales && \
    # uncomment the en_US.UTF-8 locale in /etc/locale.gen
    sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
    locale-gen && \
    update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 && \
    # clean up to reduce image size
    apt-get clean && rm -rf /var/lib/apt/lists/*

# Set environment variables for the locale
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

# Switch back to the default user if needed
USER 1001

# Keep the original entrypoint and command
ENTRYPOINT ["/opt/bitnami/scripts/postgresql-repmgr/entrypoint.sh"]
CMD ["/opt/bitnami/scripts/postgresql-repmgr/run.sh"]
Edited by David Navarro
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information