PostgreSQL 8.3 server package broken

Bug #235379 reported by Andreas Ntaflos
10
Affects Status Importance Assigned to Milestone
postgresql-8.3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: postgresql-8.3

Running a standard 'apt-get install postgresql' on a freshly installed Ubuntu 8.04 server should result in a working PostgreSQL installation in /var/lib/postgresql/8.3 with configuration files accessible from /etc/postgresql/8.3, as described in [1]. It does not.

[1] https://help.ubuntu.com/8.04/serverguide/C/postgresql.html

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

the guide talks about restarting the server with :

sudo /etc/init.d/postgresql-8.3 restart

that's because you can have installed on the same machine postgresql8.3 and postgresql8.2

you need to start your server with

/etc/init.d/postgresql-8.3 start

Leonel

Revision history for this message
Andreas Ntaflos (daff) wrote :

I should have made this clearer, but I really do use '/etc/init.d/postgresql-8.3 start' (as opposed to '/etc/init.d/postgresql start') for starting the server.

That doesn't change anything, though. There is still no server to be started.

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

Well I did the install on a fresh installed hardy server only selected openssh at the tasksel postgresql installed fine and started fine

this packages got installed
this came when I did a :
sudo apt-get install postgresql

  libpq5 libxml2 openssl openssl-blacklist postgresql postgresql-8.3
  postgresql-client-8.3 postgresql-client-common postgresql-common ssl-cert

then setup postgresql :

Configuring postgresql.conf to use port 5432...
 * Starting PostgreSQL 8.3 database server [ OK ]

and postgresql-8.3 is running..

All works fine here

Revision history for this message
Martin Pitt (pitti) wrote :

The cluster is not shipped in the package, but created by the package at installation time. The most common cause why this isn't working is that your locale settings are broken. Please do

  sudo dpkg -P postgresql-8.3 postgresql-client-8.3
  sudo apt-get install postgresql-8.3

and copy&paste the output of the latter command. Thanks!

Changed in postgresql-8.3:
status: New → Incomplete
Revision history for this message
Andreas Ntaflos (daff) wrote :

Interesting. I have removed, purged and reinstalled the PostgreSQL packages by means of 'aptitude remove --purge ~npostgresql' countless times last night, but any new installation always resulted in the same behaviour I described above.

However, using 'dpkg -P postgresql-8.3 postgresql-client-8.3' as suggested by Martin seems to have done the trick. Reinstalling after that creates the cluster and starts the server.

I can only speculate why this is happening but I suspect it has something to do with the fact that during installation I also requested that PostgreSQL be installed, along with Postfix and OpenSSH. The DBMS server was not running when I first logged in but apparently was in the state I described in my initial post. I then began removing, reinstalling and reconfiguring but nothing worked so I filed the report. Maybe the locale settings were off at installation time and thus the configuration of the cluster failed.

To verify I just installed a new virtual Ubuntu 8.04 server (using KVM) and did *not* request that PostgreSQL be installed. After logging in and upgrading all necessary packages I just issued the command 'sudo aptitude install postgresql-8.3' and everything worked out fine.

I am not sure any more what exactly the bug could be, but I am sure that the freshly installed server did not work the way it should, seeing as it could not and would not start the PostgreSQL server, even though it was requested at installation time.

Anyway, thanks for the input and help, Leonel and Martin.

Revision history for this message
Martin Pitt (pitti) wrote :

Andreas, how did you originally install this cluster? With the postgresql task or without? I'm looking for a way to reproduce this, otherwise there isn't much I can do, I'm afraid.

Revision history for this message
Andreas Ntaflos (daff) wrote :

During installation I selected that the server should be an OpenSSH as well as a PostgreSQL server. Other than that I did nothing special as far as I recall. After 'apt-get update', 'apt-get upgrade' and a reboot I wanted to create a database for Horde. That's when I discovered that PostgreSQL wasn't running and couldn't be started.

It might be worth noting that the installation CD was the beta version of Ubuntu 8.04 Server (ubuntu-8.04-beta-server-i386.iso). Unfortunately I don't really have the time to reproduce the problem myself at the moment, sorry.

Revision history for this message
smithfarm (presnypreklad) wrote :

I had the same problem (Hardy server edition) after downgrading from 8.3 to 8.2, setting up a cluster to use LATIN2 as the default encoding, and then trying to upgrade back to 8.3 using Synaptic and aptitude, as opposed to dpkg. The upgrade fails because there is an existing cluster, but for some reason it fails silently using Synaptic/aptitude, while dpkg produces an error message:

