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 1rnhKM-00Eb4p-25 for pgsql-general@arkaria.postgresql.org; Fri, 22 Mar 2024 16:01:06 +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 1rnhKI-004vCJ-Vo for pgsql-general@arkaria.postgresql.org; Fri, 22 Mar 2024 16:01:03 +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 1rnhKI-004vCB-Jp for pgsql-general@lists.postgresql.org; Fri, 22 Mar 2024 16:01:03 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rnhKB-005vyL-Sk for pgsql-general@lists.postgresql.org; Fri, 22 Mar 2024 16:01:02 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-55a179f5fa1so3237951a12.0 for ; Fri, 22 Mar 2024 09:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711123255; x=1711728055; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CfgVoZeib+UQNXyED2oR84gVkQqhWWs9MsPBWnCBOnE=; b=eYY8hLms1lQEu1kXw4ujFN/pFmbP0nsgh3NVWvl6AgHb7Is+67dhZT+D05ysmTAgbx gGWJlrMtyMUIK7tOFLQezJrdGBF4mAGvfSdO6V/45ru9vbZ7aVBsegj6lfI5px3wcG2y V11mh7m5tDmgI0O/Z9EYFHkBEfrIpdWS3JD2XadlJ1mal+z0eZ2xA7jtnq9+7I0wZa5a 3y/fHA01sJUE7yDBmUXl9pfhDhcbpMTdbJbil1WJ7v3zaWVleeg7hNWkFQahKMDVoMFZ p1/W3zJuBlWI3Z9Kpfom4s6JA/x+MZ8dhXZxeLvPdQLaLNS8ORzi6UyzLzmevYvkT0W6 aTLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711123255; x=1711728055; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CfgVoZeib+UQNXyED2oR84gVkQqhWWs9MsPBWnCBOnE=; b=UO8qSqqS6gYGfu8f45r2KRWRgwhGZxHrN+fRpHrkAg5g1j5Ziiu0u+dzeaC/3/tHW+ BOOb9Nk2jorILxwplwnXgZpNSftMpQMumOqN7p30yHDx2CtnkzoO/l1JdHM7nPvCF4Yn Zg+wQ5aHQ0HUCxLtrgBnEoA11lQTu+vSliBLBAnc6A5db/3B3tcOFenn+LfX3P8veuIr eD7IRtEX2tQR2DL3cwWZt+ZCdDF4mz9dGSTPG9dLFPvwma4XKiaBKHSvK0nyiB6Xal7F oWD3jAgNm1UyvEJgOBZj93IrKSEA1l9nGBkpB+AxD7/cr6Ux/sZywpHnOJBhGrURgHby ykxQ== X-Gm-Message-State: AOJu0YxHJ5mZGDaOIIQqc5qZlC0uTadeZ2NSXU0m4X+pYVurRegj0mXW hr8fW+G7rzm9Sjyjsdd1UUSbm1uurX32060YdOpmTIi1kqW2ksI8burgG+jnIlz9MpFZVRXdwWB MdXQKOxrEIbCnci/GwCQZr+2KryDuk1lWaMQ= X-Google-Smtp-Source: AGHT+IETYvl/E2WWAiuXLrElcw4iH+k8CsN6DKXWab4yGsC5iQHunjTHC5tLg7lSBlPYjIdPOJscZSZxg/FCHWCfKN4= X-Received: by 2002:a50:cd17:0:b0:566:41f4:a0ea with SMTP id z23-20020a50cd17000000b0056641f4a0eamr2063253edi.37.1711123254725; Fri, 22 Mar 2024 09:00:54 -0700 (PDT) MIME-Version: 1.0 References: <4D67E594-098F-4234-87D8-68F827AF2531@arcict.com> <2E2F11F8-718A-4E6A-81E0-4F5CC1F1273A@arcict.com> <19556056-40E7-4FA3-A2A1-0A345AEBFD9E@arcict.com> <76FAACAC-F64A-43DA-BDBF-340A40C47045@arcict.com> In-Reply-To: <76FAACAC-F64A-43DA-BDBF-340A40C47045@arcict.com> From: Alban Hertroys Date: Fri, 22 Mar 2024 17:00:43 +0100 Message-ID: Subject: Re: could not open file "global/pg_filenode.map": Operation not permitted To: Nick Renders Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000c3d352061441ed3b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c3d352061441ed3b Content-Type: text/plain; charset="UTF-8" On Fri, 22 Mar 2024 at 15:01, Nick Renders wrote: > > We now have a second machine with this issue: it is an Intel Mac mini > running macOS Sonoma (14.4) and PostgreSQL 16.2. > This one only has a single Data directory, so there are no multiple > instances running. > I don't think that having a single Data directory prevents multiple instances from running. That's more of a matter of how often pg_ctl was called with the start command for that particular data directory. > I installed Postgres yesterday and restored a copy from our live database > in the Data directory. How did you restore that copy? Was that a file-based copy perhaps? Your files may have incorrect owners or permissions in that case. > The Postgres process started up without problems, but after 40 minutes it > started throwing the same errors in the log: > > 2024-03-21 11:49:27.410 CET [1655] FATAL: could not open file > "global/pg_filenode.map": Operation not permitted > 2024-03-21 11:49:46.955 CET [1760] FATAL: could not open file > "global/pg_filenode.map": Operation not permitted > 2024-03-21 11:50:07.398 CET [965] LOG: could not open file > "postmaster.pid": Operation not permitted; continuing anyway > It's possible that some other process put a lock on these files. Spotlight perhaps? Or TimeMachine? > I stopped and started the process, and it continued working again until > around 21:20, when the issue popped up again. I wasn't doing anything on > the machine at that time, so I have no idea what might have triggered it. > > Is there perhaps some feature that I can enable that logs which processes > use these 2 files? > IIRC, MacOS comes shipped with the lsof command, which will tell you which processes have a given file open. See man lsof. -- If you can't see the forest for the trees, Cut the trees and you'll see there is no forest. --000000000000c3d352061441ed3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, 22 Mar 2024 at 15:01, Nick Render= s <postgres@arcict.com> wr= ote:

