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 1u8lle-00BJDc-Dm for pgsql-admin@arkaria.postgresql.org; Sat, 26 Apr 2025 20:04:54 +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 1u8llc-0068Ua-L7 for pgsql-admin@arkaria.postgresql.org; Sat, 26 Apr 2025 20:04:53 +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 1u8llc-0068SV-8T for pgsql-admin@lists.postgresql.org; Sat, 26 Apr 2025 20:04:53 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8llZ-002Dmv-0w for pgsql-admin@lists.postgresql.org; Sat, 26 Apr 2025 20:04:52 +0000 Received: by mail-ej1-x643.google.com with SMTP id a640c23a62f3a-ac2bb7ca40bso589206066b.3 for ; Sat, 26 Apr 2025 13:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745697889; x=1746302689; 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=21yTirW0rLoBDh3xpLrDPFMrVduzM8CXiONBuSQawT8=; b=UR6pjd3oAUrfL9QzrYogxTbCdLmlOyKv6XRnsa2DeUN4/T8jS9ZqCnESdfNKeNmSJx 2MCgeZtmQBPJbemQhhOJt6XsnpKy5omaKs6ulvfWrxPLwCgFObJ2tk3oKS6+P57osxun jIUb6zId3Je3opy2c10fjUsjcl30Q364G9ynxZrLuuB91NpcRHLSHhRQLr63XQ38EoTK CiLvafWbLjJTk4IhPf+2o5Z8VCGxVU/2pAvWIAeEHDrqHJVSs2NUWR2HupETA+uyEp+X LfeAokJ0gPs0ZnnakPyGr2AjSEET6OsjxD1MdkyFI4xNO5ZZHOqYg4uVu9noqSPjo5VK IojA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745697889; x=1746302689; 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=21yTirW0rLoBDh3xpLrDPFMrVduzM8CXiONBuSQawT8=; b=qsJdCqrhCxOHHZtqVYNCs264cElTC5M00duKFl1wZMd8vUhIPWSmrgeT/dCjJLNE9c 3z1KGJ+dIDNunTs9iZ7n3pyWZmX7vZ3ceiXx/EFTx0AqdC9VvleXWNgU3L/c5fp+VYXC sbZNJ8hn+Hn2ItBoJ63z5bPTXAC4EADGsTp90JfKux4b4TzljbHgwh5RcYY7bH43Nx67 VOwVhFzWMTtJfMoA1t7C0cYP2MpE7ZpPuKbfeiIZDRFa6WSoYQ1TlKx9GQ3qXtrumoay /S0R0L8ox7ooLFzuQL5LG638Zg2lcmVCm34KMy40OkAcKIx0y7mT59etcsWlOLyTEMfC 7HgQ== X-Gm-Message-State: AOJu0YyOMvRFupeYw/qQWhDw7aoCxCfkvk8FPOYZjDgWRW+akgQL/+g/ JH+Q7Zru8FRb9iWJe8GJn94EeKdPJEPT0x/O6NpNLuntqh3PjBQ8pN7+sXh+9DT4NU40CQT0VAx xZuE4LsO7o/WPLYTIN0HMEI1zBvd/QwDV X-Gm-Gg: ASbGncsnToJ7lUYZRMl7hArsOYNYyjLN8231/olAXkHcP3c+wdCXXoAs/L4fvCEMtwz h9NNFeBHw8aGhWDRfK5SS65YxIwQZvusLvpktDPyJKtRVsXgIWgEmNpNY4Ly4LJFo+oHhlVF/iq UuOswFNDHSfFPThxQzm7mkm7Tp048UOcs= X-Google-Smtp-Source: AGHT+IFfO2gW9BapT15VE/lZvoalwvpmK1PQW06usF6rW81o9XnT0h9i+h6v1EQv/msFU5y9L8FhsKbDXXQfn61yv30= X-Received: by 2002:a17:907:84a:b0:ace:55d8:227d with SMTP id a640c23a62f3a-ace73b469fbmr668750766b.54.1745697889079; Sat, 26 Apr 2025 13:04:49 -0700 (PDT) MIME-Version: 1.0 References: <870ee861-8c1c-4979-846a-e9e507ca60f2@quadratum-braccas.com> In-Reply-To: <870ee861-8c1c-4979-846a-e9e507ca60f2@quadratum-braccas.com> From: Vijaykumar Jain Date: Sun, 27 Apr 2025 01:34:37 +0530 X-Gm-Features: ATxdqUHubBm75REO0igGWs3lRifApp5LEjED1dArrcoM6nSCjbjk-qcAs7Otk-E Message-ID: Subject: Re: Intermittent missing chunk ERRORS To: Sbob Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000009057b90633b3f6ed" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009057b90633b3f6ed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable a lot in this gist is something you can debug to start with. https://gist.github.com/supix/80f9a6111dc954cf38ee99b9dedf187a if not the index than the toast table might be corrupt. the bigger problem might be to figure out how it got corrupt. a one off power incident, or bug or storage is having issues etc. once that is clear, a simple start would be to run a pg_dump of the database to /dev/null and check if the dump is clean without errors. Thanks, Vijay Open to work Resume - Vijaykumar Jain On Sat, Apr 26, 2025, 10:39=E2=80=AFPM Sbob wr= ote: > All; > > > I am working with a client, they have an app that is running into error's > like this: > > > *SQL Error [XX001]: ERROR: missing chunk number 0 for toast value 4491547= 7 > in pg_toast_5321896 * > > > I thought it was a corruption / REINDEX issue, however I have run > REINDEXon the index, REINDEX on the table and even a reindexdb on the > database. Today they passed me another error (the one above) and once I w= as > able to login I ran the same query the app team referenced and it ran > without any errors. I asked them to re-run the query and they informed me > that it now works for them as well. > > > I assume that if this were a corrupt index issue then the query would > continue to fail every time. > > Has anyone seen this type of intermittent index error before? and thought= s > on where to look /how to debug this? > > > Thanks in advance > > > --0000000000009057b90633b3f6ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
a lot in this gist is something you can= debug to start with.

=
if not the index than the toast table might be = corrupt.
the bigger problem might be to figure out h= ow it got corrupt. a one off power incident, or bug or storage is having is= sues etc.
once that is clear,
a simple start would be to run a pg_dump of the database to /dev/null and = check if the dump is clean without errors.

Thanks,
Vijay
Open to work
Resume -=C2=A0Vijaykumar Jain
<= /div>
On Sat, Apr 26, 2025, 10:39=E2=80=AFPM Sbob <sbob@quadratum-braccas.com> = wrote:
=20 =20 =20

All;


I am working with a client, they have an app that is running into error's like this:

SQL Error [XX001]: ERROR: missing chunk number 0 for toast value 44915477 in pg_toast_5321896


I thought it was a corruption / REINDEX issue, however I have run REINDEXon the index, REINDEX on the table and even a reindexdb on the database. Today they passed me another error (the one above) and once I was able to login I ran the same query the app team referenced and it ran without any errors. I asked them to re-run the query and they informed me that it now works for them as well.


I assume that if this were a corrupt index issue then the query would continue to fail every time.

Has anyone seen this type of intermittent index error before? and thoughts on where to look /how to debug this?


Thanks in advance


--0000000000009057b90633b3f6ed--