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 1ppA2q-0006Dd-Qk for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Apr 2023 15:48:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ppA2p-0003Vd-6D for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Apr 2023 15:48:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ppA0M-0007kQ-1i for pgsql-bugs@lists.postgresql.org; Wed, 19 Apr 2023 15:45:58 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ppA0I-003r5E-Ub for pgsql-bugs@lists.postgresql.org; Wed, 19 Apr 2023 15:45:57 +0000 Received: by mail-qt1-x831.google.com with SMTP id u37so8568196qtc.10 for ; Wed, 19 Apr 2023 08:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681919152; x=1684511152; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=dACQmrreD/a45vqZIU13BPVo9856YUI55DwcFdtqZuw=; b=gefU3athwqqqzqqCVRIpAarq8jkogrYY4wGv7znsTukFpheBVSDCqmBFnIMqBd/cPP +1cL34dSXr2WuDyHMctmVTOuQ+VWMZiT7pQ1n2c6ntIlfsgegits4EARgaZzQ/ZaAmfA TX5rdkfnTfMkdXH/x+qLjWGWJYDHpND4DniNAXtq3WZw9ryOjqjwSB9uc1sGOIag+DER NuxLBI4Ff/iLDh9HRQe3zqqxJlYNVvqJCaMn6lhQwht39ItAgvFrpfUkA5fxtpHdjuwD AvhtyJGyL94a47TRPvqbOvd72GPSf33M2RnS/xg89zZ9MUn+Mvm+Xowu/8A410pDkH3j 1pvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681919152; x=1684511152; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dACQmrreD/a45vqZIU13BPVo9856YUI55DwcFdtqZuw=; b=Xr3y5V4VEaVJ54Omb+1iWLxaJ88SVusVceaIeOOtud+xovc01pUFZQoS6rVyueL/aP OPF1ZUQ0pfC/HK9gfGJ2mMU/uW62RqhC0Sh2mOxJEYwCEdy07U3o8qSSC2X0HMB+7Qeq W7sI2Guj8yZfRnm/0YALv/CCB0x7OMxVC4VlZXxxTsc6Pc9TyVgOTgWSyLrZpAJQB4zl /bgw6i0EEVCBx+mZSz2YQiIj5bmboHpV0NU4uy7C3rmP+ZfRx57VlrJEZVZ5LEwTa6G6 GYUH7dTaDL91OGW6RGx+b9yQtRJREqognbCtOuGKDiQdOs8RedYoiJooZcrlwhN7oUbr UqLA== X-Gm-Message-State: AAQBX9c4RLO4+LDGp2zJfEO6Uth1h/R58WCWpaJwnv7tRUi/LIgGZ8kX M/rwnT0ouL6EZo5/BvVcjvFpDYPqMs0= X-Google-Smtp-Source: AKy350bzshKjHzaI4d8J/7uqT9Hb6K0vty1ziBZkfq/yeolXS7KsEy6x73gvBc02eq2UgMW/2Yn+tQ== X-Received: by 2002:a05:622a:4d1:b0:3ef:3d3f:17a2 with SMTP id q17-20020a05622a04d100b003ef3d3f17a2mr7101678qtx.68.1681919152326; Wed, 19 Apr 2023 08:45:52 -0700 (PDT) Received: from smtpclient.apple (d24-150-84-218.home.cgocable.net. [24.150.84.218]) by smtp.gmail.com with ESMTPSA id t12-20020a05622a148c00b003eddd355c37sm3135592qtx.34.2023.04.19.08.45.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2023 08:45:52 -0700 (PDT) From: Mark Guertin Content-Type: multipart/alternative; boundary="Apple-Mail=_0485CBE3-A563-4B87-944A-31F3A6E18406" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: pg_basebackup: errors on macOS on directories with ".DS_Store" files Message-Id: Date: Wed, 19 Apr 2023 11:45:51 -0400 To: pgsql-bugs@lists.postgresql.org X-Mailer: Apple Mail (2.3696.120.41.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_0485CBE3-A563-4B87-944A-31F3A6E18406 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii pg_basebackup: error: backup failed: ERROR: invalid segment number 0 in = file ".DS_Store" This one is pretty self explanatory. When running pg_basebackup on = macOS it should probably be ignoring any .DS_Store files found inside = data directories instead of transferring/processing them. Steps to reproduce: - on a macOS based pg server open a directory containing pg data files = and set any kind of view options or move an icon - this can also happen with inheritance, so even if you do not directly = set these kinds of options on data folders, for example if a parent = folder has a view option set when a new folder is created it can inherit = the same view options, or if spotlight search sets up some metadata this = .DS_Store may also be created My workaround was to manually delete all of the .DS_Store files that the = OS created and then immediately run pb_basebackup using the following = method: find -iname .DS_Store -exec rm {} \; Some background on .DS_Store files: https://en.wikipedia.org/wiki/.DS_Store= --Apple-Mail=_0485CBE3-A563-4B87-944A-31F3A6E18406 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

pg_basebackup: error: = backup failed: ERROR: invalid segment number 0 in file = ".DS_Store"

This one is pretty self explanatory. =  When running pg_basebackup on macOS it should probably be ignoring = any .DS_Store files found inside data directories instead of = transferring/processing them.

Steps to reproduce:
- on a macOS based = pg server open a directory containing pg data files and set any kind of = view options or move an icon
- this can also happen = with inheritance, so even if you do not directly set these kinds of = options on data folders, for example if a parent folder has a view = option set when a new folder is created it can inherit the same view = options, or if spotlight search sets up some metadata this .DS_Store may = also be created

My workaround was to manually delete all of the .DS_Store = files that the OS created and then immediately run pb_basebackup using = the following method:

find <dir> -iname = .DS_Store -exec rm {} \;

Some = background on .DS_Store files:

= --Apple-Mail=_0485CBE3-A563-4B87-944A-31F3A6E18406--