Setting up postgresql-8.3 (8.3.3-0ubuntu0.8.04) ...
Configuring already existing cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main, owner: 106:113)
Error: move_conffile: required configuration file /var/lib/postgresql/8.3/main/postgresql.conf does not exist
Error: could not create default cluster. Please create it manually with

  pg_createcluster 8.3 main --start

or a similar command (see 'man pg_createcluster').

So... the bug should be that when installing postgresql-8.3 on Hardy using Synaptic/aptitude when there is an existing cluster, the install fails silently. It should display the same error message as dpkg.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Can you try this in Ubuntu 8.10 and tell us if the problem still occurs?

Revision history for this message
internetter (internetter) wrote :

Am I to take that to mean this won't be fixed in 8.04? I have this problem right now, and I'm not going to upgrade to 8.10.

Revision history for this message
internetter (internetter) wrote :

Here is the output Martin Pitt was asking about, from my current install.

==BEGIN PASTE==
# apt-get install postgresql-8.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  postgresql-client-8.3
Suggested packages:
  oidentd ident-server postgresql-doc-8.3
The following NEW packages will be installed:
  postgresql-8.3 postgresql-client-8.3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/4309kB of archives.
After this operation, 18.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package postgresql-client-8.3.
(Reading database ... 21264 files and directories currently installed.)
Unpacking postgresql-client-8.3 (from .../postgresql-client-8.3_8.3.5-0ubuntu0.8.04_i386.deb) ...
Selecting previously deselected package postgresql-8.3.
Unpacking postgresql-8.3 (from .../postgresql-8.3_8.3.5-0ubuntu0.8.04_i386.deb) ...
Setting up postgresql-client-8.3 (8.3.5-0ubuntu0.8.04) ...

Setting up postgresql-8.3 (8.3.5-0ubuntu0.8.04) ...
Creating new cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main)...
Error: move_conffile: required configuration file /var/lib/postgresql/8.3/main/postgresql.conf does not exist
Error: could not create default cluster. Please create it manually with

  pg_createcluster 8.3 main --start

or a similar command (see 'man pg_createcluster').
==END PASTE==

Revision history for this message
internetter (internetter) wrote :

Is this bug being monitored by anyone?

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This hasn't been monitored. With so many bugs reports and so few of them legitimate, it's hard to keep track of things.

Could please try with 8.10 and 9.04 so we can verify if this bug still exists or if it has been patched upstream from 8.04.

This is simply an easy way for us to know whether a bug still exists or if it has been addressed already.

Revision history for this message
internetter (internetter) wrote :

I don't have a single 8.10 machine anywhere in my network. We're using 8.04 because it's an LTS release.

description: updated
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

NOTE: Take my advice with a grain of salt. I'm just trying to use the general template that I use to get back to a clean slate.

I've been reviewing this bug some more and I think the summary should be changed.

It appears that your issue is not with an incomplete package, but rather a broken installation.

Be sure to backup or databases appropriately. I have little experience in postgresql so I am resorting to generic trouble shooting skills.

The first step is definitely to backup your data. [1]

Remove all pqsl data.

sudo aptitude purge cl-sql-postgresql odbc-postgresql postgresql postgresql-8.3 postgresql-common
sudo aptitude clean #This gives you a clean download slate
 * Delete all users that were created from psql as well as their data

# Do a dry run to know what you find
sudo find / -name postgresql
sudo find / -name pgsql
sudo find / -name psql

# Delete it provided you have a good backup
sudo find / -name postgresql -exec rm -Rf {} \;
sudo find / -name pgsql -exec rm -Rf {} \;
sudo find / -name psql -exec rm -Rf {} \;

Reinstall things
sudo aptitude install postgresql-8.3 postgresql-client-8.3

Finally, restore your data. [1]

[1] - http://www.postgresql.org/docs/8.1/interactive/backup.html

Revision history for this message
internetter (internetter) wrote :

That series of steps worked. Thanks for your help.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

I'm glad that helped. I'm sorry I couldn't help you quicker too.

Changed in postgresql-8.3:
status: Incomplete → Fix Released
Revision history for this message
Ian Bicking (ianb) wrote :

I had to delete some directories after purging, then reinstallation worked. I deleted:

rm -rf /usr/lib/postgresql/8.3/lib /usr/share/postgresql/8.3/tsearch_data /usr/lib/postgresql/8.3 /usr/lib/postgresql /var/lib/postgresql

Probably just that first directory had to be deleted. After reinstalling it all worked.

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.