Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] symlink dead file under sync path breaks syncing #50

Closed
michaelbjames opened this issue Sep 4, 2019 · 1 comment
Closed

[BUG] symlink dead file under sync path breaks syncing #50

michaelbjames opened this issue Sep 4, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@michaelbjames
Copy link
Contributor

Describe the bug
If a symlink to a dead file location is put under sync, maestral will give a FileNotFoundError, not sync the file (expected), but will no longer update changes to valid files (unexpected).
This is a problem because emacs uses lock file that likely link nowhere, thus using emacs on a file under sync halts syncing of that file util maestral is restarted.

To Reproduce
0. [inside sync path]

  1. ln -s foo bar (where neither file already exists)
  2. Observe the error:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/michael/.local/lib/python3.7/site-packages/maestral/monitor.py", line 1442, in upload_worker
    sync.apply_local_changes(events, local_cursor)
  File "/home/michael/.local/lib/python3.7/site-packages/maestral/monitor.py", line 659, in apply_local_changes
    success += [f.result()]
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/michael/.local/lib/python3.7/site-packages/maestral/monitor.py", line 189, in wrapper
    res = func(self, *args, **kwargs)
  File "/home/michael/.local/lib/python3.7/site-packages/maestral/monitor.py", line 738, in _apply_event
    self._on_created(event)
  File "/home/michael/.local/lib/python3.7/site-packages/maestral/monitor.py", line 816, in _on_created
    size1 = osp.getsize(path)
  File "/usr/lib/python3.7/genericpath.py", line 50, in getsize
    return os.stat(filename).st_size

Expected behaviour
While bar should not be synced, I would expect that file to be ignored and other changes to continue to propagate.

System (please complete the following information):

  • Maestral version: 0.3.2
  • OS: Debian bullseye
  • Desktop environment: awesomewm
  • Qt version: pyqt5: 5.13
  • Python version: 3.7.4
@samschott
Copy link
Owner

Fixed and released in v0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants