Re: notmuch insert: Cannot open Xapian database (0.34.1)

Subject: Re: notmuch insert: Cannot open Xapian database (0.34.1)

Date: Sat, 04 Dec 2021 15:01:39 -0400

To: Peter J. Jones,


From: David Bremner

"Peter J. Jones" <> writes:

> I can see in `notmuch.c` that the insert command doesn't have the
> `NOTMUCH_COMMAND_DATABASE_CREATE` bit set, so this is the expected
> behavior in 0.34 and was probably a bug in 0.31.  However, I would argue
> that it's useful to create the database in this situation.

I have no real objection to that happening; I'm not sure if it would
break anything. 

> In my tests I bootstrap a new VM with an account that has no mail yet.
> Then mail comes in via Dovecot which is handed off to `notmuch insert`,
> which fails.  On my end I can fix the test by running `notmuch new`
> before Dovecot calls `notmuch insert`.
> The second issue is that if the `.notmuch` directory exists, but the
> `.notmuch/xapian` directory doesn't, `notmuch new/insert` will fail:
> files first, then notmuch is run to test mail delivery and indexing.
> This seemed to work in 0.31 (notmuch would just create a new database).
> Would it be okay to change `notmuch_database_create_with_config` to
> create a new database if `.notmuch` exists but `.notmuch/xapian`
> doesn't?

There is many different options for database location possible in 0.32
that were not possible in 0.31.  It might be a bit trickier to make this
change (without compromising something else) than the previous one.

Perhaps migrating to XDG database locations (see notmuch-config(1) for
details) would be an option for you?

notmuch mailing list --
To unsubscribe send an email to