RE: PostgreSQL 10.20 crashes / Antivirus

From: "Thomas, Richard" <Richard(dot)Thomas(at)atkinsglobal(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: PostgreSQL 10.20 crashes / Antivirus
Date: 2022-04-20 08:06:41
Message-ID: LO2P123MB509462A985A2A7A5DEEDFEE6F1F59@LO2P123MB5094.GBRP123.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver wrote:
> What are the actual commands you are using to do the above?

The command used in a PowerShell script (run with Windows task scheduler) to dump each database should evaluate to:

"C:\Program Files\PostgreSQL\10\bin\pg_dump.exe" -b -v -F c -d $dbName -h localhost -p 6488 -U backup_su -f $backupFile 2`>`&1 | Out-File $pgdumpLogFile

where:
- "backup_su" is a superuser role (with password stored in the user's pgpass.conf file)
- $backupFile and $pgdumpLogFile are in folders excluded from McAfee scanning
- pg_dump.exe executable is not excluded from McAfee on-access scanning (although as recommended postgres.exe is)

The actual script segment building the command is:

$pgdumpCmd = "C:\Program Files\PostgreSQL\10\bin\pg_dump.exe"
$pgdumpArgs = @("-b", "-v",
"-F", "c",
"-d", $dbName,
"-h", "localhost",
"-p", "6488",
"-U", " backup_su",
"-f", $backupFile)
cmd /c $pgdumpCmd $pgdumpArgs 2`>`&1 | Out-File $pgdumpLogFile

Note that the .backup file for the first failing pg_dump (after several successful ones) is now being produced but is of length 0, with the associated pg_dump log file simply reading:

pg_dump: [archiver (db)] connection to database "dbexample" failed: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 6488?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 6488?

Richard

-----Original Message-----
From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Sent: 19 April 2022 18:11
To: Thomas, Richard <Richard(dot)Thomas(at)atkinsglobal(dot)com>; pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL 10.20 crashes / Antivirus

On 4/19/22 04:59, Thomas, Richard wrote:
> A request for further suggestions for how to fix/diagnose this PG crash (having just got back from holiday I discover that PG is still crashing even though I have changed the pgdump target output location to a folder excluded from the McAfee Antivirus scanning - but thanks for the suggestion Adrian). The last few crashes have occurred only during the backup process, when database pg_dump completes (successfully - including the disconnection message in the log) but before the next database pgdump can begin (that pg_dump command gets the error that it cannot connect to the database as the server is no longer responding). This will happen after dumping several databases - sometimes it manages the complete multiple database dump fine. One new thing I've noticed is that when it fails the file access 0xC0000022 error occurs a second time when PG is trying to restart itself after shutting down all the other processes, suggesting whatever caused the crash is still around (a later manual restart works fine):

From you original post:

"... although the new pg_dump log file was created (is empty) it does not get as far as creating the .backup file ..."

What are the actual commands you are using to do the above?
At Atkins - member of the SNC-Lavalin Group, we work flexible hours around the world. Although I have sent this email at a time convenient for me, I don't expect you to respond until it works for you.
NOTICE – This email message and any attachments may contain information or material that is confidential, privileged, and/or subject to copyright or other rights. Any unauthorized viewing, disclosure, retransmission, dissemination, or other use of or reliance on this message or anything contained therein is strictly prohibited and may be unlawful. If you believe you may have received this message in error, kindly inform the sender by return email and delete this message from your system. Thank you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Huan Ruan 2022-04-20 12:17:32 PITR and Temp Tables
Previous Message Ram Pratap Maurya 2022-04-20 04:31:57 RE: Huge archive log generate in Postgresql-13