Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJNwa-0008HI-EB for pgsql-general@arkaria.postgresql.org; Mon, 08 Mar 2021 22:01:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJNwZ-0007yR-C1 for pgsql-general@arkaria.postgresql.org; Mon, 08 Mar 2021 22:01:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJNwZ-0007yJ-4B for pgsql-general@lists.postgresql.org; Mon, 08 Mar 2021 22:01:39 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJNwV-0001PE-JD for pgsql-general@postgresql.org; Mon, 08 Mar 2021 22:01:37 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 91C541D75; Tue, 9 Mar 2021 00:01:30 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id btvIjvsLM3Le; Tue, 9 Mar 2021 00:01:28 +0200 (EET) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 3BB621D6F; Tue, 9 Mar 2021 00:01:28 +0200 (EET) Subject: Re: Log files polluted with permission denied error messages after every 10 seconds To: Thomas Munro , Michael Paquier Cc: Laurenz Albe , pgsql-general References: <3861ff1e-0923-7838-e826-094cc9bef737@hot.ee> <676dc946300076e60d6af455ac1bfa489fbbdd8b.camel@cybertec.at> <97e00b3b-9357-4386-d4bd-b9128e4b8924@hot.ee> From: Andrus Message-ID: <073ce1f0-689e-2ca8-1dbf-288b3be617ed@hot.ee> Date: Tue, 9 Mar 2021 00:01:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------40174A3C41B257BFE3D1F3CA" Content-Language: et List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------40174A3C41B257BFE3D1F3CA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit > Another thought: if it's not a sharing violation, I wonder if we > should consider dumping more raw Windows error information in the > messages we log, because, if I recall correctly, we're converting many > Windows error codes into few Unix-style error numbers and thereby > throwing away valuable clues. It makes it a bit more confusing when > trying to ask a Windows expert what might be happening. Knowing process name holding file and other detailed information would be very useful. In other Win 2019 server/Postgres 13  excluding Postgres drive from fprot scan seems to decrease those errors. However they still occur even if no fprot is active. There are also regular stat errors in windows servers is size queries  like ERROR: could not stat file "base/45010/172654232": Permission denied; in query SELECT pg_size_pretty(pg_database_size('eeva')::bigint)::char(10) as size and ERROR: could not stat file "base/45010/172654232": Permission denied; in query     SELECT pg_catalog.pg_size_pretty(SUM(         CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')             THEN pg_catalog.pg_database_size(d.datname)             ELSE 0         END)::bigint) ::char(50) AS SIZE     FROM pg_catalog.pg_database d and ERROR: could not stat file "base/45010/172654232": Permission denied;Error while executing the query     SELECT d.datname::char(15),          pg_catalog.pg_get_userbyid(d.datdba)::char(18) AS Owner,         CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')             THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)::bigint)             ELSE 'No Access'         END::char(50) AS SIZE     FROM pg_catalog.pg_database d         ORDER BY         CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')             THEN pg_catalog.pg_database_size(d.datname)             ELSE NULL         END DESC -- nulls first Andrus. --------------40174A3C41B257BFE3D1F3CA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Another thought: if it's not a sharing violation, I wonder if we
should consider dumping more raw Windows error information in the
messages we log, because, if I recall correctly, we're converting many
Windows error codes into few Unix-style error numbers and thereby
throwing away valuable clues.  It makes it a bit more confusing when
trying to ask a Windows expert what might be happening.

Knowing process name holding file and other detailed information would be very useful.

In other Win 2019 server/Postgres 13  excluding Postgres drive from fprot scan seems to decrease those errors.

However they still occur even if no fprot is active.

There are also regular stat errors in windows servers is size queries  like

ERROR: could not stat file "base/45010/172654232": Permission denied;

in query

SELECT pg_size_pretty(pg_database_size('eeva')::bigint)::char(10) as size

and

ERROR: could not stat file "base/45010/172654232": Permission denied;

in query

    SELECT
pg_catalog.pg_size_pretty(SUM(   
        CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')
            THEN pg_catalog.pg_database_size(d.datname)
            ELSE 0
        END)::bigint) ::char(50) AS SIZE
    FROM pg_catalog.pg_database d

and

ERROR: could not stat file "base/45010/172654232": Permission denied;Error while executing the query


    SELECT d.datname::char(15),
         pg_catalog.pg_get_userbyid(d.datdba)::char(18) AS Owner,
        CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')
            THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)::bigint)
            ELSE 'No Access'
        END::char(50) AS SIZE
    FROM pg_catalog.pg_database d
        ORDER BY
        CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')
            THEN pg_catalog.pg_database_size(d.datname)
            ELSE NULL
        END DESC -- nulls first

Andrus.

--------------40174A3C41B257BFE3D1F3CA--