Cannot rename init file

Lists: pgsql-cygwin
From: "Russell Black" <rblack(at)iarchives(dot)com>
To: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Cannot rename init file
Date: 2001-09-23 01:29:47
Message-ID: 018a01c143cf$3b44f230$0464a8c0@iarchives.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Last night when I ran vacuumdb, I got the following output:

Vacuuming Administrator
VACUUM
Vacuuming template1
VACUUM
Vacuuming novell
NOTICE: Cannot rename init file /cygdrive/c/pgdb/base/164966/pg_internal.init.2772 to /cygdrive/c/pgdb/base/164966/pg_internal.init: Permission denied
Continuing anyway, but there's something wrong.
VACUUM
Vacuuming usda
NOTICE: Cannot rename init file /cygdrive/c/pgdb/base/167726/pg_internal.init.3156 to /cygdrive/c/pgdb/base/167726/pg_internal.init: Permission denied
Continuing anyway, but there's something wrong.
VACUUM

I got similar errors when I tried to perform db operatons using ejb/jdbc. I restarted the postmaster and the problem went away. Has anyone else seen this?

2nd unrelated (I think) question, I am noticing something funny when I run the postmaster with -d2:

postmaster child[2828]: starting with (postgres -d2 -v131072 -p usda )
FindExec: searching PATH ...
ValidateBinary: can't stat "/cygdrive/e./postgres"
ValidateBinary: can't stat "/cygdrive/e./postgres"
FindExec: found "/usr/bin/postgres" using PATH
DEBUG: connection: host=127.0.0.1 user=Administrator database=usda

Is the ValidateBinary anything to worry about?

I'd appreciate any feedback on either of these two problems.
Thanks,

Russell


From: Jason Tishler <jason(at)tishler(dot)net>
To: Russell Black <rblack(at)iarchives(dot)com>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Cannot rename init file
Date: 2001-09-24 02:34:49
Message-ID: 20010923223449.G1904@dothill.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Russell,

On Sat, Sep 22, 2001 at 07:29:47PM -0600, Russell Black wrote:
> Last night when I ran vacuumdb, I got the following output:
>
> Vacuuming usda
> NOTICE: Cannot rename init file /cygdrive/c/pgdb/base/167726/
> pg_internal.init.3156 to /cygdrive/c/pgdb/base/167726/pg_internal.init:
> Permission denied
> Continuing anyway, but there's something wrong.
>
> I got similar errors when I tried to perform db operatons using ejb/jdbc. I
> restarted the postmaster and the problem went away. Has anyone else seen
> this?

I have seen the above when running the regression test about 9 months
ago:

http://archives.postgresql.org/pgsql-ports/2001-01/msg00068.php

But, I have not seen it in a long time -- so I *ass*umed that it was
"fixed" in Cygwin. If you can reproduce it, then please try to debug it.

BTW, are your running vacuumdb under cron or just at the command line?

> 2nd unrelated (I think) question, I am noticing something funny when I
> run the postmaster with -d2:
>
> postmaster child[2828]: starting with (postgres -d2 -v131072 -p usda )
> FindExec: searching PATH ...
> ValidateBinary: can't stat "/cygdrive/e./postgres"
> ValidateBinary: can't stat "/cygdrive/e./postgres"
> FindExec: found "/usr/bin/postgres" using PATH
> DEBUG: connection: host=127.0.0.1 user=Administrator database=usda
>
> Is the ValidateBinary anything to worry about?

I don't think so. It just sounds like you have "/cygdrive/e." in your
PATH before "/usr/bin".

Jason


From: "Russell Black" <rblack(at)iarchives(dot)com>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Cannot rename init file
Date: 2001-09-24 16:05:52
Message-ID: 01fe01c14512$c8f14ef0$0464a8c0@iarchives.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin


From: "Jason Tishler" <jason(at)tishler(dot)net>
> Russell,
>
> On Sat, Sep 22, 2001 at 07:29:47PM -0600, Russell Black wrote:
> > Last night when I ran vacuumdb, I got the following output:
> >
> > Vacuuming usda
> > NOTICE: Cannot rename init file /cygdrive/c/pgdb/base/167726/
> > pg_internal.init.3156 to /cygdrive/c/pgdb/base/167726/pg_internal.init:
> > Permission denied
> > Continuing anyway, but there's something wrong.
> >
> > I got similar errors when I tried to perform db operatons using
ejb/jdbc. I
> > restarted the postmaster and the problem went away.

