473,787 Members | 2,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Errors after power failure

After a powerfailure of 10hours I have got my database server back up and
the phpBB2 that a site uses is not working. Here is the error.

Warning: pg_connect() unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
database.lhasi. org and accepting TCP/IP connections on port 5432? in
/var/www/html/dealingwithcroh ns/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database

The machine is a RH9 box with the latest postgres running from redhat update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto fsck
so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 22 '05 #1
7 2633
Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql start.

J

da*******@bwkip .com wrote:
After a powerfailure of 10hours I have got my database server back up and
the phpBB2 that a site uses is not working. Here is the error.

Warning: pg_connect() unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
database.lhasi .org and accepting TCP/IP connections on port 5432? in
/var/www/html/dealingwithcroh ns/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database

The machine is a RH9 box with the latest postgres running from redhat update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto fsck
so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandpromp t.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #2
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.

Anyone have ideas?

-Dan

Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql
start.

J

da*******@bwkip .com wrote:
After a powerfailure of 10hours I have got my database server back up
and the phpBB2 that a site uses is not working. Here is the error.

Warning: pg_connect() unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
database.lhasi. org and accepting TCP/IP connections on port 5432? in
/var/www/html/dealingwithcroh ns/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database

The machine is a RH9 box with the latest postgres running from redhat
update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto
fsck so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of
broadcast)--------------------------- TIP 2: you can get off all lists
at once with the unregister command
(send "unregister YourEmailAddres sHere" to
ma*******@postg resql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandpromp t.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #3
Look through the postgresql log. It will tell you what's going wrong.

On Wed, Jan 14, 2004 at 05:49:57PM -0500, da*******@bwkip .com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.

Anyone have ideas?

-Dan



Sounds like you just need to delete /usr/local/pgsql/data/postmaster.pid
or /var/lib/pgsql/data/postmaster.pid and exectute service postgresql
start.

J

da*******@bwkip .com wrote:
After a powerfailure of 10hours I have got my database server back up
and the phpBB2 that a site uses is not working. Here is the error.

Warning: pg_connect() unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
database.lhasi. org and accepting TCP/IP connections on port 5432? in
/var/www/html/dealingwithcroh ns/phpBB2/db/postgres7.php on line 79
phpBB : Critical Error

Could not connect to the database

The machine is a RH9 box with the latest postgres running from redhat
update.

I have webmin on the machine which shows the databases there but i keep
getting this error
The machine didn't come up with any errors or bad blocks with the auto
fsck so i am confused.

Can anyone help?

-Dan
I am patient...its the other guys you gotta blame ;)

---------------------------(end of
broadcast)--------------------------- TIP 2: you can get off all lists
at once with the unregister command
(send "unregister YourEmailAddres sHere" to
ma*******@postg resql.org)

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandpromp t.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster





