* [BUG] "Error: Cannot open database…" when loading config
@ 2023-12-03 11:07 Alyssa Ross
2023-12-03 13:34 ` David Bremner
0 siblings, 1 reply; 3+ messages in thread
From: Alyssa Ross @ 2023-12-03 11:07 UTC (permalink / raw)
To: notmuch
[-- Attachment #1.1: Type: text/plain, Size: 791 bytes --]
Since commit 1c10d91d ("Pass error message from GLib ini parser to CLI"),
when I run "notmuch config list", I get this error message at the start
of the output:
Error: Cannot open database at /home/qyliss/state/notmuch/default: No such file or directory.
Presumably this is because my database is in a non-default location,
which it doesn't know until it's loaded the config.
This is especially problematic when using compose-mail in Emacs, because
then the error message ends up mangling the new message:
From: "Error: Cannot open database at /home/qyliss/state/notmuch/default: No such file or directory.
To:
Subject:
Fcc: Sent
Alyssa Ross" <Error: Cannot open database at /home/qyliss/state/notmuch/default: No such file or directory.
hi@alyssa.is>
--text follows this line--
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] "Error: Cannot open database…" when loading config
2023-12-03 11:07 [BUG] "Error: Cannot open database…" when loading config Alyssa Ross
@ 2023-12-03 13:34 ` David Bremner
2023-12-03 15:03 ` Alyssa Ross
0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2023-12-03 13:34 UTC (permalink / raw)
To: Alyssa Ross, notmuch
Alyssa Ross <hi@alyssa.is> writes:
> Since commit 1c10d91d ("Pass error message from GLib ini parser to CLI"),
> when I run "notmuch config list", I get this error message at the start
> of the output:
>
> Error: Cannot open database at /home/qyliss/state/notmuch/default: No such file or directory.
>
> Presumably this is because my database is in a non-default location,
> which it doesn't know until it's loaded the config.
I suspect something is being reported as an error when it really isn't
(the library tries a sequence of things when starting up).
If you can tell me a bit more about your setup, I can try and duplicate
the bug. For starters, where is your config file located, and where is
your database?
You could also try the following patch, which is a bit of a wild guess
diff --git a/notmuch.c b/notmuch.c
index 814b9e42..7e396d43 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -563,7 +563,7 @@ main (int argc, char *argv[])
NULL,
¬much,
&status_string);
- if (status_string) {
+ if (status && status_string) {
fputs (status_string, stderr);
free (status_string);
status_string = NULL;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [BUG] "Error: Cannot open database…" when loading config
2023-12-03 13:34 ` David Bremner
@ 2023-12-03 15:03 ` Alyssa Ross
0 siblings, 0 replies; 3+ messages in thread
From: Alyssa Ross @ 2023-12-03 15:03 UTC (permalink / raw)
To: David Bremner; +Cc: notmuch
[-- Attachment #1.1: Type: text/plain, Size: 1777 bytes --]
David Bremner <david@tethera.net> writes:
> Alyssa Ross <hi@alyssa.is> writes:
>
>> Since commit 1c10d91d ("Pass error message from GLib ini parser to CLI"),
>> when I run "notmuch config list", I get this error message at the start
>> of the output:
>>
>> Error: Cannot open database at /home/qyliss/state/notmuch/default: No such file or directory.
>>
>> Presumably this is because my database is in a non-default location,
>> which it doesn't know until it's loaded the config.
>
> I suspect something is being reported as an error when it really isn't
> (the library tries a sequence of things when starting up).
>
> If you can tell me a bit more about your setup, I can try and duplicate
> the bug. For starters, where is your config file located, and where is
> your database?
The path to my config file is set using NOTMUCH_CONFIG.
My database is ~/mail/.notmuch, which upon further inspection I'm not
actually explicitly configuring anywhere, so I suppose it's falling back
to that after checking that there's nothing in $XDG_DATA_HOME/notmuch.
My XDG_DATA_HOME is /home/qyliss/state btw, which explains why it's
looking there.
> You could also try the following patch, which is a bit of a wild guess
>
> diff --git a/notmuch.c b/notmuch.c
> index 814b9e42..7e396d43 100644
> --- a/notmuch.c
> +++ b/notmuch.c
> @@ -563,7 +563,7 @@ main (int argc, char *argv[])
> NULL,
> ¬much,
> &status_string);
> - if (status_string) {
> + if (status && status_string) {
> fputs (status_string, stderr);
> free (status_string);
> status_string = NULL;
This didn't make a difference.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-03 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-03 11:07 [BUG] "Error: Cannot open database…" when loading config Alyssa Ross
2023-12-03 13:34 ` David Bremner
2023-12-03 15:03 ` Alyssa Ross
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).