From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0GKxGxy7q2FiRQEAgWs5BA (envelope-from ) for ; Sat, 04 Dec 2021 20:01:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id APVcFxy7q2ESKgAAB5/wlQ (envelope-from ) for ; Sat, 04 Dec 2021 19:01:48 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D6A2125C16 for ; Sat, 4 Dec 2021 20:01:47 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0C525290E0; Sat, 4 Dec 2021 14:01:43 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9EA2C290C7 for ; Sat, 4 Dec 2021 14:01:40 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id 881D15FC42; Sat, 4 Dec 2021 14:01:40 -0500 (EST) Received: (nullmailer pid 434340 invoked by uid 1000); Sat, 04 Dec 2021 19:01:39 -0000 From: David Bremner To: "Peter J. Jones" , notmuch@notmuchmail.org Subject: Re: notmuch insert: Cannot open Xapian database (0.34.1) In-Reply-To: <87mtlg8bow.fsf@devalot.com> References: <87mtlg8bow.fsf@devalot.com> Date: Sat, 04 Dec 2021 15:01:39 -0400 Message-ID: <878rx0ry7g.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: QBSD5PZNWHNX4FTPFKYEMJX6JN54DRSS X-Message-ID-Hash: QBSD5PZNWHNX4FTPFKYEMJX6JN54DRSS X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: FR ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638644507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=3Cphhh1NhVO5ykx7Nv+JmmFP9P4lhgEb6iSei0AXDO0=; b=X8umlPAbxfmsc5+q7VrnVm0w3RNu7taEr6MA2QFh3ysbhITQS8rbPEOGMd/al/yu6Im5ZN j3wdlR07es3SLYa51IOT1uYMnsxacIzNy4FMqmWeFccor4bV4n5H6lJZAqVCYABHRpNqLB ej+PPr/0BIqsrmKQOtya4N2zadHZPrbOLL8lPZFOf5bJu1f6uct9nNAykBYRj7RdSv4op7 S11m9wKGJrJv+KPETiU5O4UQQqjDnV2wqz3pQKz6qYkf5tu7LftOmr25K6Ws7ULoCyvsDb muvj5EZiOvl9i+YVKRuCV3tua6ej3h41P1ff0S3BQhvjthOeegx1k8fSm2rvAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638644507; a=rsa-sha256; cv=none; b=KIuOUniuLFWnNKV7vWMZnkj4o4jJeWl/WhKT5Y03pm0Zz0sST/6+9GBU8tQd8yUyM2U/P6 ga238hPY7vqSARmX4zCQ7wL7r6zDr7L3NIGbyusreEGK81OlV9iLxXJ33Pmcnq5KcS8CWa JnDNfF7XSw5Rr9ySH4Ghr1ZXpUqfZG3yeRaEzffjdNliktzvXN8D2i3PIHR+evJvwtyprr 3N+dRHMHmLEeS8OOJ6fm2soP/9rytuXbwnFN9QukDOl0vY5rcp7WdK5wShHuECIwdCEWEG ERD8tYCeVwMXJW2Dc0HQnp1CQMrUyhJTRhJ3u18jnFDxOURkNHiWBSioyH6YaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.98 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: D6A2125C16 X-Spam-Score: -1.98 X-Migadu-Scanner: scn0.migadu.com X-TUID: AbX5vLx+zrbT "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?