package postgresql-8.4 8.4.2-1 failed to install/upgrade: FATAL: could not create shared memory segment: Invalid argument

Bug #496854 reported by Jarkko Lietolahti
108
This bug affects 24 people
Affects Status Importance Assigned to Milestone
postgresql-8.4 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: postgresql-8.4

Setting up postgresql-8.4 (8.4.2-1) ...
 * Starting PostgreSQL 8.4 database server * The PostgreSQL server failed to start. Please check the log output:
2009-12-15 08:37:18 EET FATAL: could not create shared memory segment: Invalid argument
2009-12-15 08:37:18 EET DETAIL: Failed system call was shmget(key=5432001, size=37879808, 03600).
2009-12-15 08:37:18 EET 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 37879808 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.
                                                                         [fail]
invoke-rc.d: initscript postgresql-8.4, action "start" failed.
dpkg: error processing postgresql-8.4 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-8.4; however:
  Package postgresql-8.4 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured

This is with mainline kernel Linux sentti 2.6.32-999-generic #200912131003 SMP Sun Dec 13 10:09:58 UTC 2009 x86_64 GNU/Linux is that matters.

ProblemType: Package
Architecture: amd64
Date: Tue Dec 15 08:37:19 2009
DistroRelease: Ubuntu 10.04
ErrorMessage: subprocess installed post-installation script returned error exit status 1
Package: postgresql-8.4 8.4.2-1
SourcePackage: postgresql-8.4
Tags: lucid
Title: package postgresql-8.4 8.4.2-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
Uname: Linux 2.6.32-999-generic x86_64

Revision history for this message
Jarkko Lietolahti (jarkko-jab) wrote :
Revision history for this message
Jarkko Lietolahti (jarkko-jab) wrote :

After sudo apt-get remove --purge postgres* and reinstall this disappeared;

The following NEW packages will be installed:
  postgresql postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 136kB/5,017kB of archives.
After this operation, 18.4MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com lucid/main postgresql-client-common 102 [50.0kB]
Get:2 http://archive.ubuntu.com lucid/main postgresql-common 102 [85.8kB]
Fetched 136kB in 0s (413kB/s)
Preconfiguring packages ...
Selecting previously deselected package postgresql-client-common.
(Reading database ... 342384 files and directories currently installed.)
Unpacking postgresql-client-common (from .../postgresql-client-common_102_all.deb) ...
Selecting previously deselected package postgresql-client-8.4.
Unpacking postgresql-client-8.4 (from .../postgresql-client-8.4_8.4.2-1_amd64.deb) ...
Selecting previously deselected package postgresql-common.
Unpacking postgresql-common (from .../postgresql-common_102_all.deb) ...
Selecting previously deselected package postgresql-8.4.
Unpacking postgresql-8.4 (from .../postgresql-8.4_8.4.2-1_amd64.deb) ...
Selecting previously deselected package postgresql.
Unpacking postgresql (from .../postgresql_8.4.2-1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up postgresql-client-common (102) ...
Setting up postgresql-client-8.4 (8.4.2-1) ...
update-alternatives: using /usr/share/postgresql/8.4/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode.

Setting up postgresql-common (102) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
  en_au
  en_gb
  en_us
  en_za

Setting up postgresql-8.4 (8.4.2-1) ...
Creating new cluster (configuration: /etc/postgresql/8.4/main, data: /var/lib/postgresql/8.4/main)...
Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf to /etc/postgresql/8.4/main...
Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf to /etc/postgresql/8.4/main...
Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf to /etc/postgresql/8.4/main...
Configuring postgresql.conf to use port 5432...
update-alternatives: using /usr/share/postgresql/8.4/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
 * Starting PostgreSQL 8.4 database server [ OK ]

Setting up postgresql (8.4.2-1) ...
jarkko@sentti:/etc$

Revision history for this message
wagle (wagle) wrote :

I installed postgres, but havent done anything with it (yet).

summary: - package postgresql-8.4 8.4.2-1 failed to install/upgrade: subprocess
- installed post-installation script returned error exit status 1
+ package postgresql-8.4 8.4.2-1 failed to install/upgrade: FATAL: could
+ not create shared memory segment: Invalid argument
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

This error indicates that you need to tune you kernel's settings. It is not an error with postgresql and I'm closing this report.
However, if you're able to reproduce it from a fresh Ubuntu installation (whole system) then don't hesitate to reopen this report and provide the recipe to reproduce it.

Thanks.

Changed in postgresql-8.4 (Ubuntu):
status: New → Invalid
Revision history for this message
jack1987bobmarly (jack1988bobmarly) wrote :

i have the same problem with postgresql it give me this error

>>>>> Paramétrage de postgresql-8.4 (8.4.3-1) ...

 * Starting PostgreSQL 8.4 database server

 * The PostgreSQL server failed to start. Please check the log output:

2010-05-13 23:12:38 WEST FATAL: n'a pas pu cr?er le segment de m?moire partag?e : Argument invalide

2010-05-13 23:12:38 WEST D?TAIL: L'appel syst?me qui a ?chou? ?tait shmget(cl?=5432001, taille=36880384, 03600).

2010-05-13 23:12:38 WEST ASTUCE : Cette erreur signifie habituellement que la demande de PostgreSQL pour un

 segment de m?moire partag?e a d?pass? le param?tre SHMMAX de votre noyau.

 Vous pouvez soit r?duire la taille de la requ?te soit reconfigurer le noyau

 avec un SHMMAX plus important. Pour r?duire la taille de la requ?te

 (actuellement 36880384 octets), r?duisez le param?tre de shared_buffers de

 PostgreSQL (actuellement 4096) et/ou le param?tre max_connections

 (actuellement 103).

 Si la taille de la requ?te est d?j? petite, il est possible qu'elle soit

 moindre que le param?tre SHMMIN de votre noyau, auquel cas, augmentez la

 taille de la requ?te ou reconfigurez SHMMIN.

 La documentation de PostgreSQL contient plus d'informations sur la

 configuration de la m?moire partag?e.

   ...fail!

invoke-rc.d: initscript postgresql-8.4, action "start" failed.

dpkg : erreur de traitement de postgresql-8.4 (--configure) :

 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1

dpkg : des problèmes de dépendances empêchent la configuration de postgresql :

 postgresql dépend de postgresql-8.4 ; cependant :

 Le paquet postgresql-8.4 n'est pas encore configuré.

dpkg : erreur de traitement de postgresql (--configure) :

 problèmes de dépendances - laissé non configuré

Des erreurs ont été rencontrées pendant l'exécution :

 postgresql-8.4

 postgresql <<<<<

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

@jack1987bobmarly: See comment #4. Vous devez paramétrer votre noyau en fonction de l'usage que vous faites de la base de données.

Revision history for this message
Flavio Suligoi (flavio-suligoi) wrote :

Only a comment about kernel setting tuning, for a temporary fast solution of this problem:

echo 37879808 > /proc/sys/kernel/shmmax

You can change the shmax (the max size of shared memory segments) according the postgres request.

Flavio

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.