samschott/maestral

Unable to add to excluded list, version 1.9.2

dowdlelt opened this issue · 1 comments

Describe the bug

Using the latest version (1.9.2), CLI (maestral[gui] fails on PyQt6 install) when I attempt to add an excluded folder. I get the following error:

Traceback (most recent call last):
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/bin/maestral", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/maestral/cli/common.py", line 110, in wrapper
    return ctx.invoke(f, proxy, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stone-ext4/logan/miniconda3/envs/maestral-venv/lib/python3.11/site-packages/maestral/cli/common.py", line 35, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: excluded_add() got an unexpected keyword argument 'dropbox_path'

To Reproduce

A single maestral excluded add Areas/some_data_folder/ produced this error. Trying a single folder (i.e. no subfolder) did the same
Expected behaviour

Adding the subfolder to the list of excluded sync items.

System:

  • Maestral version: 1.9.2
  • Python version: 3.11.8
  • OS: [e.g. Ubuntu]: Ubuntu 14.04.6
  • Desktop environment: Xfce
  • PyQt version (for Linux GUI): 5.15.9

Maestral is running in a conda environment created specifically for this purpose.
Additional context

Downgrading to 1.8.0 may have fixed the problem, but I will have to wait, as I no longer get the above error but instead Cannot exclude item. Please try again when idle.

Update - 1.8.0 works perfectly - identical command produces the "Excluded XXX output". Only thing I did to "resolve" the issue was pip install maestral==1.8.0 (after pausing and stopping maestral).

Thanks for the report! This is indeed yet another regression. While test coverage for the core sync functionality is excellent, especially the CLI and GUI could use improved test coverage to prevent such regressions.

Until a fix is submitted, you can spin up a Python interpreter directly and add / remove excluded items as follows:

from maestral.daemon import MaestralProxy

m = MaestralProxy()
m.exclude_items("/item1", "/item2", ...)
m.include_items("/item3", "/item4", ...)

Note that MaestralProxy will connect to an existing sync daemon, so you'll need to have Maestral running already for this to work.