pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres crashed on invalid IP entry in pg_hba.conf
6+ messages / 4 participants
[nested] [flat]

* Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-16 18:36  pkalva@deg.cc
  0 siblings, 1 reply; 6+ messages in thread

From: pkalva@deg.cc @ 2005-02-16 18:36 UTC (permalink / raw)
  To: pgsql-bugs@postgresql.org; +Cc: pgsql-admin



Hi Everybody,

   Yesterday, our production database was crashed as soon as we added an invlid
entry in the pg_hba.conf file. Immediately, after the SIGHUP it tried to read
the pg_hba.conf file and it couldnt validate the IP address and restarted the
postgres server, as soon as we change the pg_hba.conf with the right entry
everything was back to normal. Attached you will see the postgres log file at
the time of the crash. Postgres version we are using is 7.4.2. Is this somekind
of bug ? if so, is it fixed in Postgres 8 ?  shouldnt it just give an error
saying invalid IP address instead of restarting postgres ?

Thanks!
Pallav 



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-16 20:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: pkalva@deg.cc
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2005-02-16 20:05 UTC (permalink / raw)
  To: pkalva@deg.cc; +Cc: pgsql-bugs@postgresql.org; pgsql-admin

pkalva@deg.cc writes:
>    Yesterday, our production database was crashed as soon as we added an invlid
> entry in the pg_hba.conf file. Immediately, after the SIGHUP it tried to read
> the pg_hba.conf file and it couldnt validate the IP address and restarted the
> postgres server, as soon as we change the pg_hba.conf with the right entry
> everything was back to normal. Attached you will see the postgres log file at
> the time of the crash. Postgres version we are using is 7.4.2.

Works fine for me in 7.4.7 ... I get log entries like this:

LOG:  invalid IP address "1727.0.0.1" in pg_hba.conf file: Unknown server error
LOG:  invalid entry in pg_hba.conf file at line 56, token "1727.0.0.1"
FATAL:  missing or erroneous pg_hba.conf file
HINT:  See server log for details.

and after I fix the pg_hba.conf file it lets me in again.  I see no crash.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-16 20:15  Pallav Kalva <pkalva@deg.cc>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Pallav Kalva @ 2005-02-16 20:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@postgresql.org; pgsql-admin

Hi Tom,

    Thanks! for the quick reply actually i forgot to attach the log file 
in my first email, the next email has the attachment, anyways here is 
the output from the log file. as you can see i have 5 numbers in the ip 
address which was a typo and postgres crashes when it reads the hba file 
with this entry. do you think this problem is specific to the 7.4.2 
version .




Feb 15 17:30:55 prod postgres[2322]: [702-1] LOG:  invalid IP address 
"100.1.100.1.50" in pg_hba.conf file: Name or service not known
Feb 15 17:30:55 prod postgres[13585]: [702-1] LOG:  server process (PID 
2322) was terminated by signal 11
Feb 15 17:30:55 prod postgres[13585]: [703-1] LOG:  terminating any 
other active server processes
Feb 15 17:30:55 prod postgres[13585]: [704-1] LOG:  all server processes 
terminated; reinitializing
Feb 15 17:30:55 prod postgres[2323]: [705-1] LOG:  database system was 
interrupted at 2005-02-15 17:30:51 EST
Feb 15 17:30:55 prod postgres[2323]: [706-1] LOG:  checkpoint record is 
at D5/796387A8
Feb 15 17:30:55 prod postgres[2323]: [707-1] LOG:  redo record is at 
D5/796387A8; undo record is at 0/0; shutdown TRUE
Feb 15 17:30:55 prod postgres[2323]: [708-1] LOG:  next transaction ID: 
146738745; next OID: 565698175
Feb 15 17:30:55 prod postgres[2323]: [709-1] LOG:  database system was 
not properly shut down; automatic recovery in progress
Feb 15 17:30:55 prod postgres[2323]: [710-1] LOG:  record with zero 
length at D5/796387E8
Feb 15 17:30:55 prod postgres[2323]: [711-1] LOG:  redo is not required
Feb 15 17:30:55 prod postgres[2324]: [705-1] FATAL:  the database system 
is starting up
Feb 15 17:30:57 prod postgres[2323]: [712-1] LOG:  database system is ready
Feb 15 17:30:59 prod postgres[2329]: [705-1] LOG:  invalid IP address 
"100.1.100.1.50" in pg_hba.conf file: Name or service not known
Feb 15 17:30:59 prod postgres[2329]: [706-1] LOG:  invalid entry in 
pg_hba.conf file at line 206, token "100.1.100.1.50"
Feb 15 17:30:59 prod postgres[2329]: [707-1] FATAL:  missing or 
erroneous pg_hba.conf file
Feb 15 17:30:59 prod postgres[2329]: [707-2] HINT:  See server log for 
details.
Feb 15 17:30:59 prod postgres[13585]: [705-1] LOG:  server process (PID 
2329) was terminated by signal 11
Feb 15 17:30:59 prod postgres[13585]: [706-1] LOG:  terminating any 
other active server processes



