Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRxr5-00AU0F-L5 for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 17:13:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rRxr4-005dpg-Cc for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 17:13:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRxSM-0058Jz-3f for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 16:47:31 +0000 Received: from ms11p00im-hyfv17281201.me.com ([17.58.38.39]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRxSJ-0039Se-B1 for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 16:47:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osss.net; s=sig1; t=1705942043; bh=yzGUcjenYrbkzel7HHq3X5pRHHc6diI/KeZEWOrLduo=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=CH9s7X8UNnwcY/kH+kBl1XuiH6YNm/gORcqc1iU6MDFlvFi0iZ4bOy1sGiMcQomZv 8xvDbgZQWc04DVScQhGBCNDLC5jNrEJwyP1IrgpD0SD62iDd2WFxMRTvYfIMSXOEyg 3YoHEienWDiBo6Byaul0QpzB+75PSQ02HBxLxLXKiw/poCzl2MYupnRLJW0UavmhfE 0UpG39JVf+XOmCgZegWYzME+SDh1TpWD0T251fopn3Yy6lJYlKJlYaea4ARSf5/sTj ILVGdTRgd3K7JjZ/JKC2Py7JHx4gASLetczftIRCodQrzd6i39VsHq8bVg75V2oCvD 5e7GbVKFlNrzw== Received: from smtpclient.apple (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-hyfv17281201.me.com (Postfix) with ESMTPSA id 98B42C80383 for ; Mon, 22 Jan 2024 16:47:21 +0000 (UTC) From: c@osss.net Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Misleading/inaccurate error message from pg_basebackup Message-Id: <8C23AFD9-4FCA-4FFD-8611-1B81BACCD25A@osss.net> Date: Mon, 22 Jan 2024 11:47:09 -0500 To: pgsql-bugs@lists.postgresql.org X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Proofpoint-ORIG-GUID: BYRxIItnfjpWAqhcbhNqYlZhU9av9mz7 X-Proofpoint-GUID: BYRxIItnfjpWAqhcbhNqYlZhU9av9mz7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-22_07,2024-01-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 clxscore=1030 phishscore=0 mlxlogscore=703 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2401220116 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk pg_basebackup can throw an error which is inaccurate and misleading: $ mkdir /var/lib/postgresql/14 $ ls -ld /var/lib/postgresql/14 drwxr-x--- 2 postgres postgres 6 Jan 22 16:08 /var/lib/postgresql/14 $ pg_basebackup --version Error: /var/lib/postgresql/14/main is not accessible; please fix the = directory permissions (/var/lib/postgresql/14/ should be world readable) Reading that error suggests that I need to make the directory = /var/lib/postgresql/14 world-readable, but doing so does not fix the = problem, as the actual problem is that the main subdirectory does not = exist: $ chmod a+rx /var/lib/postgresql/14 $ ls -ld /var/lib/postgresql/14 drwxr-xr-x 2 postgres postgres 6 Jan 22 16:08 /var/lib/postgresql/14 $ pg_basebackup --version Error: /var/lib/postgresql/14/main is not accessible; please fix the = directory permissions (/var/lib/postgresql/14/ should be world readable) In fact it does not need to be world readable at all - the subdirectory = just needs to be created: $ chmod o-rx /var/lib/postgresql/14 $ mkdir /var/lib/postgresql/14/main $ ls -ld /var/lib/postgresql/14{,/main} drwxr-x--- 3 postgres postgres 19 Jan 22 16:14 /var/lib/postgresql/14 drwxr-x--- 2 postgres postgres 6 Jan 22 16:14 = /var/lib/postgresql/14/main $ pg_basebackup --version pg_basebackup (PostgreSQL) 14.10 (Ubuntu 14.10-1.pgdg20.04+1) This check is being done in cases where it's unnecessary, as it = shouldn't matter at all when running a simple --version or --help, = anyways. --=20 Regards, Casey=