Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
The following NEW packages will be installed:
  libpq5 postgresql-9.1 postgresql-client-9.1 postgresql-client-common postgresql-common
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/3,389 kB of archives.
After this operation, 15.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
Selecting previously unselected package libpq5.
(Reading database ... 58862 files and directories currently installed.)
Unpacking libpq5 (from .../libpq5_9.1.9-0ubuntu12.10_amd64.deb) ...
Selecting previously unselected package postgresql-client-common.
Unpacking postgresql-client-common (from .../postgresql-client-common_136_all.deb) ...
Selecting previously unselected package postgresql-client-9.1.
Unpacking postgresql-client-9.1 (from .../postgresql-client-9.1_9.1.9-0ubuntu12.10_amd64.deb) ...
Selecting previously unselected package postgresql-common.
Unpacking postgresql-common (from .../postgresql-common_136_all.deb) ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Selecting previously unselected package postgresql-9.1.
Unpacking postgresql-9.1 (from .../postgresql-9.1_9.1.9-0ubuntu12.10_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up libpq5 (9.1.9-0ubuntu12.10) ...
Setting up postgresql-client-common (136) ...
Setting up postgresql-client-9.1 (9.1.9-0ubuntu12.10) ...
Setting up postgresql-common (136) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
 * No PostgreSQL clusters exist; see "man pg_createcluster"
Processing triggers for ureadahead ...
Setting up postgresql-9.1 (9.1.9-0ubuntu12.10) ...
Creating new cluster (configuration: /etc/postgresql/9.1/main, data: /var/lib/postgresql/9.1/main)...
Moving configuration file /var/lib/postgresql/9.1/main/postgresql.conf to /etc/postgresql/9.1/main...
Moving configuration file /var/lib/postgresql/9.1/main/pg_hba.conf to /etc/postgresql/9.1/main...
Moving configuration file /var/lib/postgresql/9.1/main/pg_ident.conf to /etc/postgresql/9.1/main...
Configuring postgresql.conf to use port 5432...
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                                                                                              * Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
Use of uninitialized value $logsize in numeric gt (>) at /usr/bin/pg_ctlcluster line 215.
The PostgreSQL server failed to start. Please check the log output.
                                                                                                                                [fail]
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
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 postgresql-9.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here's the output of uname -a:

Linux $hostname 3.5.0-36-generic #57-Ubuntu SMP Wed Jun 19 15:10:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

It's an Amazon AWS EC2 server - m1.small.

From a look through /usr/bin/pg_ctlcluster (a perl script), it's trying to read /etc/postgresql/9.1/main/pg_ctl.conf to find the log directory and it's somehow getting an invalid value. I don't understand why that would be a problem with a fresh installation.

Any pointers would be greatly appreciated.

Thanks,

share|improve this question
    
Odd. When you say "fresh installation" do you mean a new EC2 instance from a clean AMI? Or just a "fresh" PostgreSQL? Any chance you installed it before then removed it without --purge, or just didn't remove postgresql-common (the Ubuntu wrapper for PostgreSQL)? –  Craig Ringer Aug 13 '13 at 9:01
    
Yep, it was a new EC2 instance with a fresh AMI. I made sure that postgresql-common and all other postgres packages weren't present. –  Cerales Aug 15 '13 at 1:07

1 Answer 1

I had the exact same error today after updating a development server of ours. I tried many things including adding prints to the pg_ctlcluster script to trace what was going on ($logsize ends up being set to an unitialized value and in my case the socket itself was never created) as well as complete purge/reinstalls and couldn't get anything to work.

I compared permissions against a production server with the same OS (12.04 LTS in my case) and /var/run/postgres as well as lib and other directories all matched so couldn't see anything immediate there. Likewise the logfile as specified by pg_ctlcluster was owned by postgres and also looked ok.

At a loss I tried setting the log file to a directory I knew would definitely be writeable and accessible, namely /tmp by amending the /etc/postgresql/9.1/main/pg_ctl.conf file thus:

# Automatic pg_ctl configuration
# This configuration file contains cluster specific options to be passed to
# pg_ctl(1).

pg_ctl_options = '-l /tmp/pg.log'

Postgres was then able to start, I was able to connect and create roles and the configuration was able to pass. I am unsure as yet what is causing this - I gather it's permission related somehow. Am just glad to finally be able to carry on - I just needed to do a few tests and was only expecting to spend an hour on it! If I find out what on earth was the cause I will update - I've seen only a few references (a Google search came up with ~6 results total for the particular $logsize error) to this between Debian, Ubuntu and Linux Mint. It strikes me as odd though that more people haven't encountered this - making me think it's something rather specific and rare.

edit possibly related I also had difficulty in getting solr to work earlier. it was also related to a log file not being wrote to. Checking that it was using a symlink to point to the log directory - this resolved just fine but for some reason service could not start it. I removed the symlink, created a log folder within /var/lib/tomcat6 and lo-and-behold tomcat could start. I'm wondering if somehow it's related to the log file being specified by a symlink and it being unable to follow it for some reason.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.