Failed to run initdb - not resolved bug 5130

Started by Tomas Studvaover 16 years ago9 messagesbugs
Jump to latest
#1Tomas Studva
tstudva@gmail.com

Hi all gurus,

I've encountered on my computer this bug. I will try to describe all what I
have discovered till now.

1, this bug happened a few times before and wasn't resolved:
bug 5130 -
http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg24810.html
bug 5222 -
http://archives.postgresql.org/pgsql-bugs/2009-12/msg00004.php
bug 4691 -
http://archives.postgresql.org/pgsql-bugs/2009-03/msg00028.php
? - http://forums.enterprisedb.com/posts/list/1845.page
I think the problem was always the same.

My case is WIN XP SP 2 and also when applied SP3. My system has only one
speciality as I know, that is I have windows installed on F partition.

Problem description:

I tried install with one click installer, it ends with error
postgresql.conf not found. In log it is failing on initdb, which clears
data dir after failure. Uninstaller is not working, do nothing when
runned. When run installation again, then upgrade mode is run, because
installation is found. This can be tricked by deleting installation from
registry and deleting win service, then new install is possible.

I was installing on path F:\Program Files\PostgreSQL\8.4 and also tried
C:\Program Files\PostgreSQL\8.4, problem is probably not with install
path.

OK, what more I have tried. MS Visuall C++ redistr. I uninstalled, so
the one with postgres comming were installed surely. I tried to enable
debug output, but it gives no new information. I was reading initdb sources
and problem is probably in this part, because I see message
"selecting default max_connections " then one error message. It
looks for me as snprintf is not executed or reached or etc.

-----------------------------------------------------------------------------
printf(_("selecting default max_connections ... "));
fflush(stdout);

for (i = 0; i < connslen; i++)
{
test_conns = trial_conns[i];
test_buffs = MIN_BUFS_FOR_CONNS(test_conns);

snprintf(cmd, sizeof(cmd),
SYSTEMQUOTE "\"%s\" --boot -x0 %s "
"-c max_connections=%d "
"-c shared_buffers=%d "
"< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
backend_exec, boot_options,
test_conns, test_buffs,
DEVNULL, DEVNULL);
status = system(cmd);
if (status == 0)
{
ok_buffers = test_buffs;
break;
}
}
if (i >= connslen)
i = connslen - 1;
n_connections = trial_conns[i];

printf("%d\n", n_connections);
-----------------------------------------------------------------------------

Now I am out of ideas, I can try to install some older version of
postgres, but i had some problems also with that (but it is not
important for this). I want to install this new version. Can u help me
please?

Sincerely Tomas Studva.

Attachments:

