xybu / onedrive-d-old

Microsoft OneDrive client on Linux.
http://xybu.me/projects/onedrive-d/
GNU Lesser General Public License v3.0
819 stars 143 forks source link

Workers dying ... #224

Closed igavronski closed 5 years ago

igavronski commented 7 years ago

Hi,

Not sure if that's a programming or a worker's health problem... ;-)

Exception in thread worker0:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 377, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 379, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.5/socket.py", line 575, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.5/ssl.py", line 929, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.5/ssl.py", line 791, in read
    return self._sslobj.read(len, buffer)
  File "/usr/lib/python3.5/ssl.py", line 575, in read
    v = self._sslobj.read(len, buffer)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 610, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 247, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3/dist-packages/six.py", line 686, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 320, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='apis.live.net', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_worker_thread.py", line 440, in run
    self.sync_dir(task)
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_worker_thread.py", line 78, in sync_dir
    remote_entries = self.api.list_entries(folder_id=task['remote_id'])
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_onedrive_api.py", line 305, in list_entries
    r = self.http_client.get(OneDriveAPI.API_URI + folder_id + '/' + type)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 480, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='apis.live.net', port=443): Read timed out. (read timeout=None)
igavronski commented 7 years ago

And by stopping the service, all "sick workers" don't show at the checkout:

17:41 $ onedrive-d stop
Loading configuration ... OK
[2017-02-14 17:41:47,209] DEBUG: MainThread: running in daemon node.
Stopping onedrive-d ... FAILED
ERROR: Timed out while waiting for process (PID 31169) to terminate
17:41 $ 
17:42 $ ps -ef | grep onedr
iuri     14006  3710  0 07:10 pts/0    00:00:03 tail -f .onedrive.log
iuri     31166 13849  3 17:09 pts/1    00:01:01 /usr/bin/python3 /usr/local/bin/onedrive-d start --debug
iuri     31169     1  1 17:09 pts/1    00:00:26 /usr/bin/python3 /usr/local/bin/onedrive-d start --debug

See the output of the debug:

[2017-02-14 17:41:47,210] INFO: MainThread: stopping...
[2017-02-14 17:41:47,211] DEBUG: Dummy-7: cleaning up.
[2017-02-14 17:41:47,571] DEBUG: Dummy-7: entry manager closed.
[2017-02-14 17:41:47,579] DEBUG: Dummy-7: inotifywait killed.
[2017-02-14 17:41:47,752] DEBUG: worker1: got task: sy on "/home/iuri/OneDrive/***"
[2017-02-14 17:41:48,577] DEBUG: inotify: exit while loop.
[2017-02-14 17:41:48,764] DEBUG: inotify: stopped.
[2017-02-14 17:41:48,765] DEBUG: Dummy-7: inotify thread stopped.
[2017-02-14 17:41:48,766] DEBUG: Dummy-7: task queue cleaned.
[2017-02-14 17:41:48,766] DEBUG: Dummy-7: waiting for thread worker0.
[2017-02-14 17:41:48,767] DEBUG: Dummy-7: waiting for thread worker1.
[2017-02-14 17:41:48,962] DEBUG: worker1: stopped.
[2017-02-14 17:41:48,963] DEBUG: Dummy-7: waiting for thread worker2.
[2017-02-14 17:41:48,963] DEBUG: Dummy-7: waiting for thread worker3.
igavronski commented 7 years ago

And after killing the PID of onedrive.d:

[2017-02-14 17:49:50,275] INFO: Dummy-7: stopping...
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_mon_cli.py", line 104, in cleanup
  File "/usr/lib/python3.5/threading.py", line 1054, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_mon_cli.py", line 121, in stop
SystemExit: 0
[2017-02-14 17:49:50,278] DEBUG: Dummy-7: config saved.