Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 3016  / 3 Years ago, mon, september 20, 2021, 3:34:34
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,


More From » 12.10

 Answers
6

The solution was simple in the end: postgresql did not have read permissions on its own logs due to an administrative mistake.



This line of code in pg_ctlcluster is responsible for setting $logsize:



$logsize = (stat $info{'logfile'})[7];


What threw me off so much was that there's a line just above with:



$logsize = 0;


So, not understanding the semantics of variables in Perl (and I still don't), I assumed that something much weirder was going on with an error message like Use of uninitialized value.



Making postgres the owner of its log directory and files did the trick.


[#29974] Tuesday, September 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antebrow

Total Points: 291
Total Questions: 135
Total Answers: 117

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
antebrow questions
;