By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

Error on initdb with 7.4RC2

P: n/a
When running initdb on a fresh 7.4 install I get this error:

postgres@bugs:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -E
latin1
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale es_AR.

creating directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
semctl(1638435, 16, SETVAL, 536) failed: Argumento inválido

Any ideas on how to fix it?
--
11:09:01 up 23 days, 18:31, 5 users, load average: 0.46, 0.63, 0.81
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Martin Marques <ma****@bugs.unl.edu.ar> writes:
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
semctl(1638435, 16, SETVAL, 536) failed: Argumento inválido


Hmm. If it got that far and no farther, I'd guess you have SEMVMX
set too small.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

P: n/a
El Vie 14 Nov 2003 12:37, Tom Lane escribió:
Martin Marques <ma****@bugs.unl.edu.ar> writes:
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
semctl(1638435, 16, SETVAL, 536) failed: Argumento inválido


Hmm. If it got that far and no farther, I'd guess you have SEMVMX
set too small.


Is there a way of changing this value on Linux without recompiling?
I remember that on solaris I had to change a file and restart the server.

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-----------------------------------------------------------------
Martín Marqués | mm******@unl.edu.ar
Programador, Administrador, DBA | Centro de Telemática
Universidad Nacional
del Litoral
-----------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #3

P: n/a
Martin Marques <ma****@bugs.unl.edu.ar> writes:
El Vie 14 Nov 2003 12:37, Tom Lane escribió:
Hmm. If it got that far and no farther, I'd guess you have SEMVMX
set too small.
Is there a way of changing this value on Linux without recompiling?


See sysctl. But what is the current value? I've never heard of a Linux
installation with small SEMVMX.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4

P: n/a
El Dom 16 Nov 2003 15:23, Tom Lane escribió:
Martin Marques <ma****@bugs.unl.edu.ar> writes:
El Vie 14 Nov 2003 12:37, Tom Lane escribió:
Hmm. If it got that far and no farther, I'd guess you have SEMVMX
set too small.

Is there a way of changing this value on Linux without recompiling?


See sysctl. But what is the current value? I've never heard of a Linux
installation with small SEMVMX.


martin@bugs:~/latex$ cat /proc/sys/kernel/sem
250 32000 32 128

This is a Linux Kernel for SPARC (Debian) that came with the distribution (no
recompile done yet here).

martin@bugs:~/latex$ uname -a
Linux bugs 2.4.21 #1 Thu Aug 7 20:30:12 EDT 2003 sparc64 GNU/Linux

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-----------------------------------------------------------------
Martín Marqués | mm******@unl.edu.ar
Programador, Administrador, DBA | Centro de Telemática
Universidad Nacional
del Litoral
-----------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #5

P: n/a
Martin Marques <ma****@bugs.unl.edu.ar> writes:
El Dom 16 Nov 2003 15:23, Tom Lane escribió:
See sysctl. But what is the current value? I've never heard of a Linux
installation with small SEMVMX.
martin@bugs:~/latex$ cat /proc/sys/kernel/sem
250 32000 32 128 This is a Linux Kernel for SPARC (Debian) that came with the distribution (no
recompile done yet here).


As far as I can tell, SEMVMX isn't readable or writable via /proc or
sysctl in Linux at all; at least it is not visible in my Red Hat 8.0
installation. So it's really hard to see why it'd be different in
your installation than everywhere else.

Just to make sure we're barking up the right tree, would you see whether
it helps to change this line in src/backend/port/sysv_sema.c:

#define PGSemaMagic 537 /* must be less than SEMVMX */

Try making it 100 or so instead of 537.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #6

P: n/a
El Dom 16 Nov 2003 16:56, escribió:
Martin Marques <ma****@bugs.unl.edu.ar> writes:
El Dom 16 Nov 2003 15:23, Tom Lane escribió:
See sysctl. But what is the current value? I've never heard of a Linux
installation with small SEMVMX.
martin@bugs:~/latex$ cat /proc/sys/kernel/sem
250 32000 32 128

This is a Linux Kernel for SPARC (Debian) that came with the distribution

(no recompile done yet here).


As far as I can tell, SEMVMX isn't readable or writable via /proc or
sysctl in Linux at all; at least it is not visible in my Red Hat 8.0
installation. So it's really hard to see why it'd be different in
your installation than everywhere else.

Just to make sure we're barking up the right tree, would you see whether
it helps to change this line in src/backend/port/sysv_sema.c:

#define PGSemaMagic 537 /* must be less than SEMVMX */

Try making it 100 or so instead of 537.


Same problem. Changed it and I got this:

bugs:/home/martin/basura/postgresql-7.4RC2# su - postgres
postgres@bugs:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -E
latin1
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
semctl(7766033, 16, SETVAL, 99) failed: Invalid argument

initdb: failed
initdb: removing data directory "/usr/local/pgsql/data"
Now the interesting part of all this is that, with all the initdb that failed,
lots of semaphores where been used, so when I tried this last initdb at first
I got this, which looks like I'm out of semaphores, not as in the message
from above:

postgres@bugs:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -E
latin1
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL: could
not create semaphores: No space left on device
DETAIL: Failed system call was semget(129, 17, 03600).
HINT: This error does *not* mean that you have run out of disk space.
It occurs when either the system limit for the maximum number of
semaphore sets (SEMMNI), or the system wide maximum number of semaphores
(SEMMNS), would be exceeded. You need to raise the respective kernel
parameter. Alternatively, reduce PostgreSQL's consumption of semaphores by
reducing its max_connections parameter (currently 10).
The PostgreSQL documentation contains more information about
configuring your system for PostgreSQL.

initdb: failed
initdb: removing data directory "/usr/local/pgsql/data"
--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-----------------------------------------------------------------
Martín Marqués | mm******@unl.edu.ar
Programador, Administrador, DBA | Centro de Telemática
Universidad Nacional
del Litoral
-----------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.