Thread: pgAgent - Log error when running

pgAgent - Log error when running

From
"Chuck"
Date:
I am running pgAgent on Debian Sarge with postgresql 8.1.4. I have run
the SQLscript and installed the tables. I have run the daemon with the
command:    /usr/bin/pgagent hostaddr=127.0.0.1 dbname=postgres user postgres

I have also tried the command:    /usr/bin/pgagent hostaddr=127.0.0.1 dbname=ec user postgres

ec is the name of my data database. The pgAgent tables have been
installed in both databases duriing my attempts to get it working.

I am getting the following error in the postgresql log everytime (every
30 seconds) pgAgent runs depending on which command I used to start
pgAgent:
2006-08-01 21:24:28.785 EDT postgres ec LOG:  could not receive data
from client: Connection reset by peer
2006-08-01 21:24:38.259 EDT postgres postgres LOG:  could not receive
data from client: Connection reset by peer

I am running pgAdmin III on Windows and I have configured and scheduled
a test job. The job indicates that it has never run and it is not
currenlty running.

Any assistance would be appreciated.

Chuck



Re: pgAgent - Log error when running

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Chuck
> Sent: 02 August 2006 02:29
> To: pgadmin-support@postgresql.org
> Subject: [pgadmin-support] pgAgent - Log error when running
>
> I am running pgAgent on Debian Sarge with postgresql 8.1.4. I have run
> the SQLscript and installed the tables. I have run the daemon with the
> command:
>      /usr/bin/pgagent hostaddr=127.0.0.1 dbname=postgres user postgres
>
> I have also tried the command:
>      /usr/bin/pgagent hostaddr=127.0.0.1 dbname=ec user postgres

Shouldn't that be:

/usr/bin/pgagent hostaddr=127.0.0.1 dbname=ec user=postgres                                                 ^

> ec is the name of my data database. The pgAgent tables have been
> installed in both databases duriing my attempts to get it working.

Only put the pgAgent objects in the 'maintenance database' ie. The one
that is specified in the connection dialog in pgAdmin (normally
postgres).

> I am getting the following error in the postgresql log
> everytime (every
> 30 seconds) pgAgent runs depending on which command I used to start
> pgAgent:
> 2006-08-01 21:24:28.785 EDT postgres ec LOG:  could not receive data
> from client: Connection reset by peer
> 2006-08-01 21:24:38.259 EDT postgres postgres LOG:  could not receive
> data from client: Connection reset by peer
>
> I am running pgAdmin III on Windows and I have configured and
> scheduled
> a test job. The job indicates that it has never run and it is not
> currenlty running.

No, it's aborting when it connects so it'll never update the stats. If
it's not the typo above, try checking the server logs for more info. You
may need to enable the connection logging options.

Regards, Dave


Re: pgAgent - Log error when running

From
"Chuck"
Date:
I assume you are thinking there is a space in the IP address. There is
not a typo in the command line that I can see.

I have enabled connection logging and this is what I now find in the
log.

Notice the port number keeps increasing by one each time. I have run
both the pgAgent startup commands so they are both trying to access the
server.

BTW, the log line format is the time, user, DB, message.


************************
2006-08-02 07:38:35.048 EDT [unknown] [unknown] LOG:  connection
received: host=127.0.0.1 port=35382
2006-08-02 07:38:35.154 EDT postgres postgres LOG:  could not receive
data from client: Connection reset by peer
2006-08-02 07:38:52.070 EDT [unknown] [unknown] LOG:  connection
received: host=127.0.0.1 port=35383
2006-08-02 07:38:52.178 EDT postgres ec LOG:  could not receive data
from client: Connection reset by peer
2006-08-02 07:39:05.450 EDT [unknown] [unknown] LOG:  connection
received: host=127.0.0.1 port=35384
2006-08-02 07:39:05.565 EDT postgres postgres LOG:  could not receive
data from client: Connection reset by peer
2006-08-02 07:39:22.480 EDT [unknown] [unknown] LOG:  connection
received: host=127.0.0.1 port=35385
2006-08-02 07:39:22.618 EDT postgres ec LOG:  could not receive data
from client: Connection reset by peer
*******************************

Chuck



Re: pgAgent - Log error when running

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Chuck
> Sent: 02 August 2006 12:49
> To: pgadmin-support@postgresql.org
> Subject: Re: [pgadmin-support] pgAgent - Log error when running
>
> I assume you are thinking there is a space in the IP address. There is
> not a typo in the command line that I can see.

No, there's a missing = sign. The format of the connection string is

