onedriveClient icon indicating copy to clipboard operation
onedriveClient copied to clipboard

Syncing from web to local onOneDrive for Business

Open modelmat opened this issue 7 years ago • 9 comments
trafficstars

Deleting/creating an item from the web client results in the error below, failing the delete/create The value for KeyError varies within 1000-7000 (from what I've seen). Fine deleting / creating files on local and uploading. The initial sync worked, just later updates do not. This makes this program useless.

also should I be worried when --debug shows a large amount of adding watcher for {file}?

source_traceback: Object created at (most recent call last):
  File "/home/modelmat/.local/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/modelmat/.local/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/modelmat/.local/lib/python3.7/site-packages/daemonocle/cli.py", line 57, in subcommand
    daemon.do_action(name)
  File "/home/modelmat/.local/lib/python3.7/site-packages/daemonocle/core.py", line 608, in do_action
    func()
  File "/home/modelmat/.local/lib/python3.7/site-packages/daemonocle/core.py", line 477, in start
    self._run()
  File "/home/modelmat/.local/lib/python3.7/site-packages/daemonocle/core.py", line 399, in _run
    self.worker()
  File "/home/modelmat/.local/lib/python3.7/site-packages/onedrived/od_main.py", line 204, in main
    context.watcher = LocalRepositoryWatcher(task_pool=task_pool, loop=context.loop)
  File "/home/modelmat/.local/lib/python3.7/site-packages/onedrived/od_watcher.py", line 46, in __init__
    self.loop.add_reader(self.notifier.fd, self.process_events)
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 335, in add_reader
    return self._add_reader(fd, callback, *args)
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 260, in _add_reader
    handle = events.Handle(callback, args, self, None)
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/modelmat/.local/lib/python3.7/site-packages/onedrived/od_watcher.py", line 441, in process_events
    self.handle_event(ev, flags, move_pairs)
  File "/home/modelmat/.local/lib/python3.7/site-packages/onedrived/od_watcher.py", line 339, in handle_event
    repo, parent_dir = self.watch_descriptors[ev.wd]
  File "/home/modelmat/.local/lib/python3.7/site-packages/bidict/_common.py", line 96, in proxy
    return meth(*args)
KeyError: 8924
[2018-09-29 16:28:38,563] WARNING: MainThread: Executing <Handle LocalRepositoryWatcher.process_events() created at /usr/lib/python3.7/asyncio/selector_events.py:260> took 0.205 seconds
127.0.0.1 - - [29/Sep/2018 16:28:45] "POST /90VCNElMDu HTTP/1.1" 200 -
[2018-09-29 16:28:45,603] INFO: Webhook: b'POST /90VCNElMDu HTTP/1.1\r\n'

modelmat avatar Sep 29 '18 06:09 modelmat

That's weird because I use it every day and is working fine here... I'm wondering if can be something related with python3.7...

Anyway, I will look a this.

The number of " adding watcher for {file}" will depend on your configuration. You can see it on the onedrived_config_v2.json.

derrix060 avatar Sep 30 '18 06:09 derrix060

So that's normal when in debug? Great! Thanks for having a look. If you need anything tested, I know my way around python so it should be fine.

modelmat avatar Sep 30 '18 06:09 modelmat

I could reproduce it here. What I've found is the program logs this error, but the file/directory is created/deleted...

The program can take some time (depend of your configuration) to sync, so don't expect to delete a file remotely and see sync so fast.

derrix060 avatar Oct 01 '18 07:10 derrix060

So it works but it errors?

modelmat avatar Oct 01 '18 07:10 modelmat

As far I could test here it's working okay but I will take a deep look and will remove any bugs. This piece was edited one year ago is likely to have a bug there..

derrix060 avatar Oct 01 '18 07:10 derrix060

Oh, okay.

modelmat avatar Oct 01 '18 07:10 modelmat

I've had a look at this again and it seems that this only occurs when I create a file with one name then (very) quickly rename it, then it spams the KeyError continuously. If it's not so quick it only does the KeyError once.

modelmat avatar Oct 03 '18 01:10 modelmat

So even with the KeyError the sync could be completed?

derrix060 avatar Oct 07 '18 18:10 derrix060

I'm not really sure. I think for doing it once it uploads, but for multiple (with unpaired watch events) it doesn't.

modelmat avatar Oct 09 '18 00:10 modelmat