Tom Lane wrote:

>pkalva@deg.cc writes:
>  
>
>>   Yesterday, our production database was crashed as soon as we added an invlid
>>entry in the pg_hba.conf file. Immediately, after the SIGHUP it tried to read
>>the pg_hba.conf file and it couldnt validate the IP address and restarted the
>>postgres server, as soon as we change the pg_hba.conf with the right entry
>>everything was back to normal. Attached you will see the postgres log file at
>>the time of the crash. Postgres version we are using is 7.4.2.
>>    
>>
>
>Works fine for me in 7.4.7 ... I get log entries like this:
>
>LOG:  invalid IP address "1727.0.0.1" in pg_hba.conf file: Unknown server error
>LOG:  invalid entry in pg_hba.conf file at line 56, token "1727.0.0.1"
>FATAL:  missing or erroneous pg_hba.conf file
>HINT:  See server log for details.
>
>and after I fix the pg_hba.conf file it lets me in again.  I see no crash.
>
>			regards, tom lane
>
>  
>





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-16 20:24  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Pallav Kalva <pkalva@deg.cc>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2005-02-16 20:24 UTC (permalink / raw)
  To: Pallav Kalva <pkalva@deg.cc>; +Cc: pgsql-bugs@postgresql.org; pgsql-admin

Pallav Kalva <pkalva@deg.cc> writes:
> do you think this problem is specific to the 7.4.2 
> version .

You didn't say what platform this is, but it might be related to this
7.4.3 fix:

2004-04-24 16:10  tgl

	* src/backend/libpq/ip.c (REL7_4_STABLE): Ensure getaddrinfo_all
	returns null result on failure.

In any case, you should be on 7.4.7 on general principles.  We don't put
out dot-releases just for amusement.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-16 20:28  Pallav Kalva <pkalva@deg.cc>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Pallav Kalva @ 2005-02-16 20:28 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@postgresql.org; pgsql-admin

I am using 7.4.2 on Redhat 9 Linux 2.4. I know iam on old version, we 
are actually planning to  move to 8.0.1 soon, I just wanted to know if 
this is bug if so if it is 7.4.2 related .


Tom Lane wrote:

>Pallav Kalva <pkalva@deg.cc> writes:
>  
>
>>do you think this problem is specific to the 7.4.2 
>>version .
>>    
>>
>
>You didn't say what platform this is, but it might be related to this
>7.4.3 fix:
>
>2004-04-24 16:10  tgl
>
>	* src/backend/libpq/ip.c (REL7_4_STABLE): Ensure getaddrinfo_all
>	returns null result on failure.
>
>In any case, you should be on 7.4.7 on general principles.  We don't put
>out dot-releases just for amusement.
>
>			regards, tom lane
>
>  
>





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Postgres crashed on invalid IP entry in pg_hba.conf
@ 2005-02-21 05:05  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Pallav Kalva <pkalva@deg.cc>
  0 siblings, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2005-02-21 05:05 UTC (permalink / raw)
  To: Pallav Kalva <pkalva@deg.cc>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@postgresql.org; pgsql-admin

Pallav Kalva wrote:
> I am using 7.4.2 on Redhat 9 Linux 2.4. I know iam on old version, we 
> are actually planning to  move to 8.0.1 soon, I just wanted to know if 
> this is bug if so if it is 7.4.2 related .

You just need to stop your server, install 7.4.7 and restart.  There is
no reason to be running 7.4.2 unless you can't do 2 minutes of downtime.
Even if you upgrade to 8.0.1 you will need to do this when 8.0.2 comes
out.

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2005-02-21 05:05 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-16 18:36 Postgres crashed on invalid IP entry in pg_hba.conf pkalva@deg.cc
2005-02-16 20:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-16 20:15   ` Pallav Kalva <pkalva@deg.cc>
2005-02-16 20:24     ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-16 20:28       ` Pallav Kalva <pkalva@deg.cc>
2005-02-21 05:05         ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox