Bug 37417 - Failed to start Postgres in postinst -> unconfigured
Failed to start Postgres in postinst -> unconfigured
Status: CLOSED DUPLICATE of bug 39595
Product: UCS
Classification: Unclassified
Component: PostgreSQL
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-4-errata
Assigned To: Stefan Gohmann
Janek Walkenhorst
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-29 00:33 CET by Dirk Wiesenthal
Modified: 2015-11-24 12:10 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-12-29 00:33:57 CET
A system installed an app that depended on postgres. The configuration of the packages failed. From the logs:

====

update-alternatives: using /usr/share/postgresql/9.1/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode 
Starting PostgreSQL 9.1 database server: mainError: /var/lib/postgresql/9.1/main is not accessible or does not exist ... failed!
failed!
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-9.1 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-9.1; however:
Package postgresql-9.1 is not configured yet.

dpkg: error processing postgresql (--configure):
dependency problems - leaving unconfigured

====

And then some more "leaving unconfigured" problems based on the previous error.

Another system worked fine though, /var/lib/postgresql/9.1/main was present. Any ideas what could have gone wrong?

From the "broken" system:

Filesystem                                             1K-blocks    Used Available Use% Mounted on
rootfs                                                  10036860 8697688    806284  92% /
Comment 1 Dirk Wiesenthal univentionstaff 2014-12-29 21:54:45 CET
The system was initially installed as UCS 2.4 and upgraded. Postgres may have been installed and removed several times throughout its lifetime.
Comment 2 Dirk Wiesenthal univentionstaff 2015-01-28 13:31:54 CET
Snapshot: snap-e277721c
Please delete after fixing this bug.
Comment 3 Janek Walkenhorst univentionstaff 2015-03-27 18:57:56 CET
There exists
 /etc/postgresql/9.1/main/*
but no
 /var/lib/postgresql/9.1/*
.

The files in /etc seem to come from univention-postgresql.

My current hypothesis is that univention-postgresql was updated before postgresql*, thus creating /etc/postgresql/9.1/main/* and the later postgresql-* then skips creating /var/lib/postgresql/9.1/*.

Another difference is that "postgresql" is installed instead of just postgresql-*, but this package contains no files of significance.

There seems to be no evidence supporting ENOSPC problems except the higher-than-normal (but still far from any limit) disk usage.
Comment 4 Janek Walkenhorst univentionstaff 2015-05-08 13:18:17 CEST
We should modify postgresql to not abort the installation when failing to start.
Comment 5 Tim Petersen univentionstaff 2015-07-23 13:10:12 CEST
happend several times in Forum and Support cases.

It seems to be related to the metapackage "postgresq" which isn't installed normally.

I think its a new dependency of bacula-director-pgsql for example (at least seen once).


I am not so sure what to check in preup, but it should break and show up a link to sdb.univention.de/1292 (manual migration)
Comment 6 Tim Petersen univentionstaff 2015-07-23 13:20:20 CEST
2015072221000236: USI from before and after
Forum:
http://forum.univention.de/viewtopic.php?f=48&t=4189&p=15481
http://forum.univention.de/viewtopic.php?f=48&t=4190&p=15461
Comment 7 Stefan Gohmann univentionstaff 2015-11-17 12:40:19 CET
The cause should have been fixed with Bug #39595.

*** This bug has been marked as a duplicate of bug 39595 ***
Comment 8 Janek Walkenhorst univentionstaff 2015-11-17 16:59:40 CET
(In reply to Dirk Wiesenthal from comment #2)
> Snapshot: snap-e277721c
> Please delete after fixing this bug.
Done

(In reply to Stefan Gohmann from comment #7)
> The cause should have been fixed with Bug #39595.
> 
> *** This bug has been marked as a duplicate of bug 39595 ***
Indeed