pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
683 stars 163 forks source link

Not compatible with notmuch2 0.35 bindings #1597

Open inglor opened 2 years ago

inglor commented 2 years ago

Before you submit a bug report, please make sure that the issue still exists on the master branch!

Describe the bug notmuch 0.35 released a few days ago and the test suite fails due to breaking changes on the _database.py. I think the commit which introduce these changes is https://github.com/notmuch/notmuch/commit/8b737af28bc377db3e661a5744f3b7479b7ce485

Software Versions

To Reproduce Steps to reproduce the behaviour:

  1. execute test suite with notmuch2 bindings 0.35

Error Log Test suite error:

ERROR: test_save_named_query (tests.db.test_manager.TestDBManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/alot/src/alot-0.10/alot/db/manager.py", line 92, in flush
    db = Database(path=self.path, mode=mode)
  File "/usr/lib/python3.10/site-packages/notmuch2/_database.py", line 160, in __init__
    raise errors.NotmuchError(ret, msg)
notmuch2.NoConfigError: Error: cannot load config file.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/alot/src/alot-0.10/tests/db/test_manager.py", line 49, in test_save_named_query
    self.manager.flush()
  File "/build/alot/src/alot-0.10/alot/db/manager.py", line 175, in flush
    raise e
  File "/build/alot/src/alot-0.10/alot/db/manager.py", line 94, in flush
    raise DatabaseLockedError()
alot.db.errors.DatabaseLockedError
oliversturm commented 2 years ago

On Arch Linux I have seen this problem for a long time, and worked around it by downgrading to notmuch 0.34. I didn't run test suites though - I simply can't use alot because it comes up with a blank screen at all times. Now I'm running on a Mac where alot and notmuch are installed via brew (see versions below), and it's not trivial to downgrade.

For clarity and completeness, here are steps I take:

  1. Run alot -n <mynotmuchconfig> -l ./alot.log
  2. The screen goes completely blank. I can use o to search, d to leave the (invisible) result screen, q to quit alot, but I must do it all blind.
  3. I find this output at the top of the log file:
INFO:ui:setup gui in 256 colours
ERROR:ui:Traceback (most recent call last):
  File "/opt/homebrew/Cellar/alot/0.10/libexec/lib/python3.9/site-packages/alot/buffers/search.py", line 63, in rebuild
    self.result_count = self.dbman.count_messages(self.querystring)
  File "/opt/homebrew/Cellar/alot/0.10/libexec/lib/python3.9/site-packages/alot/db/manager.py", line 254, in count_messages
    db = Database(path=self.path, mode=Database.MODE.READ_ONLY)
  File "/opt/homebrew/opt/notmuch/libexec/lib/python3.9/site-packages/notmuch2/_database.py", line 160, in __init__
    raise errors.NotmuchError(ret, msg)
notmuch2.NoConfigError: Error: cannot load config file.

... nested exception details

Versions on the Mac:

➜ python3 --version
Python 3.9.13

➜ alot --version
0.10

➜ notmuch --version
notmuch 0.36
oliversturm commented 2 years ago

FWIW, I went through the steps to downgrade notmuch and alot as far as required to make things work - perhaps this will be useful to someone who uses brew to install the two.

# find the commit id you want
> brew log notmuch

# insert commit id in the URL - this is notmuch 0.34.3
> wget https://raw.githubusercontent.com/Homebrew/homebrew-core/356895dfc9b9f9ce2e0f532868253ec7b3830efd/Formula/notmuch.rb

> brew uninstall --ignore-dependencies notmuch
> brew install ./notmuch.rb
> brew pin notmuch

# same job for alot
> brew log alot

# commit id for alot 0.9.1_2 here
> wget https://raw.githubusercontent.com/Homebrew/homebrew-core/8748606303fdafe1125e75fa0b95401ee3040dd4/Formula/alot.rb

> brew uninstall alot
> brew install --ignore-dependencies ./alot.rb
> brew pin alot

This combination of notmuch 0.34.3 and alot 0.9.1 works correctly on this Mac. I tried to downgrade only notmuch and leave alot alone, but that didn't help - a bit surprising because I think I was using 0.34 and 0.10 together on Linux (but I'd have to double-check in case that's important to anyone).

jaquer commented 1 year ago

I also ran into this issue, and was able to work around it by setting an environment variable to the location of the config file like so:

NOTMUCH_CONFIG=<path to custom config> alot

NixOS, alot 0.10, notmuch 0.37

pazz commented 1 year ago

Thanks for this discussion.

For what It's worth, I cannot reproduce this on Debian. I am running notmuch 0.37 and alot 0.10 both from their respective git main branches.

P

Quoting Arturo R. (2023-07-18 17:51:07)

I also ran into this issue, and was able to work around it by setting an environment variable to the location of the config file like so:

NOTMUCH_CONFIG= alot

NixOS, alot 0.10, notmuch 0.37

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.*Message ID: @.***>

GuillaumeSeren commented 4 months ago

Hello there, we're having this issue on gentoo as well (https://bugs.gentoo.org/874372). I am pretty sure the test went fine when I pushed this new release.