Hello , and thanks for packaging postgresql in Debian.
I've used it for some years (though I'm no expoert) and
has always worked fine .
This time I installed it on 2 amd64 PCs .
I one it run ok, but in the other it didn't create the main
cluster. /etc/postgresql and /var/lib/postgresql were empty
after installation.
I tried /etc/init.d/postgresql-8.3 restart , aptitude reinstall and
purge and
install but
still
it wouldn't create it.
The only message I could see in the console was about Debian version
5.0 being unknown (there's another bug about that but it said it's a
warning only).
After reading the docs I did a simple
pg_createcluster 8.3 main --start
and it worked. It created the cluster, populating
etc/postgresql/8.3/main and /var/lib/postgresql
I'm not sure it can be reproduced because the other PC I was installing
at the same time had no issue at all.
The installation was on 26.12.2008, I believe.
I installed from a Lenny RC1 netinst CD for amd64.
I think I picked file server and print server from the tasksel
I then did dpkg --set-selections from a list of packages
taken from a laptop , I'll attach the list.
I configured printers, ssh, X, etc.
And when I tried to access psql a week later, found there wasn't
a cluster, only in one of the 2 PCs.
I'm puzzled, but I'm also tired right now.
I'm not sure this report it's useful, but I found it very strange,
and didn't know where to llok for clues. It works now, but it's
never failed installation like this before. I never had to create main.
-- System Information:
Debian Release: 5.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages postgresql-8.3 depends on:
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libcomerr2 1.41.3-1 common error description library
ii libkrb53 1.6.dfsg.4~beta1-4 MIT Kerberos runtime libraries
ii libldap-2.4-2 2.4.11-1 OpenLDAP libraries
ii libpam0g 1.0.1-4+b1 Pluggable Authentication Modules l
ii libpq5 8.3.5-1 PostgreSQL C client library
ii libssl0.9.8 0.9.8g-14 SSL shared libraries
ii libxml2 2.6.32.dfsg-5 GNOME XML library
ii locales 2.7-16 GNU C Library: National Language (
ii postgresql-client-8.3 8.3.5-1 front-end programs for PostgreSQL
ii postgresql-common 94 PostgreSQL database-cluster manage
ii ssl-cert 1.0.23 simple debconf wrapper for OpenSSL
ii tzdata 2008h-2 time zone and daylight-saving time
postgresql-8.3 recommends no packages.
Versions of packages postgresql-8.3 suggests:
ii pidentd [ident-server] 3.0.19.ds1-4 TCP/IP IDENT protocol server with
-- no debconf information
Xavi Drudis Ferran [2009-01-04 3:31 +0100]:
> I tried /etc/init.d/postgresql-8.3 restart , aptitude reinstall and
> purge and
> install but
> still
> it wouldn't create it.
Since you can create it manually, there doesn't seem to be a principal
problem with it (missing locales or so). The usual reason is that
there is a previously existing cluster in /etc/postgresql/ and/or
/var/lib/postgresql/.
Can you still reproduce this by purging postgresql-8.3 and doing
apt-get install postgresql-8.3
in a terminal as root? Please copy&paste the complete output of this.
> The only message I could see in the console was about Debian version
> 5.0 being unknown (there's another bug about that but it said it's a
> warning only).
Yes, that's a warning. I'll get that fixed soon.
Thanks!
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Xavi Drudis Ferran [2009-01-04 3:31 +0100]:
> I one it run ok, but in the other it didn't create the main cluster.
> /etc/postgresql and /var/lib/postgresql were empty after
> installation.
>
> I tried /etc/init.d/postgresql-8.3 restart , aptitude reinstall and
> purge and install but still it wouldn't create it.
Unfortunately I'm still in the dark about this one; in particular, I
haven't been able to reproduce the situation where /etc/postgresql/
exists, but is empty.
So let's collect some finer details here.
First, I assume that most of you installed postgresql-8.3 *after* the
initial Debian installation, i. e. you did not choose the database
server task in debian-installer? If you did, then please have a look
at /var/log/installer and check if they have anything regarding to
postgresql, in particular the package install log.
But many reporters pointed out that the installed PostgreSQL later,
thus I don't think it is an install-time only bug. Can anyone of you
still say whether you already had the package "locales" installed when
you installed postgresql-8.3? Did you have a locale configured and
used?
I bootstrapped a fresh lenny system and did three experiments (with
cleaning up after everyone with "apt-get purge --auto-remove
postgresql-8.3", which removes everything down to libxml2, python,
perl-modules, etc.)
- Installing postgresql-8.3 without any $LANG or $LC_ALL set. This
works fine, I get a default 8.3/main cluster with C encoding
(SQL_ASCII).
- Installing postgresql-8.3 without locales installed, but
LANG=de_DE.UTF-8. As expected, I get lots of "invalid locale"
errors for packages, and postgresql-8.3 does not configure a
cluster because of the invalid locale:
|Setting up postgresql-8.3 (8.3.6-1) ...
|perl: warning: Setting locale failed.
|perl: warning: Please check that your locale settings:
| LANGUAGE = (unset),
| LC_ALL = (unset),
| LANG = "de_DE.UTF-8"
| are supported and installed on your system.
|perl: warning: Falling back to the standard locale ("C").
|Error: The locale requested by the environment is invalid.
|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').
However, in this case /etc/postgresql/ is *not* created. This makes
me believe that the error you encountered is not tied to locales
(because it is also pretty uncommon to have broken locales, and I
got so many reports about this problem).
- Generating de_DE.UTF-8 locale, installing postgresql-8.3. Works
flawlessly and I get an 8.3/main cluster automatically.
Finally, just to make sure, I did the same experiment with installing
"postgresql" instead of "postgresql-8.3". It's just an empty
metapackage, though, and as expected it gives exactly the same
results.
So let's have a closer look at the code. Either the cluster is not
even attempted to be created, or it fails to do so.
First, failure case: This usually happens if the locale is invalid,
but that wouldn't leave an /etc/postgresql/ behind (see above). Then
there can be all sorts of file system things, such as /var not being
writable, but since it works with a manual pg_createcluster, I don't
believe that this is the reason for all your reports.
Then, the "not attempted" case: This is determined in
/usr/share/postgresql-common/maintscripts-functions,
configure_version():
|# arguments: <major version> <most recently configured package version>
|configure_version() {
| VERSION="$1"
|
| # Create a main cluster for given version ($1) if no cluster already exists
| # for that version and we are installing from scratch.
| [ "$VERSION" ] || { echo "Error: configure_version: need version parameter" >&2; exit 1; }
| if [ ! -d "/etc/postgresql/$VERSION" ] || [ -z "$(ls /etc/postgresql/$VERSION)" ] || \
| [ -z "$(ls /etc/postgresql/$VERSION/*/postgresql.conf 2>/dev/null)" ]; then
| [ "$2" ] || /usr/bin/pg_createcluster -u postgres $VERSION main || {
| echo "Error: could not create default cluster. Please create it manually with
|
| pg_createcluster $VERSION main --start
|
|or a similar command (see 'man pg_createcluster')." >&2
| }
| fi
|
| _link_manpages "$VERSION" "postgresql-$VERSION" postmaster.1.gz
|}
So this means that a cluster is only created automatically if:
1. /etc/postgresql/8.3/ does not exist, or /etc/postgresql/8.3/ is
empty, or /etc/postgresql/8.3/main/postgresql.conf does not exist
2. The package postgresql-8.3 was not installed before, or was
purged.
It seems very unlikely to me that those conditions were not met with a
fresh Lenny install, though, but perhaps it gives some of you a clue
what could have happened.
How exactly did you install Lenny? Which medium, which tasks, which
locales? Could any of you attach the installer logs
(/var/log/installer)?
Thanks,
Martin Pitt [2009-02-28 13:46 +0100]:
> First, I assume that most of you installed postgresql-8.3 *after* the
> initial Debian installation, i. e. you did not choose the database
> server task in debian-installer? If you did, then please have a look
> at /var/log/installer and check if they have anything regarding to
> postgresql, in particular the package install log.
In particular, please check if you have the same symptoms as
http://bugs.debian/org/517389, i. e. you get something like
/dev/null: Permission denied
in the installer environment.
I don't remember having seen that.
But I'm pretty sure I would have reported it if I had seen it, even tired
as I was when filing the bug.
--
xdr...@tinet.cat
Signa per fer Collserola parc natural com cal
http://www.collserola.org/salvemelparcnatural/
I did an install without the dtabase task and after that I
selected many packages for instalation, postgresql among them.
> But many reporters pointed out that the installed PostgreSQL later,
> thus I don't think it is an install-time only bug. Can anyone of you
> still say whether you already had the package "locales" installed when
> you installed postgresql-8.3? Did you have a locale configured and
> used?
>
I was using ca_ES.UTF-8. Apparently well configured/installed.
>
> First, failure case: This usually happens if the locale is invalid,
> but that wouldn't leave an /etc/postgresql/ behind (see above). Then
> there can be all sorts of file system things, such as /var not being
> writable, but since it works with a manual pg_createcluster, I don't
> believe that this is the reason for all your reports.
>
I didn't fic any of these before I could manually create the cluster.
I installed with just the root partition and swap. And the partition
was writeable. I checked the logs and I didn't see anything unusal,
so I guess /var/log/ was writable.
I don't know much more and that system is still running windows :( .
I think it's only been booted to linux once since my report, for some minutes only.
> Then, the "not attempted" case: This is determined in
> /usr/share/postgresql-common/maintscripts-functions,
> configure_version():
>
> |# arguments: <major version> <most recently configured package version>
> |configure_version() {
> | VERSION="$1"
> |
> | # Create a main cluster for given version ($1) if no cluster already exists
> | # for that version and we are installing from scratch.
> | [ "$VERSION" ] || { echo "Error: configure_version: need version parameter" >&2; exit 1; }
> | if [ ! -d "/etc/postgresql/$VERSION" ] || [ -z "$(ls /etc/postgresql/$VERSION)" ] || \
> | [ -z "$(ls /etc/postgresql/$VERSION/*/postgresql.conf 2>/dev/null)" ]; then
> | [ "$2" ] || /usr/bin/pg_createcluster -u postgres $VERSION main || {
> | echo "Error: could not create default cluster. Please create it manually with
> |
> | pg_createcluster $VERSION main --start
> |
> |or a similar command (see 'man pg_createcluster')." >&2
> | }
> | fi
> |
> | _link_manpages "$VERSION" "postgresql-$VERSION" postmaster.1.gz
> |}
>
> So this means that a cluster is only created automatically if:
>
> 1. /etc/postgresql/8.3/ does not exist, or /etc/postgresql/8.3/ is
> empty, or /etc/postgresql/8.3/main/postgresql.conf does not exist
Mmm.. I copied some configurations from another machine. I don't think
I copied /etc/postgresql/8.3/main/postgresql.conf but I guess I might have.
But I reported /etc/postgres was empty, so I guess I didn't copy it.
> 2. The package postgresql-8.3 was not installed before, or was
> purged.
>
It wasn't installed before and was ony purged after the issue appeared.
> It seems very unlikely to me that those conditions were not met with a
> fresh Lenny install, though, but perhaps it gives some of you a clue
> what could have happened.
>
No clue, sorry. In fact the more I think of it the less I can explained it.
It just happened. What gives ?
> How exactly did you install Lenny? Which medium, which tasks, which
> locales? Could any of you attach the installer logs
> (/var/log/installer)?
>
I choosed Catalan language in the installer, and configured ca_ES.UTF-8
as default locale. I can't attach the logs now, but I guess it doesn't
matter since it wasn't installed from the debian installer.
Sorry for being unhelpful.
Thanks for your caring for this bug report.
I experienced exactly the same problem. In my case I have chosen the
"database server" task and I found the relevant (at least I think so)
part in the installer log:
Mar 3 13:51:11 in-target: Richte postgresql-common ein (94lenny1) ...
Mar 3 13:51:11 debconf: Obsolete command TITLE Konfiguriere postgresql-common called
Mar 3 14:51:12 groupadd[18560]: new group: name=postgres, GID=114
Mar 3 14:51:12 useradd[18564]: new user: name=postgres, UID=106, GID=114, home=/var/lib/postgresql, shell=/bin/bash
Mar 3 14:51:12 usermod[18569]: change user `postgres' password
Mar 3 14:51:12 chage[18574]: changed password expiry for postgres
Mar 3 14:51:12 chfn[18577]: changed user `postgres' information
Mar 3 14:51:12 gpasswd[18592]: add member postgres to group ssl-cert by root
Mar 3 13:51:12 in-target: Füge Benutzer postgres zu Gruppe ssl-cert hinzu
Mar 3 13:51:12 in-target: Richte postgresql-8.3 ein (8.3.6-1) ...
Mar 3 13:51:12 in-target: Creating new cluster (configuration: /etc/postgresql/8.3/main, data: /var/lib/postgresql/8.3/main)...
Mar 3 13:51:12 in-target: sh: /dev/null: Keine Berechtigung
Mar 3 13:51:12 in-target: fgets failure: Erfolg
Mar 3 13:51:12 in-target: Das Programm »postgres« wird von initdb benötigt, aber wurde nicht im
Mar 3 13:51:12 in-target: selben Verzeichnis wie »/usr/lib/postgresql/8.3/bin/initdb« gefunden.
Mar 3 13:51:12 in-target: Prüfen Sie Ihre Installation.
Mar 3 13:51:12 in-target: Error: initdb failed
Mar 3 13:51:12 in-target: Error: could not create default cluster. Please create it manually with
Mar 3 13:51:12 in-target:
Mar 3 13:51:12 in-target: pg_createcluster 8.3 main --start
Mar 3 13:51:12 in-target:
Mar 3 13:51:12 in-target: or a similar command (see 'man pg_createcluster').
If you need help with the translation, please let me know.
Francois.
Francois Fernandes [2009-03-04 11:13 +0100]:
> I experienced exactly the same problem. In my case I have chosen the
> "database server" task and I found the relevant (at least I think so)
> part in the installer log:
> [...]
> Mar 3 13:51:12 in-target: sh: /dev/null: Keine Berechtigung
As I pointed out above, this is
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517389
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
--