Postgresql fails to start

Bug #235604 reported by Thom Brown
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postgresql (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I installed Postgresql 8.3 using Synaptic Package Manager on a fresh install of Ubuntu 8.04 (64-bit version) However, the Postgresql service doesn't appear to start correctly. I receive the following log messages:

2008-05-27 02:32:40 BST LOG: could not load root certificate file "root.crt": no SSL error reported
2008-05-27 02:32:40 BST DETAIL: Will not verify client certificates.
2008-05-27 02:32:40 BST FATAL: could not create shared memory segment: Invalid argument
2008-05-27 02:32:40 BST DETAIL: Failed system call was shmget(key=5432001, size=39288832, 03600).
2008-05-27 02:32:40 BST HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 39288832 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
2008-05-27 02:38:38 BST LOG: could not load root certificate file "root.crt": no SSL error reported
2008-05-27 02:38:38 BST DETAIL: Will not verify client certificates.
2008-05-27 02:38:38 BST LOG: database system was shut down at 2008-05-18 12:20:18 BST
2008-05-27 02:38:38 BST LOG: incomplete startup packet
2008-05-27 02:38:38 BST LOG: autovacuum launcher started
2008-05-27 02:38:38 BST LOG: database system is ready to accept connections

I can't find anyone else reporting this so I'm not sure what exactly is wrong here.

The exact package names are:
postgresql-8.3
postgresql-8.3-slony1
postgresql-autodoc
postgresql-client
postgresql-client-8.3
postgresql-client-common
postgresql-common
postgresql-contrib
postgresql-contrib-8.3
postgresql-doc
postgresql-doc-8.3

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

This is not a bug but a configuration issue. The error message says it all:
"2008-05-27 02:32:40 BST HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 39288832 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
"

You need to increase SHMMAX or reduce Postgresql's shared buffers. Check http://www.google.com/search?q=linux+SHMMAX or read the Postgresql documentation.

Feel free to submit any future bugs you may find.

Revision history for this message
Peter Mühlenpfordt (muehlenp) wrote :

I get exactly the same error with exactly the same parameters.
But... I only get this at boot time, while postgres' automatic startup.
If I do a '/etc/init.d/postgresql-8.3 start' later, it works without any error message!

System: ubuntu-server 8.04.2 (x86_64), kernel 2.6.24-23-server
PostgreSQL: 8.3.5-0ubuntu0.8.04
kernel.shmmax = 268435456
kernel.shmall = 2097152
kernel.shmmni = 4096

Revision history for this message
cuz (chillycuz) wrote :

I get exactly the same error as aardvark with the same parameter settings on Ubuntu 8.10 Kernel 2.6.27-9-generic using Postgresql 8.3.6.

Revision history for this message
Torsten Bronger (bronger) wrote :

I don't think that this is a configuration issue, at least not directly. I didn't though the PostgreSQL configuration, it worked out-of-the-box. But after my first reboot after having installed PostgreSQL, it doesn't work anymore. Even not with manual start of the daemon. I get exactly the same error message as above.

Revision history for this message
Torsten Bronger (bronger) wrote :

Sorry, s/though/touch/

Revision history for this message
Joey O. Chua (joeycbulk) wrote :

Same as cuz, using Ubuntu 8.10(desktop). Although I could run postgre by executing '/etc/init.d/postgre-8.3 start'. This only happens on 64 bit systems, with 32 bit systems, there is no problem.

Has anyone found a workaround to this problem?

Revision history for this message
cuz (chillycuz) wrote :

I did finally get this to work (in Jaunty) by changing max_connections from 100 to 50 and shared_buffers from 32MB to 16MB.

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.