Inconsistency between tag database and notmuch search

classic Classic list List threaded Threaded
5 messages Options
ngkabra ngkabra
Reply | Threaded
Open this post in threaded view
|

Inconsistency between tag database and notmuch search


I've managed to get my notmuch tag database in an inconsistent
state and
can't figure out how to fix it. Because of this I have "unread"
messages sitting in my inbox permanently and I can't get rid of
them.

Specifically, I have a few threads/messages that don't have any
tags,
but still show up in notmuch search for those tags. And using
notmuch tag to remove (or add) any tags on these threads has no
effect. Doing a `notmuch compact` does not fix this issue.

(I believe I managed to do this by running some notmuch commands
while a
`xapian-compact` was running in the background.)

Here are some commands that demonstrate the problem:

    ~$ notmuch --version
    notmuch 0.23.5

    ~$ notmuch search thread:0000000000058ca0
    thread:0000000000058ca0  February 22 [1/1] Mandar Joshi;
    Announcing TiECon Pune 2017 - Pune's largest, most energizing
    startup event! ()

    ~$ notmuch search thread:0000000000058ca0 and tag:inbox
    thread:0000000000058ca0  February 22 [1/1] Mandar Joshi;
    Announcing TiECon Pune 2017 - Pune's largest, most energizing
    startup event! ()

    ~$ notmuch tag -inbox thread:0000000000058ca0

    ~$ notmuch search thread:0000000000058ca0
    thread:0000000000058ca0  February 22 [1/1] Mandar Joshi;
    Announcing TiECon Pune 2017 - Pune's largest, most energizing
    startup event! ()

    ~$ notmuch tag +inbox thread:0000000000058ca0

    ~$ notmuch search thread:0000000000058ca0
    thread:0000000000058ca0  February 22 [1/1] Mandar Joshi;
    Announcing TiECon Pune 2017 - Pune's largest, most energizing
    startup event! ()


As you can see from the `()` at the end of the notmuch search
output, this thread has no tags associated with it. And still, it
is showing up in the notmuch search output.

What should I do to get rid of these messages from the notmuch
search output?
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistency between tag database and notmuch search

Navin Kabra <[hidden email]> writes:

>
> Specifically, I have a few threads/messages that don't have any tags,
> but still show up in notmuch search for those tags. And using notmuch
> tag to remove (or add) any tags on these threads has no effect. Doing
> a `notmuch compact` does not fix this issue.

0) As a first step, run xapian-check, something like

% xapian-check ~/Maildir/.notmuch/xapian

If your database is corrupted, there's not much notmuch can do about it
(except maybe make things worse).  I would think that compact would have
detected any corruption, but you never know.

>
>     ~$ notmuch search thread:0000000000058ca0 and tag:inbox
>     thread:0000000000058ca0  February 22 [1/1] Mandar Joshi;
>     Announcing TiECon Pune 2017 - Pune's largest, most energizing
>     startup event! ()

1) Can you also see the problem by looking at individual message-ids?,
   e.g. using notmuch show

2) In particular Does notmuch dump generate the correct output? If so,
   then dump your tags, rebuild your database, and reload the tags is
   one option.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
ngkabra ngkabra
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistency between tag database and notmuch search

Thanks for the quick response David.

xapian-check reports no problems.

Looking at individual message-ids using notmuch show does not show
anything different. (In this case, the thread had just one
message).

notmuch-dump seems to be working as expected, so I will try
rebuilding my database from the dump in a few days, and report on
whether that fixed the problem.

In the meantime, would anyone be interested in investigating this
inconsistency so see if this is a notmuch bug that needs fixing?
I'd be happy to run any commands and post the output.

thanks,
navin.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistency between tag database and notmuch search

Navin Kabra <[hidden email]> writes:

> In the meantime, would anyone be interested in investigating this
> inconsistency so see if this is a notmuch bug that needs fixing?
> I'd be happy to run any commands and post the output.

If you can reproduce the situation, starting from a fresh database,
let us know exactly how. Otherwise it's not really feasible to debug,
IMHO.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
ngkabra ngkabra
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistency between tag database and notmuch search

> If you can reproduce the situation, starting from a fresh
> database,
> let us know exactly how. Otherwise it's not really feasible to
> debug,
> IMHO.

That's what I feared.

I'll make one or two attempts to recreate the bug, and post here
if I succeed. Otherwise, I'll give it up and move on.

Thanks.
navin.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch