unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Olly Betts <olly@survex.com>
To: David Bremner <david@tethera.net>
Cc: "Peter P." <peterparker@fastmail.com>,
	notmuch@notmuchmail.org, xapian-discuss@lists.xapian.org
Subject: Re: Internal error: Message without type term
Date: Tue, 4 Jul 2023 01:20:07 +0100	[thread overview]
Message-ID: <20230704002007.GS26907@survex.com> (raw)
In-Reply-To: <873525ji5g.fsf@tethera.net>

On Mon, Jul 03, 2023 at 02:26:03PM +0200, David Bremner wrote:
> "Peter P." <peterparker@fastmail.com> writes:
> 
> > I ran xapian-check on ~/.notmuch/xapian and include its messages
> > below at the end of this mail. Everyone please forgive me for
> > pasting 1121 there. :)
> 
> H'mm. It doesn't look familiar to me, but I will check with xapian
> experts to see if the failure mode is known/fixable. I'd guess probably
> not fixable.

Currently we don't have a database fixing tool for glass databases (the
"fix" mode in xapian-check can recreate base files for the older chert
database format, but glass doesn't have these base files which
eradicated the failure mode of them sometimes getting truncated to zero
size on power failure or OS crash).

Some of the problems reported have an obvious fix, but we don't have
existing code to fix them, and some look like they are probably due to
data being overwritten so fixing everything to be consistent probably
wouldn't actually give a database that entirely matches your email
anyway.

Was this database originally created by Xapian < 1.4.22?  It looks
like it could be the result of the bug fixed in 1.4.22 with handling
commit() failure on disk full.

> >> 2)  Move the database out of the way, re-run notmuch new,
> >> and restore your state using "notmuch restore < notmuch-db.txt"
> >  
> > I'd be fine regenerating the entire database without a backup dump even,
> > I don't think there is anything in there that can't be regernerated,
> > no?
> 
> The main thing that would be lost is tags that are not synched to
> maildir flags. In the "standard" workflow "inbox" is such a tag.

If there's tag data in the database which isn't backed up or synced to
maildir flags, you may be able to rescue it using:

https://git.xapian.org/?p=xapian;a=blob;f=README.notmuch;hb=refs/heads/notmuch-tag-rescue-hack

This creates a file with the tag data in the format `notmuch restore`
expects.  I'd expect this would work for your database as the termlist
table is mostly OK.

Cheers,
    Olly

  parent reply	other threads:[~2023-07-04  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03  7:47 Internal error: Message without type term Peter P.
2023-07-03 10:34 ` David Bremner
2023-07-03 10:47   ` Peter P.
2023-07-03 12:26     ` David Bremner
2023-07-03 12:48       ` Peter P.
2023-07-04  0:20       ` Olly Betts [this message]
2023-07-04 20:37         ` Peter P.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230704002007.GS26907@survex.com \
    --to=olly@survex.com \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=peterparker@fastmail.com \
    --cc=xapian-discuss@lists.xapian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).