0

When restarting pgSQL, I get the following log entries:

2010-02-10 16:08:05 EST LOG:  received smart shutdown request
2010-02-10 16:08:05 EST LOG:  autovacuum launcher shutting down
2010-02-10 16:08:05 EST LOG:  shutting down
2010-02-10 16:08:05 EST LOG:  database system is shut down
2010-02-10 16:08:07 EST LOG:  database system was shut down at 2010-02-10 16:08:05 EST
2010-02-10 16:08:07 EST LOG:  autovacuum launcher started
2010-02-10 16:08:07 EST LOG:  database system is ready to accept connections
2010-02-10 16:08:07 EST LOG:  connection received: host=[local]
2010-02-10 16:08:07 EST LOG:  incomplete startup packet
2010-02-10 16:08:07 EST LOG:  connection received: host=[local]
2010-02-10 16:08:07 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:08 EST LOG:  connection received: host=[local]
2010-02-10 16:08:08 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:08 EST LOG:  connection received: host=[local]
2010-02-10 16:08:08 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:09 EST LOG:  connection received: host=[local]
2010-02-10 16:08:09 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:09 EST LOG:  connection received: host=[local]
2010-02-10 16:08:09 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:10 EST LOG:  connection received: host=[local]
2010-02-10 16:08:10 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:10 EST LOG:  connection received: host=[local]
2010-02-10 16:08:10 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:11 EST LOG:  connection received: host=[local]
2010-02-10 16:08:11 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:11 EST LOG:  connection received: host=[local]
2010-02-10 16:08:11 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST FATAL:  password authentication failed for user "postgres"
2010-02-10 16:08:12 EST LOG:  connection received: host=[local]
2010-02-10 16:08:12 EST LOG:  incomplete startup packet

My question regarding a potential consequence of this is posted here: https://stackoverflow.com/questions/2238954/mdb2-says-connection-failed-db-logs-say-otherwise , but I didn't realize this was happening when I asked that question, and I figured this [part of the] problem is for SF.

Edit: I can connect to the database and manipulate things normally with the psql CLI and the postgres user.

3 Answers 3

1

What's your question?

Your server is starting up perfectly fine - "database system is ready to accept connections"

As soon as it becomes ready, there are a number of attempts to connect using the "postgres" account with an invalid password, which appear to be coming from the local server.

If you're asking about these entries and they're not you, it looks like someone is doing a dictionary attack on PostgreSQL. The weird thing is it looks like the connections are coming from the local host, so they could be spoofing their source address.

I'd suggest putting a firewall in place to restrict access only to the IPs that need it.

If you're looking for an answer to anything else, you'll need to be a bit more specific.

4
  • That's the thing, everything is local only. And its always the same number of bad attempts. 5432 is not open at the router, and there are definitely no unauthorized users on the network. I assumed the software was trying to connect.
    – Alex S
    Feb 10, 2010 at 22:38
  • Your problem isn't related to the postgres server -- some other (possibly rogue) processes are involved here, and if you track those down and make them behave your mysterious log messages will go away. If you're not just using pg_ctl have you looked at the startup script? That would be my first suspect...
    – voretaq7
    Feb 10, 2010 at 23:55
  • 1
    Just a note: a firewall won't help you. [local] means the connection came in over the local Unix domain socket, not over the localhost IP interface. Feb 11, 2010 at 9:00
  • Ah good point Magnus, I never clocked on to that. In that case it's almost certainly something on your machine as opposed to the network. There is certainly something rogue here, because of the "invalid startup packet" messages, but only on a few attempts. It could be something as simple as a network monitoring system (do you have one?) checking the server is alive (although a few times a second is extremely persistent) or it could be something rogue like @voretaq7 said. Examine your top output and see if there's anything you don't recognise there. Feb 11, 2010 at 19:22
1

This looks very much like a combination of two things:

-Your pg_hba.conf is not allowing the local user "postgres" -Your rc.d script tries to grab db status by making a connection to the local db as user "postgres" to confirm startup

I'd suggest checking the rc script. If you see this is in fact what's happening, either modify the script to supply a password or modify pg_hba.conf to trust that user. Restart and see if the errors go away...

0

Someone also answered this over at stackoverflow: https://stackoverflow.com/questions/7038342/password-authentication-failed-for-user-postgres

The first answer, from Berry Langerak, solved this problem for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .