Thread: initdb fails

initdb fails

From
schopen@dimdi.de
Date:
Hello everybody,

I tried to install postgresql under cygwin on win nt 4.0 with SP6
installed. I followed the instructions in
/usr/doc/cygwin/postgresql-7.1.README.
I have replaced cygwin1.dll (1.1.8-2) by the latest snapshot (April
16) and all further steps succeeded until initdb, which fails:

bash-2.04$ bin/initdb
This database system will be initialized with username "schopen".
This user will own all the data files and must also own the server
process.

Creating directory /usr/share/postgresql/data
Creating directory /usr/share/postgresql/data/base
Creating directory /usr/share/postgresql/data/global
Creating directory /usr/share/postgresql/data/pg_xlog
Creating template1 database in /usr/share/postgresql/data/base/1
DEBUG:  database system was shut down at 2001-04-18 16:08:49
DEBUG:  CheckPoint record at (0, 8)
DEBUG:  Redo record at (0, 8); Undo record at (0, 8); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 16384
DEBUG:  database system is in production state
Creating global relations in /usr/share/postgresql/data/global
DEBUG:  database system was shut down at 2001-04-18 16:08:56
DEBUG:  CheckPoint record at (0, 112)
DEBUG:  Redo record at (0, 112); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 514; NextOid: 17199
DEBUG:  database system is in production state
Initializing pg_shadow.

initdb failed.
Removing /usr/share/postgresql/data.
Removing temp file /tmp/initdb.194.

Any help? Thanks a lot.

Michael
--
====================================================
Dr. med. Michael Schopen     Tel. +49 221 4724 325
Deutsches Institut fuer      Fax. +49 221 41 14 29
Medizinische Dokumentation
und Information DIMDI        http://www.dimdi.de
Waisenhausgasse 36-38a
D-50676 Koeln                email:s#chopen@dimdi.de
>>>   remove # to use email address   <<<
====================================================

Re: initdb fails

From
Jason Tishler
Date:
Michael,

On Wed, Apr 18, 2001 at 06:13:43PM +0200, schopen@dimdi.de wrote:
> bash-2.04$ bin/initdb
> This database system will be initialized with username "schopen".
> This user will own all the data files and must also own the server
> process.
>
> Creating directory /usr/share/postgresql/data
> [snip]
> Initializing pg_shadow.
>
> initdb failed.
> Removing /usr/share/postgresql/data.
> Removing temp file /tmp/initdb.194.
>
> Any help? Thanks a lot.

I just tried the above with the following configuration:

    NT 4.0 SP6a
    PostgreSQL 7.1-2
    cygipc 1.09-2
    Cygwin 1.1.8-2 (with cygwin1.dll replaced by cygwin1-20010416.dll.bz2)

and the initdb worked as expected.

My only suggestion is to capture the output from the following:

    $ sh -x /bin/initdb

and send the precise point in the initdb shell script where the failure
occurs to the list.  Hopefully, someone will be able to figure out what
is going wrong for you.

Jason

--
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

Re: initdb fails

From
Jason Tishler
Date:
Michael,

On Wed, Apr 18, 2001 at 01:30:04PM -0400, Jason Tishler wrote:
> On Wed, Apr 18, 2001 at 06:13:43PM +0200, schopen@dimdi.de wrote:
> > bash-2.04$ bin/initdb
> > This database system will be initialized with username "schopen".
> > This user will own all the data files and must also own the server
> > process.
> >
> > Creating directory /usr/share/postgresql/data
> > [snip]
> > Initializing pg_shadow.
> >
> > initdb failed.
> > Removing /usr/share/postgresql/data.
> > Removing temp file /tmp/initdb.194.
> >
> > Any help? Thanks a lot.
>
> I just tried the above with the following configuration:
>
>     NT 4.0 SP6a
>     PostgreSQL 7.1-2
>     cygipc 1.09-2
>     Cygwin 1.1.8-2 (with cygwin1.dll replaced by cygwin1-20010416.dll.bz2)
>
> and the initdb worked as expected.

The plot thickens or I spoke too soon.

