Proxmox Mail Gateway Upgrade V7 to V8 - Database Cluster Error

iprigger

Renowned Member
Sep 5, 2009
169
35
93
earth!
All,

I have tried two times upgrading my PMG Cluster from 7.x latest to 8.0 - both times it failed at the step "pg_upgradecluster -v 15 13 main"

It simly exists with an error (unable to upgrade) and the database is gone afterwards.

*any* idea?

Thanks
Tobias
 
what is the exacty error message?
can you post also the journal/syslog?
 
  • Like
Reactions: Stoiko Ivanov
Hi,

Sorry for the late reply

I get:
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TERMINAL = "iTerm2",
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Error: The locale requested by the environment is invalid:
LANG: en_US.UTF-8
LC_CTYPE: UTF-8
LC_TERMINAL: iTerm2
LC_TERMINAL_VERSION: 3.4.19
Error: Could not create target cluster

No syslog...

Tobias
 
Hi All,

sorry, this is not funny. It really completely breaks my complete mailrouting...

And having to new-install this (despite having a backup) costs just a lot of time. Really anxious to upgrade any of our customer systems right now.

The system is half dead after the update... not really what any one wants on a mail cluster.

Tobias
 
And after the upgrade failed:

2023-07-21T16:55:28.120351+02:00 smtp-mc pmg-smtp-filter[697]: Starting "1" children
2023-07-21T16:55:38.038323+02:00 smtp-mc pmg-smtp-filter[1714]: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "root", database "Proxmox_ruledb", SSL off at /usr/share/perl5/PMG/DBTools.pm line 78.
2023-07-21T16:55:38.127236+02:00 smtp-mc pmg-smtp-filter[697]: Starting "1" children
2023-07-21T16:55:38.134727+02:00 smtp-mc pmg-smtp-filter[1716]: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "root", database "Proxmox_ruledb", SSL off at /usr/share/perl5/PMG/DBTools.pm line 78.
2023-07-21T16:55:38.220430+02:00 smtp-mc pmg-smtp-filter[697]: Starting "1" children
2023-07-21T16:55:38.335081+02:00 smtp-mc pmgpolicy[641]: starting policy database maintenance (greylist, rbl)
2023-07-21T16:55:38.337018+02:00 smtp-mc pmgpolicy[641]: ERROR: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "root", database "Proxmox_ruledb", SSL off at /usr/share/perl5/PMG/DBTools.pm line 78.

Tobias
 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TERMINAL = "iTerm2",
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
These are usually harmless - but might be problematic for a postgresql upgrade
simply run `dpkg-reconfigure locales` and make sure to select all appropriate locales for your system)

failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "root", database "Proxmox_ruledb", SSL off at /usr/share/perl5/PMG/DBTools.pm line 78.
I suppose that this might be the actual problem - however I fail to see how this might happen, unless you have changed the pg_hba.conf template quite a bit - and then not compared the changes upon upgrading?

could you please post:
* /etc/pmg/templates/pg_hba.conf.in
* /etc/postgresql/15/main/pg_hba.conf
* /etc/postgresql/13/main/pg_hba.conf
* any relevant file in /var/log/postgresql
 
These are usually harmless - but might be problematic for a postgresql upgrade
simply run `dpkg-reconfigure locales` and make sure to select all appropriate locales for your system)


I suppose that this might be the actual problem - however I fail to see how this might happen, unless you have changed the pg_hba.conf template quite a bit - and then not compared the changes upon upgrading?

could you please post:
* /etc/pmg/templates/pg_hba.conf.in
* /etc/postgresql/15/main/pg_hba.conf
* /etc/postgresql/13/main/pg_hba.conf
* any relevant file in /var/log/postgresql
hi,

This is an out-of-the-box installation... no changes to it post-install.

The first file isn't existing.

The second file isn't existing.

The third file is:
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
# "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
# "password" sends passwords in clear text; "md5" is preferred since
# it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different
# authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted. Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect. You can
# use "pg_ctl reload" to do that.

# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.




# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5


Note: I had to revert back to 7.x as there wasn't any e-mails passing through after the upgrade to V8.

Tobias
 
Note: I had to revert back to 7.x as there wasn't any e-mails passing through after the upgrade to V8.
Then I'm not surprised that the postgresql version 15 files are not present ...
Again: This is an unmodified installation....
Installed on top of debian or by the PMG installer, or using the container template?

in any case please just run the command and select appropriate locales!

to get further in seeing where the issue is - it would help to have /var/log/apt/history.log and /var/log/apt/term.log from when the upgrade gets to the point where you run into the error
 
Then I'm not surprised that the postgresql version 15 files are not present ...

Installed on top of debian or by the PMG installer, or using the container template?

in any case please just run the command and select appropriate locales!

to get further in seeing where the issue is - it would help to have /var/log/apt/history.log and /var/log/apt/term.log from when the upgrade gets to the point where you run into the error
Installed from the Proxmox provided ISO.

Tobias
 
its an error with the terminal / shell not having the correct locales.

Below is the fix

Bash:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

pg_dropcluster --stop 15 main
pg_upgradecluster -v 15 13 main
 
Last edited:
its an error with the terminal / shell not having the correct locales.

Below is the fix

Bash:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

pg_dropcluster --stop 15 main
pg_upgradecluster -v 15 13 main
Hi,

Thanks, will try this!

Tobias
 
its an error with the terminal / shell not having the correct locales.

Below is the fix

Bash:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

pg_dropcluster --stop 15 main
pg_upgradecluster -v 15 13 main
thanks, that was the solution!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!