---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ (... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFABb7nY5T wig3Ge+YRAuN9AK CsvFxqm1XOdfAFv ldBOVWan9tiiQCg t0hq
3HD8q+iakJhf+Mh Ys34dtC8=
=NI5/
-----END PGP SIGNATURE-----

Nov 22 '05 #4
On Wed, 14 Jan 2004 da*******@bwkip .com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to rebuild
the server the last time this happened. Starting to be a pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #5
Heres what is get with nmap localhost

pg***********@p ostgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip .com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



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

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #6
I would suspect the manner in which it was started. Does your postresql.conf
file have tcpip_socket=tr ue?. If it is set to false and the script that
starts Postgres does not use the '-o -i' switch then the database will not
accept tcpip connections. Have you tried psql on the database host to see if
it can accept local connections via a unix socket?

On Thursday 15 January 2004 08:16 am, da*******@bwkip .com wrote:
Heres what is get with nmap localhost

pg***********@p ostgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip .com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


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

http://www.postgresql.org/docs/faqs/FAQ.html


--
Adrian Klaver
ak*****@comcast .net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 22 '05 #7
If I could kiss you I would.

Everything is working now.

Apparently an old script I had was switched and you were right...the old
script was
not starting tcp connections.... so...I enabled it in the postgresql.conf and
it is ok

Thank You

-Dan

Thanks for everyones help!!

-----Original Message-----
From: pg************* ****@postgresql .org
[mailto:pg****** ***********@pos tgresql.org]On Behalf Of Adrian Klaver
Sent: Thursday, January 15, 2004 11:19 AM
To: pg***********@p ostgresql.org
Subject: Re: [GENERAL] Errors after power failure
I would suspect the manner in which it was started. Does your
postresql.conf
file have tcpip_socket=tr ue?. If it is set to false and the script that
starts Postgres does not use the '-o -i' switch then the database will not
accept tcpip connections. Have you tried psql on the database host to see if
it can accept local connections via a unix socket?

On Thursday 15 January 2004 08:16 am, da*******@bwkip .com wrote:
Heres what is get with nmap localhost

pg***********@p ostgresql.org

[root@database root]# nmap localhost

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on database (127.0.0.1):
(The 1590 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
783/tcp open hp-alarm-mgr
1024/tcp open kdm
1025/tcp open NFS-or-IIS
6000/tcp open X11
10000/tcp open snet-sensor-mgmt

Nmap run completed -- 1 IP address (1 host up) scanned in 2 seconds
[root@database root]#

And I doublechecked to make sure postmaster was running
Here is what is in the log file
LOG: database system was shut down at 2004-01-15 11:22:01 EST
LOG: checkpoint record is at 0/AF6940
LOG: redo record is at 0/AF6940; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 2676; next oid: 25169
LOG: database system is ready

-Dan
On Wed, 14 Jan 2004 da*******@bwkip .com wrote:
I have deleted the pid and restarted the postgresql and it is starting
fine. It just appears to not be accepting connections. I had to
rebuild the server the last time this happened. Starting to be a
pain.


Firewalling maybe? Check which ports are open with nmap.
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


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

http://www.postgresql.org/docs/faqs/FAQ.html


--
Adrian Klaver
ak*****@comcast .net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4018
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
9
2880
by: Jon LaBadie | last post by:
Suppose I'm using stdio calls to write to a disk file. One possible error condition is no space on file system or even (in unix environment) a ulimit of 0 bytes. Which calls would be expected to return error codes for such conditions? Would it happen on the writes (fwrite, fprintf, fputs ...), or as they actually write to io buffers, might the errors not occur until the data is flushed or the file is closed?
4
1361
by: Claire | last post by:
I'm writing a realtime monitoring application acting as a Windows service. This service communicates to some instrumentation via a third party dll. TCP is the transport mechanism over the network. What I want to know is how should errors be handled in Windows services? I foresee problems with this sort of application, especially with the tcp side. The service should be able to recover from errors as it's going to be sited in places where...
0
1087
by: Karl Lang | last post by:
Hi I'm trying to edit pages from inside Visual Studio 2002 on a remote server Windows 2000 using FrontPage extensions. Its been working fine for quite a few weeks but since a problem with the power supplier to the machine which caused it crash I've been getting a strange problem. I can be editing pages and saving them back to the server without a problem when for no apparent reason I get the following login prompt: "This operation...
1
1081
by: John Siracusa | last post by:
We had a power failure (and a UPS failure) on our database machine. It's back up now but some spooky stuff is happening. Here's an example: (Names changed to protect the guilty.) First, the table: --- CREATE TABLE foo ( id SERIAL PRIMARY KEY,
185
17480
by: Martin Jørgensen | last post by:
Hi, Consider: ------------ char stringinput ..bla. bla. bla. do {
0
3238
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to appear on our domain controllers (Security event log): Event Type: Failure Audit Event Source: Security
6
2457
by: maxthebaz | last post by:
Our machines have this requirement: if power failure occurs, many important variables are to be resumed from where they were interrupted after the machine is restarted (power on in this case). In other words, the basic idea is to keep a snapshot of the state machine before it is interrupted. The board is provided with: - a 32-bit H8S/2633 Hitachi microprocessor; - a battery-backed memory (BBM), where these variables are stored; BBM area...
55
3330
by: lovecreatesbea... | last post by:
Do you check all error conditions for all library calls in you code? Is it necessary to check all errors? Is it convenient to check all errors (or how to make code clean and readable with mass of non business logic related code block)? The following code from net-snmp library calls atoi five times but checks none. Do we code a wrapper my_atoi_with_error_check() around atoi and call this new one everywhere else? Is it a good practice...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.