param1=value1 param2=value2

So you need to change:

/usr/bin/pgagent hostaddr=127.0.0.1 dbname=postgres user postgres

To

/usr/bin/pgagent hostaddr=127.0.0.1 dbname=postgres user=postgres

> I have enabled connection logging and this is what I now find in the
> log.
>
> Notice the port number keeps increasing by one each time. I have run
> both the pgAgent startup commands so they are both trying to
> access the
> server.

That looks like it's just libpq opening the next free source socket.

Regards, Dave.


Re: pgAgent - Log error when running

From
"Chuck"
Date:
Yes, it was a typo in the message but I entered and ran the command
correctly.

Some new information. I ran the command again but used a superuser
account and added password=jjjj to the command line. My test script is
being run by pgAgent every two minutes. It shoud be running every
minute.

I know this is not the suggested method for security reasons. Any idea
what is wrong with the postgres account that woud not allow it to be
used?

Chuck



Re: pgAgent - Log error when running

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Chuck
> Sent: 02 August 2006 13:19
> To: pgadmin-support@postgresql.org
> Subject: Re: [pgadmin-support] pgAgent - Log error when running
>
> Yes, it was a typo in the message but I entered and ran the command
> correctly.
>
> Some new information. I ran the command again but used a superuser
> account and added password=jjjj to the command line. My test script is
> being run by pgAgent every two minutes. It shoud be running every
> minute.
>
> I know this is not the suggested method for security reasons. Any idea
> what is wrong with the postgres account that woud not allow it to be
> used?

The postgres account normally is a superuser account. Assuming in this
case it isn't, does it have permission to access the pgagent schema and
the postgres database? And to connect from 127.0.0.1?

As for the two minute thing, the next runtime is determined at the end
of each run, so if the job duration is greater than 1 minute but less
than two then you will get 2 minute intervals. This prevents the server
dying under load of an ever-increasing number of overlapping instances
of the same job.

The other thing to check is the poll time (-t option). If you specify
that on the command line, make sure it's less than the minimum time
between job runs. The default is 10 seconds btw.

Regards, Dave.



Re: pgAgent - Log error when running

From
"Chuck"
Date:
The job is only a simple insert command for test purposes. It takes
milliseconds to run so the the timing issue is still a question.

I have given the postgres account full access to everything. I checked
the ph_hba.conf and there is a line for the postgres account as
follows:

local all postgres ident sameuser

My installation should be a standard installation. I up until now, I
have not touched the postgres account configuration.

This is not a production system yet and I have full control over the
system.

Chuck



Re: pgAgent - Log error when running

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Chuck
> Sent: 02 August 2006 16:13
> To: pgadmin-support@postgresql.org
> Subject: Re: [pgadmin-support] pgAgent - Log error when running
>
> The job is only a simple insert command for test purposes. It takes
> milliseconds to run so the the timing issue is still a question.

OK.

> I have given the postgres account full access to everything. I checked
> the ph_hba.conf and there is a line for the postgres account as
> follows:
>
> local all postgres ident sameuser
>
> My installation should be a standard installation. I up until now, I
> have not touched the postgres account configuration.

Hmm, well there's no reason that postgres shouldn't work in a default
install. Can you run pgagent with the log level set to 2 (-l 2) and
supply the full log from startup for say 4 minutes or so of runtime.

Thanks, Dave,


Re: pgAgent - Log error when running

From
"Chuck"
Date:
After running pgAgent with the following command:

/usr/bin/pgagent -l 2 hostaddr=127.0.0.1 dbname=postgres user=postgres

The pertinent debug message said:

WARNING: Couldn't create connection: fe_sendauth: no password supplied

Why do I need a password for the postgres account when on the local
machine?

I even tried the command su - postgres to make sure the postgres
account was not corrupted. It is fine.

Chuck



Re: pgAgent - Log error when running

From
Dave Page
Date:


On 2/8/06 17:38, "Chuck" <watsocd@gmail.com> wrote:

> After running pgAgent with the following command:
> 
> /usr/bin/pgagent -l 2 hostaddr=127.0.0.1 dbname=postgres user=postgres
> 
> The pertinent debug message said:
> 
> WARNING: Couldn't create connection: fe_sendauth: no password supplied
> 
> Why do I need a password for the postgres account when on the local
> machine?

What's in pg_hba.conf? If it's just the ident line you showed me previously,
then don't forget that 'local' means a local Unix socket connection, and
*not* 127.0.0.1 which is just another host address.

Regards, Dave.