initdb_full_console.logtext/plain; name=initdb_full_console.logDownload
#2John R Pierce
pierce@hogranch.com
In reply to: Tomas Studva (#1)
Re: Failed to run initdb - not resolved bug 5130

Tomas Studva wrote:

My case is WIN XP SP 2 and also when applied SP3. My system has only
one speciality as I know, that is I have windows installed on F
partition.
....
I was installing on path F:\Program Files\PostgreSQL\8.4 and also
tried C:\Program Files\PostgreSQL\8.4, problem is probably not with
install path.

try a path without a space in it. I put mine on D:\Postgresql_84\

#3Tomas Studva
tstudva@gmail.com
In reply to: John R Pierce (#2)
Re: Failed to run initdb - not resolved bug 5130

It is not working also for dir "F:Programs\PostgreSQL".

Tomas

John R Pierce wrote:

Tomas Studva wrote:

My case is WIN XP SP 2 and also when applied SP3. My system has only
one speciality as I know, that is I have windows installed on F
partition.
....
I was installing on path F:\Program Files\PostgreSQL\8.4 and also
tried C:\Program Files\PostgreSQL\8.4, problem is probably not with
install path.

try a path without a space in it. I put mine on D:\Postgresql_84\

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

--
View this message in context: http://old.nabble.com/Failed-to-run-initdb---not-resolved-bug-5130-tp26996830p26997575.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

#4Craig Ringer
craig@2ndquadrant.com
In reply to: John R Pierce (#2)
Re: Failed to run initdb - not resolved bug 5130

John R Pierce wrote:

Tomas Studva wrote:

My case is WIN XP SP 2 and also when applied SP3. My system has only
one speciality as I know, that is I have windows installed on F
partition.
....
I was installing on path F:\Program Files\PostgreSQL\8.4 and also
tried C:\Program Files\PostgreSQL\8.4, problem is probably not with
install path.

try a path without a space in it. I put mine on D:\Postgresql_84\

That _really_ shouldn't make a difference - and if it does, it's a bug.

I've had no issues with spaces in paths here.

--
Craig Ringer

#5Robert Haas
robertmhaas@gmail.com
In reply to: Tomas Studva (#1)
Re: Failed to run initdb - not resolved bug 5130

2010/1/2 Tomas Studva <tstudva@gmail.com>:

Hi all gurus,

I've encountered on my computer this bug. I will try to describe all what I
have discovered till now.

1, this bug happened a few times before and wasn't resolved:
  bug 5130 -
http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg24810.html
  bug 5222 - http://archives.postgresql.org/pgsql-bugs/2009-12/msg00004.php
  bug 4691 - http://archives.postgresql.org/pgsql-bugs/2009-03/msg00028.php
  ? - http://forums.enterprisedb.com/posts/list/1845.page
I think the problem was always the same.

My case is WIN XP SP 2 and also when applied SP3. My system has only one
speciality as I know, that is I have windows installed on F partition.

Problem description:

I tried install with one click installer, it ends with error postgresql.conf
not found. In log it is failing on initdb, which clears data dir after
failure. Uninstaller is not working, do nothing when runned. When run
installation again, then upgrade mode is run, because installation is found.
This can be tricked by deleting installation from registry and deleting win
service, then new install is possible.

I was installing on path F:\Program Files\PostgreSQL\8.4 and also tried
C:\Program Files\PostgreSQL\8.4, problem is probably not with install path.

OK, what more I have tried. MS Visuall C++ redistr. I uninstalled, so the
one with postgres comming were installed surely. I tried to enable debug
output, but it gives no new information. I was reading initdb sources and
problem is probably in this part, because I see message "selecting default
max_connections " then one error message. It looks for me as snprintf is not
executed or reached or etc.

-----------------------------------------------------------------------------
  printf(_("selecting default max_connections ... "));
  fflush(stdout);

  for (i = 0; i < connslen; i++)
  {
      test_conns = trial_conns[i];
      test_buffs = MIN_BUFS_FOR_CONNS(test_conns);

      snprintf(cmd, sizeof(cmd),
               SYSTEMQUOTE "\"%s\" --boot -x0 %s "
               "-c max_connections=%d "
               "-c shared_buffers=%d "
               "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
               backend_exec, boot_options,
               test_conns, test_buffs,
               DEVNULL, DEVNULL);

Are you able to compile from source? If so, can you hack this part to
print the value of cmd at this point, so you can see clearly exactly
what it's trying unsuccessfully to do?

...Robert

#6Thomas Specker
gradgis.specker@bluewin.ch
In reply to: Robert Haas (#5)
Re: Failed to run initdb - not resolved bug 5130

Hi all
after a long time of trying to install PostgreSQL with ...

Computer:

- Windows2000 (Jurassic Parc, I know ...)

- PostGreSQL 8.3.9 and msi-file
or PostGreSQL 8.4.2 and one click installer

- Data in
/8.4/data (default path)
or D:\PostgresDaten (with 1 level)
or D:\Postgres\PostgreSQLDaten (parent dir createt by me)

Testing race:
The result of all rounds is always the same:

- Installation:
runns through, but is not complete with error, when trying to initate
the db: no postgresql.conf-file.
The programdirectorys under c:\Programme\PostgreSQL\8.4 (or 8.3) are
created and seem to be complete.
But there are no datadirectorys or datafiles createt.

- Running directly initdb.exe:
stops with error "access denied" when trying to create something (for
the template database) in \PostgreSQLDaten\base\1\.
(\bin\initdb.exe -U postgres -D D:\Postgres\PostgreSQLDaten -W -n
The parameter -n prevents from deleting of the createt files/dirs in
case of errors.)

Some datadirectorys, a postgresql.conf-file, a PG_VERSION-file, others
*.conf-files are createt but the
\base and \base\1\ are empty.

- running pg_ctl.exe to start the server:
complains about missing file pg_control and stopps.
(\bin\pg_ctl.exe start -w -t 10 -D D:\Postgres\PostgreSQLDaten -l
D:\Postgres\PostgreSQLKonfigInfos\logfile02.txt.
Error in logfile is: D:/Postgres/PostgreSQLDaten/global/pg_control ...
No such file or directory.
This pg_ctl.exe wants the path- and filenames written exactly, with
upper and lower cases. Only pg_ctl.exe ?)

Somme more results:

- In windows, the createt datadirectorys belong to the windows-user
"thomas", with permissions for "administrator" and "postgres",
but not allways (I missed to register this in every round of the race ...).
- When running the initdb.exe without parameter -n, it allways could
remove all artefacts.
- on http://forums.enterprisedb.com/posts/list/1802.page can be seen,
that running initdb.exe sometimes works.
- The Windows-user postgres can create files and dirs in [\data]\base\1\.

Diagnosis:

The initdb is not allowed write to [\data]\base\1\ ("access denied"),
but could create it.
It is most likely, that the bug is inside initdb.exe.
You can guess, that there is a conflict between windows-permissions and
db-permissions.
Windows-version, PostgreSQL-version, paths, locals, ... all seem not to
matter.

... I now must hope.

Thomas Specker

If somebody has an installation with a SMALL, empty, and working
data-section including the template-db, this could be tested (if just
copying is possible).

#7Robert Haas
robertmhaas@gmail.com
In reply to: Thomas Specker (#6)
Re: Failed to run initdb - not resolved bug 5130

On Tue, Jan 12, 2010 at 8:04 AM, Thomas Specker
<gradgis.specker@bluewin.ch> wrote:

Hi all
after a long time of trying to install PostgreSQL with ...

Computer:

- Windows2000 (Jurassic Parc, I know ...)

 -   PostGreSQL 8.3.9 and msi-file
 or PostGreSQL 8.4.2 and one click installer

- Data in
   /8.4/data                     (default path)
 or D:\PostgresDaten              (with 1 level)
 or D:\Postgres\PostgreSQLDaten   (parent dir createt by me)

Testing race:
The result of all rounds is always the same:

- Installation:
runns through, but is not complete with error, when trying to initate the
db: no postgresql.conf-file.
The programdirectorys under c:\Programme\PostgreSQL\8.4 (or 8.3) are created
and seem to be complete.
But there are no datadirectorys or datafiles createt.

- Running directly initdb.exe:
stops with error "access denied" when trying to create something (for the
template database) in \PostgreSQLDaten\base\1\.
(\bin\initdb.exe -U postgres -D D:\Postgres\PostgreSQLDaten -W -n
The parameter -n prevents from deleting of the createt files/dirs in case of
errors.)

Some datadirectorys, a postgresql.conf-file, a PG_VERSION-file, others
*.conf-files are createt but the
\base and \base\1\ are empty.

- running pg_ctl.exe to start the server:
complains about missing file pg_control and stopps.
(\bin\pg_ctl.exe start -w -t 10 -D D:\Postgres\PostgreSQLDaten -l
D:\Postgres\PostgreSQLKonfigInfos\logfile02.txt.
Error in logfile is: D:/Postgres/PostgreSQLDaten/global/pg_control ... No
such file or directory.
This pg_ctl.exe wants the path- and filenames written exactly, with upper
and lower cases. Only pg_ctl.exe ?)

Somme more results:

- In windows, the createt datadirectorys belong to the windows-user
"thomas", with permissions for "administrator" and "postgres",
but not allways (I missed to register this in every round of the race ...).
- When running the initdb.exe without parameter -n, it allways could remove
all artefacts.
- on http://forums.enterprisedb.com/posts/list/1802.page can be seen, that
running initdb.exe sometimes works.
- The Windows-user postgres can create files and dirs in [\data]\base\1\.

Diagnosis:

The initdb is not allowed write to [\data]\base\1\ ("access denied"), but
could create it.
It is most likely, that the bug is inside initdb.exe.
You can guess, that there is a conflict between windows-permissions and
db-permissions.
Windows-version, PostgreSQL-version, paths, locals, ... all seem not to
matter.

... I now must hope.

Thomas Specker

If somebody has an installation with a SMALL, empty, and working
data-section including the template-db, this could be tested (if just
copying is possible).

This email is interesting in that it has a Reply-To header pointing to
"robertmhaas@gmail.com". I haven't had any replies, but I wonder why
the poster thought that they should come to me.

On the actual content of the email, there's not really enough here for
anyone to begin speculating what the problem might be. Including the
actual error logs instead of summaries of what they contain would
probably be a good idea. The contention that "Windows-version,
PostgreSQL-version, path, locals, ... all seem not to matter" does not
seem likely to be true, because this does work for other people. But
without knowing specifically what was tried, it's hard for anyone to
help.

...Robert

#8Tomas Studva
tstudva@gmail.com
In reply to: Robert Haas (#5)
Re: Failed to run initdb - not resolved bug 5130

Hi,
I have some time now. I've tried to compile postgres from CVS but wihout
success. I don't have visual studio 2005 installed so I've tried eclipse +
MinGw. I checked out postgres from cvs branch "REL8_4_STABLE". But I wasn't
able to compile it. I don't know how to configure builders to launch
makefiles or what to do.

Any help will be apprecciated and write in-depth receipe, I am not a C/C++
developer (I am Java oriented).

Tomas

Robert Haas wrote:

2010/1/2 Tomas Studva <tstudva@gmail.com>:

Hi all gurus,

I've encountered on my computer this bug. I will try to describe all what
I
have discovered till now.

1, this bug happened a few times before and wasn't resolved:
  bug 5130 -
http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg24810.html
  bug 5222 -
http://archives.postgresql.org/pgsql-bugs/2009-12/msg00004.php
  bug 4691 -
http://archives.postgresql.org/pgsql-bugs/2009-03/msg00028.php
  ? - http://forums.enterprisedb.com/posts/list/1845.page
I think the problem was always the same.

My case is WIN XP SP 2 and also when applied SP3. My system has only one
speciality as I know, that is I have windows installed on F partition.

Problem description:

I tried install with one click installer, it ends with error
postgresql.conf
not found. In log it is failing on initdb, which clears data dir after
failure. Uninstaller is not working, do nothing when runned. When run
installation again, then upgrade mode is run, because installation is
found.
This can be tricked by deleting installation from registry and deleting
win
service, then new install is possible.

I was installing on path F:\Program Files\PostgreSQL\8.4 and also tried
C:\Program Files\PostgreSQL\8.4, problem is probably not with install
path.

OK, what more I have tried. MS Visuall C++ redistr. I uninstalled, so the
one with postgres comming were installed surely. I tried to enable debug
output, but it gives no new information. I was reading initdb sources and
problem is probably in this part, because I see message "selecting
default
max_connections " then one error message. It looks for me as snprintf is
not
executed or reached or etc.

-----------------------------------------------------------------------------
  printf(_("selecting default max_connections ... "));
  fflush(stdout);

  for (i = 0; i < connslen; i++)
  {
      test_conns = trial_conns[i];
      test_buffs = MIN_BUFS_FOR_CONNS(test_conns);

      snprintf(cmd, sizeof(cmd),
               SYSTEMQUOTE "\"%s\" --boot -x0 %s "
               "-c max_connections=%d "
               "-c shared_buffers=%d "
               "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
               backend_exec, boot_options,
               test_conns, test_buffs,
               DEVNULL, DEVNULL);

Are you able to compile from source? If so, can you hack this part to
print the value of cmd at this point, so you can see clearly exactly
what it's trying unsuccessfully to do?

...Robert

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

--
View this message in context: http://old.nabble.com/Failed-to-run-initdb---not-resolved-bug-5130-tp26996830p27330525.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In reply to: Tomas Studva (#8)
Re: Failed to run initdb - not resolved bug 5130

Tomas Studva escreveu:

I have some time now. I've tried to compile postgres from CVS but wihout
success. I don't have visual studio 2005 installed so I've tried eclipse +
MinGw. I checked out postgres from cvs branch "REL8_4_STABLE". But I wasn't
able to compile it. I don't know how to configure builders to launch
makefiles or what to do.

Take a look at [1]http://wiki.postgresql.org/wiki/Working_with_Eclipse[2]http://www.postgresql.org/docs/faqs.FAQ_MINGW.html.

[1]: http://wiki.postgresql.org/wiki/Working_with_Eclipse
[2]: http://www.postgresql.org/docs/faqs.FAQ_MINGW.html

--
Euler Taveira de Oliveira
http://www.timbira.com/