It seems that to get rid of the error, I only need to close my connections
to the databases with the problem, rather than shutdown the postmaster.

>
> I have seen the above when running the regression test about 9 months
> ago:
>
> http://archives.postgresql.org/pgsql-ports/2001-01/msg00068.php
>
> But, I have not seen it in a long time -- so I *ass*umed that it was
> "fixed" in Cygwin. If you can reproduce it, then please try to debug it.

I'm unable to find a set of steps that reproduce it. It seems to happen
after the jboss server has been running (and has had a connection to the
database) for a couple of days.

>
> BTW, are your running vacuumdb under cron or just at the command line?

I'm running vacuumdb from cron every morning at 3 AM. How often should I
run vacuumdb? What exactly does it do?

In the above link, Tom Lane said
"The first backend to fire up after a vacuum will try to rebuild
pg_internal.init, and then move it into place."
Perhaps I should restart my jboss server every time I run vacuumdb, so the
files will be released.


From: Jason Tishler <jason(at)tishler(dot)net>
To: Russell Black <rblack(at)iarchives(dot)com>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Cannot rename init file
Date: 2001-09-25 13:32:41
Message-ID: 20010925093241.B1280@dothill.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Russell,

On Mon, Sep 24, 2001 at 10:05:52AM -0600, Russell Black wrote:
> From: "Jason Tishler" <jason(at)tishler(dot)net>
> > BTW, are your running vacuumdb under cron or just at the command line?
>
> I'm running vacuumdb from cron every morning at 3 AM.

Please see if you can reproduce the problem from the command line. I
have seen some "issues" with cron that I trying to track down myself.
Since cron is switching user context via NT's security APIs maybe it is
cause you some permission problems.

> How often should I run vacuumdb? What exactly does it do?

Sorry, I'm not qualified to answer the above. To be honest, I'm not very
experienced with PostgreSQL. I just submitted some patches to get 7.0.2
to build under the Cygwin Net Release and the rest is history... :,)

> In the above link, Tom Lane said
> "The first backend to fire up after a vacuum will try to rebuild
> pg_internal.init, and then move it into place."
> Perhaps I should restart my jboss server every time I run vacuumdb, so the
> files will be released.

The above sounds like a reasonable workaround -- stop jboss right before
the nightly vacuumdb. But, it would be much better to understand why
the rename is failing before resorting to workarounds. If this is truly
a problem in Cygwin, then we should try to get it fixed. Since I can no
longer reproduce the problem, I cannot attempt to debug it.

Thanks,
Jason


From: "Russell Black" <rblack(at)iarchives(dot)com>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Cannot rename init file
Date: 2001-09-25 16:52:18
Message-ID: 00ac01c145e2$700f7070$0464a8c0@iarchives.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

From: "Jason Tishler" <jason(at)tishler(dot)net>
> Russell,
>
> On Mon, Sep 24, 2001 at 10:05:52AM -0600, Russell Black wrote:
> > From: "Jason Tishler" <jason(at)tishler(dot)net>
> > > BTW, are your running vacuumdb under cron or just at the command line?
> >
> > I'm running vacuumdb from cron every morning at 3 AM.
>
> Please see if you can reproduce the problem from the command line. I
> have seen some "issues" with cron that I trying to track down myself.
> Since cron is switching user context via NT's security APIs maybe it is
> cause you some permission problems.
>

When it happened the first time, I was able to get the same behavior when I
executed vacuumdb from the command line; I don't think it's a permissions
problem, especially given the fact that the problem goes away when the
client postgres processes die. That makes is sound like it's just a matter
of one process holding open a file so that another process can't delete it.
Unfortunately, I have not found a way to consistently reproduce the problem.

>
> > In the above link, Tom Lane said
> > "The first backend to fire up after a vacuum will try to rebuild
> > pg_internal.init, and then move it into place."
> > Perhaps I should restart my jboss server every time I run vacuumdb, so
the
> > files will be released.
>
> The above sounds like a reasonable workaround -- stop jboss right before
> the nightly vacuumdb. But, it would be much better to understand why
> the rename is failing before resorting to workarounds. If this is truly
> a problem in Cygwin, then we should try to get it fixed. Since I can no
> longer reproduce the problem, I cannot attempt to debug it.

Interestingly, pgAdmin II warns before performing a VACUUM that: "Database
vacuuming should only be performed when there is no one using the database."
Maybe my "work-around" is really the way it's supposed to be done...