Although initdb works, I am getting the following errors when I connect
to postmaster:

    # server side
    $ postmaster
    DEBUG:  database system was shut down at 2001-04-18 15:12:29
    DEBUG:  CheckPoint record at (0, 1563376)
    DEBUG:  Redo record at (0, 1563376); Undo record at (0, 0); Shutdown TRUE
    DEBUG:  NextTransactionId: 619; NextOid: 18720
    DEBUG:  database system is in production state
    pq_flush: send() failed: The connection was aborted
    pq_recvbuf: recv() failed: errno ESHUTDOWN triggered

    # client side
    $ psql -l
    psql: pqReadData() -- backend closed the channel unexpectedly.
            This probably means the backend terminated abnormally
            before or while processing the request.

The Cygwin snapshot from 4/13/2001 works but the one from 4/14/2001
doesn't.  I'm trying to determine why.  I will report back when I get
more information.

If anyone wants to help, please jump in.

Thanks,
Jason

--
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

Re: initdb fails

From
schopen@dimdi.de
Date:
>> On Wed, Apr 18, 2001 at 06:13:43PM +0200, schopen@dimdi.de wrote:
>> bash-2.04$ bin/initdb
>> This database system will be initialized with username "schopen".
>> This user will own all the data files and must also own the server
>> process.
>>
>> Creating directory /usr/share/postgresql/data
>> [snip]
>> Initializing pg_shadow.
>>
>> initdb failed.
>> Removing /usr/share/postgresql/data.
>> Removing temp file /tmp/initdb.194.
>>
>> Any help? Thanks a lot.

> I just tried the above with the following configuration:
>
>     NT 4.0 SP6a
>     PostgreSQL 7.1-2
>     cygipc 1.09-2
>     Cygwin 1.1.8-2 (with cygwin1.dll replaced by
> cygwin1-20010416.dll.bz2)
>
> and the initdb worked as expected.
>
> My only suggestion is to capture the output from the following:
>
>     $ sh -x /bin/initdb
>
> and send the precise point in the initdb shell script where the failure
> occurs to the list.  Hopefully, someone will be able to figure out what
> is going wrong for you.
>
> Jason

Thanks, Jason. After replacing shapshot 20010416 by 20010413 nothing changed.
Then I followed your advice and located the call in the initdb script. I removed "-o
/dev/null" from PGSQL_OPT and realized that the path to postgres was wrong:
"//bin/postgres". I called initdb with -L and everything worked fine. I think the reason
is that I have the whole cygnus stuff under c:\cygwin and not under c:\

Again thanks for your help.
Michael
--
====================================================
Dr. med. Michael Schopen     Tel. +49 221 4724 325
Deutsches Institut fuer      Fax. +49 221 41 14 29
Medizinische Dokumentation
und Information DIMDI        http://www.dimdi.de
Waisenhausgasse 36-38a
D-50676 Koeln                email:s#chopen@dimdi.de
>>>   remove # to use email address   <<<
====================================================

Re: initdb fails

From
Jason Tishler
Date:
Michael,

On Fri, Apr 20, 2001 at 08:54:41AM +0200, schopen@dimdi.de wrote:
> >> On Wed, Apr 18, 2001 at 06:13:43PM +0200, schopen@dimdi.de wrote:
> >> bash-2.04$ bin/initdb

When I first saw the above, I thought that it was strange...

> Thanks, Jason. After replacing shapshot 20010416 by 20010413 nothing changed.

I suggested using 20010413 (to the entire pgsql-cygwin list not just
you) to workaround the Cygwin AF_UNIX socket problem -- not to solve
your original problem.

> Then I followed your advice and located the call in the initdb script.
> I removed "-o /dev/null" from PGSQL_OPT and realized that the path to
> postgres was wrong:
> "//bin/postgres".

The above will be interpreted by Cygwin as a UNC path.  In this case,
Cygwin will look for share "postgres" on machine "bin".

> I called initdb with -L and everything worked fine.
> I think the reason is that I have the whole cygnus stuff under c:\cygwin
> and not under c:\

No!  It is discouraged from installing Cygwin under the root directory
of a drive.  The default is "C:\Cygwin" and I suggest that you use it.

If your Cygwin installation is set up correctly, then you should be able
to just type:

    $ initdb

Hence, I believe that you environment (i.e., PATH) is not set up
correctly.  If you cannot determine what is wrong yourself, then send
the output from cygcheck -s -r v to the Cygwin mailing list:

    cygwin@cygwin.com

Jason

--
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com