Your message dated Fri, 20 Dec 2019 11:39:30 +0100
with message-id <[email protected]>
and subject line Re: Bug#946957: postgresql-common: pg_upgradecluster woe: 
postgres fails to restart after upgrade
has caused the Debian Bug report #946957,
regarding postgresql-common: pg_upgradecluster woe: postgres fails to restart 
after upgrade
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
946957: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946957
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: postgresql-common
Version: 210
Severity: important

Hi,

I've just tried upgrading postgresql from version 11 to version 12,
following the instructions in README.Debian.  (Incidentally, the
example of upgrading from version 9.6 no longer works, as the minor
version should no longer be specified on recent versions.)  Here's
what happens to me:

********
erdos:~ # pg_dropcluster 12 main --stop
erdos:~ # pg_upgradecluster 11 main
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start 
operation
Creating new PostgreSQL cluster 12/main ...
/usr/lib/postgresql/12/bin/initdb -D /var/lib/postgresql/12/main --auth-local 
peer --auth-host md5 --encoding UTF8 --lc-collate en_GB.UTF-8 --lc-ctype 
en_GB.UTF-8
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_GB.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/12/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Europe/London
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5433 down   postgres /var/lib/postgresql/12/main 
/var/log/postgresql/postgresql-12-main.log

Starting new cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start 
operation
Error: /usr/lib/postgresql/12/bin/pg_ctl /usr/lib/postgresql/12/bin/pg_ctl 
start -D /var/lib/postgresql/12/main -l 
/var/log/postgresql/postgresql-12-main.log -s -o  -c 
config_file="/etc/postgresql/12/main/postgresql.conf" -c 
hba_file=/tmp/pg_hba._zoYwU.conf exited with status 1:
2019-12-18 08:55:15.323 GMT [520011] FATAL:  could not load server certificate 
file "/etc/ssl/certs/ssl-cert-snakeoil.pem": ee key too small
2019-12-18 08:55:15.323 GMT [520011] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
Error: Could not start target cluster
erdos:~ #
********

At this point, the postgres process needs to be manually killed.

I'm not sure at which point the check on ee key size was introduced,
but the default settings of switching ssl on and using the snake oil
certificate no longer works.

If I modify /etc/postgresql-common/createcluster.conf to say ssl =
off, then the upgrade part works smoothly.

It would be very helpful, though, for the instruction:

   Success. You can now start the database server using:
   
       pg_ctlcluster 12 main start

to appear at the end of the output, rather than buried in the middle
of it.

Anyway, following this upgrade, "pg_ctlcluster 12 main start"
successfully starts the postgresql service.  However,
/etc/init.d/postgresql start fails: for some reason, there is no
longer a [email protected] file for systemd.  I can't figure
out where this file should have been created, but it hasn't been :/.

Best wishes,

   Julian

-- System Information:
Debian Release: bullseye/sid
  APT prefers stretch
  APT policy: (500, 'stretch'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.3.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE=en_GB.utf8 (charmap=UTF-8) (ignored: LC_ALL set 
to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages postgresql-common depends on:
ii  adduser                   3.118
ii  debconf [debconf-2.0]     1.5.73
ii  lsb-base                  11.1.0
ii  perl                      5.30.0-9
ii  postgresql-client-common  210
ii  procps                    2:3.3.15-2+b1
ii  ssl-cert                  1.0.39
ii  ucf                       3.0038+nmu1

Versions of packages postgresql-common recommends:
ii  e2fsprogs  1.45.4-1
ii  logrotate  3.15.1-2

Versions of packages postgresql-common suggests:
ii  libjson-perl  4.02000-1

-- Configuration Files:
/etc/postgresql-common/createcluster.conf changed:
ssl = on
cluster_name = '%v/%c'
stats_temp_directory = '/var/run/postgresql/%v-%c.pg_stat_tmp'
log_line_prefix = '%%m [%%p] %%q%%u@%%d '
add_include_dir = 'conf.d'
include_dir '/etc/postgresql-common/createcluster.d'


-- debconf information:
  postgresql-common/ssl: true
* postgresql-common/obsolete-major:
  postgresql-common/catversion-bump:

--- End Message ---
--- Begin Message ---
Re: Julian Gilbey 2019-12-19 <[email protected]>
> > What's in /etc/postgresql/12/main/start.conf ? It should be 'auto' to
> > be included in postgresql.service start.
> > 
> > start.conf is legacy from the old sysvinit days. It is now read by
> > /lib/systemd/system-generators/postgresql-generator.
> 
> Oh, really interesting: it says "manual" on the machine which isn't
> working.  Here are the two files for comparison:
> 
> *** not working machine:
> # This cluster was upgraded to a newer major version. The old
> # cluster has been preserved for backup purposes, but is not started
> # automatically.
> 
> manual

Did you maybe invoke pg_upgradecluster twice? Maybe with the first
attempt aborted somewhere in the middle, or maybe the upgrade was
rolled back and retried later?

> I can confirm, though, that replacing the manual with auto on the
> not-working machine, and then running /etc/init.d/postgresql stop,
> systemctl daemon-reload, /etc/init.d/postgresql start worked
> beautifully!

Ack.

Fwiw, we will move in the direction of "systemctl enable
postgresql@xx-yy", and start.conf will become obsolete/optional.

Christoph

--- End Message ---

Reply via email to