pg_upgradecluster fails: "could not get cluster locales"

Bug #1437862 reported by Victor-Philipp
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

We upgrade a 12.04 LTS to 14.04 LTS and use the pg_upgradecluster command(usage as described in /usr/share/doc/README.Debian.gz). But we get a failure an no upgrade is done:

pg_dropcluster 9.3 main --stop

pg_upgradecluster 9.1 main
 psql: FATAL: the database system is shutting down
 psql: FATAL: the database system is shutting down
 Use of uninitialized value $out in pattern match (m//) at /usr/share/postgresql-common/PgCommon.pm line 883.
 psql: FATAL: the database system is shutting down
 Use of uninitialized value $out in pattern match (m//) at /usr/share/postgresql-common/PgCommon.pm line 889.
 Use of uninitialized value $ctype in scalar chomp at /usr/share/postgresql-common/PgCommon.pm line 892.
 Use of uninitialized value $collate in scalar chomp at /usr/share/postgresql-common/PgCommon.pm line 893.
 Error: could not get cluster localesapt-get install postgresql-9.3

apt-get install postgresql-9.3 postgresql-common postgresql-client-9.3 postgresql-contrib-9.3 said, that all packages are in their newest version and

dpkg said:
iU postgresql 9.3+154 all object-relational SQL database (supported version)
ii postgresql-9.1 9.1.15-0ubuntu0.12.04 amd64 object-relational SQL database, version 9.1 server
iU postgresql-9.3 9.3.6-0ubuntu0.14.04 amd64 object-relational SQL database, version 9.3 server
iU postgresql-client 9.3+154 all front-end programs for PostgreSQL (supported version)
ii postgresql-client-9.1 9.1.15-0ubuntu0.12.04 amd64 front-end programs for PostgreSQL 9.1
iF postgresql-client-9.3 9.3.6-0ubuntu0.14.04 amd64 front-end programs for PostgreSQL 9.3
ii postgresql-client-common 154 all manager for multiple PostgreSQL client versions
ii postgresql-common 154 all PostgreSQL database-cluster manager
iU postgresql-contrib 9.3+154 all additional facilities for PostgreSQL (supported version)
ii postgresql-contrib-9.1 9.1.15-0ubuntu0.12.04 amd64 additional facilities for PostgreSQL
iU postgresql-contrib-9.3 9.3.6-0ubuntu0.14.04 amd64 additional facilities for PostgreSQL
ii postgresql-doc 9.3+154 all documentation for the PostgreSQL database management system
ii postgresql-doc-9.1 9.1.15-0ubuntu0.12.04 all documentation for the PostgreSQL database management system
ii postgresql-doc-9.3 9.3.6-0ubuntu0.14.04 all documentation for the PostgreSQL database management system

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in postgresql-common (Ubuntu):
status: New → Confirmed
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

Same bug happens when you try to upgrade the cluster from 9.3 to 9.4.

Revision history for this message
Lenin (emaillenin) wrote :

Same issue while upgrading from 9.4 to 9.5, how do we solve this?

Revision history for this message
Steve Fox (drfickle2) wrote :

FWIW, I'm also running into this, but found a work-around. It was suggested at http://comments.gmane.org/gmane.linux.debian.devel.bugs.general/1172657 to edit the pg_upgradecluster script and increase the timeout from 5 seconds to 30.

Revision history for this message
Andrew B (n-launchpad-lineum-org) wrote :

Hi,

In my instance this error originated deep down in the call stack in get_cluster_port in /usr/share/Perl5/Pgcommon.pm when attempting to upgrade from 9.3 to 9.5

In my postgresql.conf for the old 9.3 cluster I had the port line commented-out per the default configuration file:

#port = 5432

This worked fine in production since Postgres defaults to that port number when not defined. However its absence was causing get_cluster_port to fail and this was propagating up the call stack to get_encoding in pg_upgradecluster.

I decommented the port line:

port = 5432

and reran pg_upgradecluster with success.

Revision history for this message
Rob Hills (rhills) wrote :

This bug prevents me upgrading from 9.5 -> 9.6.

I tried both workarounds suggested above:
Edited /usr/bin/pg_upgradecluster changing lines 333 and 354 of that script from:
  push @argv, ('-t', '5') if $version >= '8.4';
to
  push @argv, ('-t', '30') if $version >= '8.4';
which was my guessed change based on comment #4 above: the posted link is broken.
I re-ran pg_upgradecluster but it crashed with the same error, and within less than a second of starting which suggests to me this isn't a timeout issue in my case.

Also checked my postgresql.conf file IAW comment #5 above, my port line was already uncommented.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.