pg_dump silently fails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

pg_dump silently fails

Brandon Keepers
I've been wresting with this problem since 8.0.1 and am able to
duplicate it on 6 different installations.  If I compile postgres from
source, everything works fine.  If I install the RHEL 4 ES RPM, pg_dump
silently fails.  I've attached two straces, one from 8.0.3 RPM that
fails, and one from 8.0.1 that I compiled that doesn't fail (I didn't
recompile 8.0.3 from source, but I've experienced this with both 8.0.1
and 8.0.2, so I'm guessing it also works with 8.0.3).

In my previous conversations with Devrim, he pointed out that this looks
like the line that's causing it to fail:

fstat64(1, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbff0c6ec) = -1 ENOTTY
(Inappropriate ioctl for device)

I assumed that it was just my machine that had a problem, but since,
I've installed it on 5 other RHEL machines and every single one has had
the same problem.

Thanks,
Brandon

pg_dump-failed.txt (16K) Download Attachment
pg_dump.txt (15K) Download Attachment
signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Tom Lane-2
Brandon Keepers <[hidden email]> writes:
> I've been wresting with this problem since 8.0.1 and am able to
> duplicate it on 6 different installations.  If I compile postgres from
> source, everything works fine.  If I install the RHEL 4 ES RPM, pg_dump
> silently fails.

Is SELinux in enforcement mode, and if so does turning it off change
things?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Bruce Momjian-2
Tom Lane wrote:
> Brandon Keepers <[hidden email]> writes:
> > I've been wresting with this problem since 8.0.1 and am able to
> > duplicate it on 6 different installations.  If I compile postgres from
> > source, everything works fine.  If I install the RHEL 4 ES RPM, pg_dump
> > silently fails.
>
> Is SELinux in enforcement mode, and if so does turning it off change
> things?

Should we check for a buggy SELinux and report a meaningful error
message on failure?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  [hidden email]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Tom Lane-2
Bruce Momjian <[hidden email]> writes:
> Tom Lane wrote:
>> Is SELinux in enforcement mode, and if so does turning it off change
>> things?

> Should we check for a buggy SELinux and report a meaningful error
> message on failure?

How you intend to do that, exactly?  The bug is that it won't let you
write on /dev/tty, which puts a pretty severe crimp on *any* reporting.

(This is not as insane as it sounds: it's a reasonable security
restriction for a daemon process.  The error in older SELinux policy
files is that they think all the Postgres executables are daemons, not
only the postmaster.)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Brandon Keepers
In reply to this post by Tom Lane-2
On Tue, 2005-06-14 at 13:55 -0400, Tom Lane wrote:
> Is SELinux in enforcement mode, and if so does turning it off change
> things?

Yup, that was it.  If you disable SELinux, everything works. I tried
just commenting out line 732
in /etc/selinux/targeted/contexts/files/file_contexts and that didn't
work.  Anyone know how to correct this?

Brandon

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Bruce Momjian-2
In reply to this post by Tom Lane-2
Tom Lane wrote:

> Bruce Momjian <[hidden email]> writes:
> > Tom Lane wrote:
> >> Is SELinux in enforcement mode, and if so does turning it off change
> >> things?
>
> > Should we check for a buggy SELinux and report a meaningful error
> > message on failure?
>
> How you intend to do that, exactly?  The bug is that it won't let you
> write on /dev/tty, which puts a pretty severe crimp on *any* reporting.
>
> (This is not as insane as it sounds: it's a reasonable security
> restriction for a daemon process.  The error in older SELinux policy
> files is that they think all the Postgres executables are daemons, not
> only the postmaster.)

Throw a message to stderr saying something about SELinux.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  [hidden email]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Tom Lane-2
Bruce Momjian <[hidden email]> writes:
> Tom Lane wrote:
>> How you intend to do that, exactly?  The bug is that it won't let you
>> write on /dev/tty, which puts a pretty severe crimp on *any* reporting.

> Throw a message to stderr saying something about SELinux.

Unless stderr is pointing somewhere else than /dev/tty, this will
accomplish exactly zero ... and if it is pointing somewhere else,
then the problem doesn't arise.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [hidden email] so that your
      message can get through to the mailing list cleanly
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Tom Lane-2
In reply to this post by Brandon Keepers
Brandon Keepers <[hidden email]> writes:
> Yup, that was it.  If you disable SELinux, everything works. I tried
> just commenting out line 732
> in /etc/selinux/targeted/contexts/files/file_contexts and that didn't
> work.  Anyone know how to correct this?

I don't know very much about SELinux, but I think the stuff under
/etc/selinux is in the nature of "source code", and if you edit it
you have to do something to compile it and then load the compiled
representation into the kernel.

However, the real answer for your problem is to update to a later
version of selinux-policy-targeted.  Red Hat fixed this awhile ago...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: pg_dump silently fails

Ennio-Sr
In reply to this post by Bruce Momjian-2
* Bruce Momjian <[hidden email]> [140605, 14:00]:

> Tom Lane wrote:
> > Brandon Keepers <[hidden email]> writes:
> > > I've been wresting with this problem since 8.0.1 and am able to
> > > duplicate it on 6 different installations.  If I compile postgres from
> > > source, everything works fine.  If I install the RHEL 4 ES RPM, pg_dump
> > > silently fails.
> >
> > Is SELinux in enforcement mode, and if so does turning it off change
> > things?
>
> Should we check for a buggy SELinux and report a meaningful error
> message on failure?
>

Sorry to interfere ;)
You might be interested to know that there was a complaint about SELinux
blocking OpenOffice too. See ML '[hidden email]' June 13 'Previously
working OOo ...'
Regards,
        Ennio.
--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!"  (diceva Henry Miller) ]    (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.              )=(
 Do something you aren't good at!" (as Henry Miller used to say) ]

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [hidden email]