We now have a second machine with this issue: it is an Intel Mac mini runni= ng macOS Sonoma (14.4) and PostgreSQL 16.2.
This one only has a single Data directory, so there are no multiple instanc= es running.

I don't think that havi= ng a single Data directory prevents multiple instances from running. That&#= 39;s more of a matter of how often pg_ctl was called with the start command= for that particular data directory.
=C2=A0
I installed Postgres yesterday and restored a copy from our live database i= n the Data directory.

How did you restore t= hat copy? Was that a file-based copy perhaps? Your files may have incorrect= owners or permissions in that case.
=C2=A0
The Postgres process started up with= out problems, but after 40 minutes it started throwing the same errors in t= he log:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 2024-03-21 11:49:27.410 CET [1655] FATAL:=C2=A0= could not open file "global/pg_filenode.map": Operation not perm= itted
=C2=A0 =C2=A0 =C2=A0 =C2=A0 2024-03-21 11:49:46.955 CET [1760] FATAL:=C2=A0= could not open file "global/pg_filenode.map": Operation not perm= itted
=C2=A0 =C2=A0 =C2=A0 =C2=A0 2024-03-21 11:50:07.398 CET [965] LOG:=C2=A0 co= uld not open file "postmaster.pid": Operation not permitted; cont= inuing anyway

It's possible that so= me other process put a lock on these files. Spotlight perhaps? Or TimeMachi= ne?
=C2=A0
I stopped and started the process, and it continued working again until aro= und 21:20, when the issue popped up again. I wasn't doing anything on t= he machine at that time, so I have no idea what might have triggered it.
Is there perhaps some feature that I can enable that logs which processes u= se these 2 files?

IIRC, MacOS comes shipped with the l= sof command, which will tell you which processes have a given file open. Se= e man lsof.

-- <= br>
If you can't see the fore= st for the trees,
Cut the trees and you'll see there is no forest.
--000000000000c3d352061441ed3b--