Unix Technical Forum

unstable postgres on freebsd

This is a discussion on unstable postgres on freebsd within the Pgsql General forums, part of the PostgreSQL category; --> Hi, I seem to have an unstable/unreliable installation of postgresql, and I'm not sure how to troubleshoot it. Symptoms: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 11:59 AM
Wes Sheldahl
 
Posts: n/a
Default unstable postgres on freebsd

Hi,

I seem to have an unstable/unreliable installation of postgresql, and I'm
not sure how to troubleshoot it.

Symptoms:
$ psql postgres
psql: FATAL: semctl(851974, 3, SETVAL, 0) failed: Invalid argument

(restart postgresql)
$ psql postgres
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
(rest of welcome message and psql prompt)

It will work fine for a while, but later it will stop accepting connections
with the above error, until I restart postgresql again. It also happens when
I call a ruby script that connects to postgres: fails with same error
message sometimes, but works after restarting postgresql.

Versions/Environment:
Postgresql 8.1.4 (installed from ports on FreeBSD 6.1)

I've already tried reinstalling the postgresql81-server and
postgresql81-client ports and their dependencies via portupgrade, but the
symptoms persist. What else should I try?

--
Wes Sheldahl
wes.sheldahl@gmail.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 12:00 PM
Marc G. Fournier
 
Posts: n/a
Default Re: unstable postgres on freebsd

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Are you running this in a FreeBSD jail under 6.1? It sounds like the problem
that I had where a second postmaster starts up and stomp's on the previous
postgresql's shared memory ...

To "fix", you have to make sure that both instances run as different UIDs, so
that one can't stomp on the other ...

- --On Friday, October 20, 2006 17:05:53 -0400 Wes Sheldahl
<wes.sheldahl@gmail.com> wrote:

> Hi,
>
> I seem to have an unstable/unreliable installation of postgresql, and I'm not
> sure how to troubleshoot it.
>
> Symptoms:
> $ psql postgres
> psql: FATAL: semctl(851974, 3, SETVAL, 0) failed: Invalid argument
>
> (restart postgresql)
> $ psql postgres
> Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
> (rest of welcome message and psql prompt)
>
> It will work fine for a while, but later it will stop accepting connections
> with the above error, until I restart postgresql again. It also happens when
> I call a ruby script that connects to postgres: fails with same error message
> sometimes, but works after restarting postgresql.
>
> Versions/Environment:
> Postgresql 8.1.4 (installed from ports on FreeBSD 6.1)
>
> I've already tried reinstalling the postgresql81-server and
> postgresql81-client ports and their dependencies via portupgrade, but the
> symptoms persist. What else should I try?
>
> --
> Wes Sheldahl
> wes.sheldahl@gmail.com




- ----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy@hub.org MSN . scrappy@hub.org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFOtuu4QvfyHIvDvMRAkUhAKChtw+L12z8UJhYfl8Hfb zRm0kdoQCbBzjo
aK5Pas9/HWfhjFNKMwnagXw=
=35KQ
-----END PGP SIGNATURE-----


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 12:00 PM
Tom Lane
 
Posts: n/a
Default Re: unstable postgres on freebsd

"Wes Sheldahl" <wes.sheldahl@gmail.com> writes:
> I seem to have an unstable/unreliable installation of postgresql, and I'm
> not sure how to troubleshoot it.
> Symptoms:
> $ psql postgres
> psql: FATAL: semctl(851974, 3, SETVAL, 0) failed: Invalid argument


AFAICS the only documented reason for that semctl to fail would be if
someone had removed the SysV semaphores that Postgres creates for itself
at startup. Is it possible you've got some script on the loose that
periodically tries to clean out all the semaphores in the system? Try
comparing the output of "ipcs -s" just after starting Postgres with the
output after this symptom appears.

It's probably worth asking if you've seen any other flaky behavior on
this box --- if so I'd kinda wonder about bad RAM or some such.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 12:01 PM
Wes Sheldahl
 
Posts: n/a
Default Re: unstable postgres on freebsd

Yes, it's a VPS running FreeBSD 6.1, so presumably it's in a FreeBSD jail.
I'll verify that with my hosting provider and probably follow up along these
lines. http://www.postgresql.org/docs/8.1/i...rces.htmlseems
to recommend running as different uid's as well. Right now it's
running as pgsql, UID 70, which I'm sure is the default. Thanks,

Wes Sheldahl


On 10/21/06, Marc G. Fournier <scrappy@hub.org> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Are you running this in a FreeBSD jail under 6.1? It sounds like the
> problem
> that I had where a second postmaster starts up and stomp's on the previous
> postgresql's shared memory ...
>
> To "fix", you have to make sure that both instances run as different UIDs,
> so
> that one can't stomp on the other ...
>
> - --On Friday, October 20, 2006 17:05:53 -0400 Wes Sheldahl
> <wes.sheldahl@gmail.com> wrote:
>
> > Hi,
> >
> > I seem to have an unstable/unreliable installation of postgresql, and

> I'm not
> > sure how to troubleshoot it.
> >
> > Symptoms:
> > $ psql postgres
> > psql: FATAL: semctl(851974, 3, SETVAL, 0) failed: Invalid argument
> >
> > (restart postgresql)
> > $ psql postgres
> > Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
> > (rest of welcome message and psql prompt)
> >
> > It will work fine for a while, but later it will stop accepting

> connections
> > with the above error, until I restart postgresql again. It also happens

> when
> > I call a ruby script that connects to postgres: fails with same error

> message
> > sometimes, but works after restarting postgresql.
> >
> > Versions/Environment:
> > Postgresql 8.1.4 (installed from ports on FreeBSD 6.1)
> >
> > I've already tried reinstalling the postgresql81-server and
> > postgresql81-client ports and their dependencies via portupgrade, but

> the
> > symptoms persist. What else should I try?
> >
> > --
> > Wes Sheldahl
> > wes.sheldahl@gmail.com

>
>
>
> - ----
> Marc G. Fournier Hub.Org Networking Services (http://www.hub.org
> )
> Email . scrappy@hub.org MSN . scrappy@hub.org
> Yahoo . yscrappy Skype: hub.org ICQ . 7615664
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (FreeBSD)
>
> iD8DBQFFOtuu4QvfyHIvDvMRAkUhAKChtw+L12z8UJhYfl8Hfb zRm0kdoQCbBzjo
> aK5Pas9/HWfhjFNKMwnagXw=
> =35KQ
> -----END PGP SIGNATURE-----
>
>



--
Wes Sheldahl
Sheldahl Consulting LLC
http://www.sheldahlconsulting.com
Phone: 859-338-3349
Fax: 866-387-4484
wes@sheldahlconsulting.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com