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 1qm7L1-005hqW-0c for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Sep 2023 06:50:59 +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 1qm7Ky-002Rsu-P3 for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Sep 2023 06:50:56 +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 1qm7Ky-002Rsf-FH for pgsql-bugs@lists.postgresql.org; Fri, 29 Sep 2023 06:50:56 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qm7Kr-008EJA-Cq for pgsql-bugs@lists.postgresql.org; Fri, 29 Sep 2023 06:50:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5AD335C1F9A; Fri, 29 Sep 2023 02:50:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 29 Sep 2023 02:50:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1695970247; x=1696056647; bh=6a +lAt2/2HEL4Z/soglhwaqJKfEkI76qFoiH44TON5w=; b=fMCkAplhPUJNgZVwOA OaGwGjtJx88lWwdgm1kL6E4ogUQ/UOiEdwSJAGzIwKSSiKjX6n3bUdMpO+qqeZNY Fc0Vdj6gnRS7krE/ueWiexV2PBk58Z/FO7sCJY47ZDx08yuVetM3pk996/wmq3EM 7OvxGn/pqUz8kQiPYK3Az+02l/4FpNLo4JyXb0sx01+SCzvc2GQy9ETqyBZiEFhi v3CXBkf4Z6BOvM/AEkuz6g504a7V2RkEjNW2log4cgRJV6i5Hhe/0gAuI6bXnFrr 8wYC67m/qZIydBqgsGRHMMJeuEAGkri495+7gV9QT74bRvezjgBsz0uSQzb70xC6 05Ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695970247; x=1696056647; bh=6a+lAt2/2HEL4 Z/soglhwaqJKfEkI76qFoiH44TON5w=; b=KQW5L0uovbKOIdYRB5fJIwMR5RrAf jLULFhBpnpO1/mRgtDib5kq3La/Jg/VQmHomQZU9WVHX+PKRgxu23CxvJDCUB65x 1KyK1SwNh10wTuKrmjyw/kiDSvYo1NaPZABX2acncptI5mHX+KBMO6tIgtqF0gOO RQbzF7aMJBeh4KIBBSggz0TXVP1njubHaY5Obni78tdnQVoFsQh1MLqtOpxWrtvN GpVn+H5G3c9deP7Rp+Uxtvq1nC9r3FHE03QHlynEYg+IymEI6eMYj0g7lyjPb5h7 am+uQha5O9AvDR7HoWdMy79tPBbILd+jfkmbeN0kZv2lIxmnqL55fm3sA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddugdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgeffjeevgfevuddvjedtvddt ieejheduueelvddufedtgfefjedvkeevkeeivddvnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Sep 2023 02:50:45 -0400 (EDT) Date: Fri, 29 Sep 2023 15:50:42 +0900 From: Michael Paquier To: Zhaoxun Yan Cc: pgsql-bugs@lists.postgresql.org Subject: Re: pg_rewind: ERROR: could not fetch remote file "global/pg_control": ERROR: permission denied Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y9HcRDPTOo6XHQIh" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --y9HcRDPTOo6XHQIh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 27, 2023 at 05:27:44PM +0800, Zhaoxun Yan wrote: > $ /usr/pgsql-16/bin/pg_rewind -D '/pgdata' --source-server=3D'host=3D172.= 17.1.2 > port=3D5432 user=3Drep dbname=3Drepmgr connect_timeout=3D5' > pg_rewind: error: could not fetch remote file "global/pg_control": ERROR: > permission denied for function pg_read_binary_fileOriginally the server > here at 172.17.0.2 was the primary and 172.17.1.2 was the standby > replication server. I have created the user 'rep' with full replication > privilege as described on page: > https://www.postgresql.org/docs/16/app-pgrewind.html >=20 > CREATE EXTENSION repmgr; > GRANT pg_checkpoint TO rep; > GRANT pg_read_all_stats TO rep; > GRANT EXECUTE ON function pg_catalog.pg_ls_dir(text, boolean, boolean) TO= rep; > GRANT EXECUTE ON function pg_catalog.pg_stat_file(text, boolean) TO rep; > GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text) TO rep; > GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, > bigint, boolean This set of permissions should be enough, so you got the idea from the documentation the right way. One guess: are you sure that these GRANT queries have been run on the same database as the one queried by pg_rewind when getting the files from an online source for the target cluster to rewind? -- Michael --y9HcRDPTOo6XHQIh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUWc8IACgkQnvQgOdby QH3noRAAgbehxrSGna8FlxJlRTvLFqqGhy8neV4BGoW+ByU7my1IKwVEIFYluzIT DLqGsQFGQfBlMI0POaQiLPGdTjW31oPDcCUlvtM0xFsYxj4sQbATSwtaFiZjT1oW yrYFyp1TuVqA16jtXHQ10GV31buLo7QCWF3/OQj8l6Vz0qyBv5xaOEwH/Liieu2a jDLx0Z4rhcRPIab4jKQXNGFcx+F+PV6WezxcWzodF/uG0f60FI7ug0FR2aZpgfbE oeW81kNb3jnv3KKdxQ6yFkhgEEvhXh/CJ/TaRUfhPFL/7lj8QN6lPVtlXFuiSJNo QxTkmdXyD4pLYXKKzTXeZAmPRZhH+34fR1xTiNYzGCyCU3P9B6Q2fGu3FEkH+uDM IN+CpDkauOulMEGt5RZD+zSdiK1yO8iTxLtPpZOZ46SEqOa5/u/xIyUArYJm+neo kmnP/j9JC3Pb6ZjkB4JS1jSWzQcPUQG9Ahy8JnPp96GeXW5KhDzD+VsZB/lDgdAB X4/V7qVykONytTojI5z+Kkau8UiVgd9oAHxPprDdIWtooyXZJF51jxlYllCg/MUC 6uHTtZbN95XdZyqIyJ0NcExEw5qDRWldYuEKiZZz3caK6ywhYUteQHySLkGN+nTk mEvxTV1ggi2pQakl34CLrEmShEUY7lW5a1NZjhCS7C9LWH7sSVY= =qtRh -----END PGP SIGNATURE----- --y9HcRDPTOo6XHQIh--