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 crash when refreshing tokens #234

Open Kwaadpepper opened 6 years ago

Kwaadpepper commented 6 years ago

here is output I tried to reset config few time using the wizard. It always crash at this point

2017-10-29 12:08:18,436] DEBUG: worker2: got task: up on "/media/ubuntu/data/OneDrive/Music/Ghost in the Shell (2017) - Full soundtrack.mp3"
[2017-10-29 12:08:18,957] INFO: worker2: auto refreshed API token in face of auth error.
[2017-10-29 12:08:18,958] DEBUG: worker2: getting session token for BITS upload...
Exception in thread worker2:
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/utils.py", line 868, in check_header_validity
    if not pat.match(value):
TypeError: expected string or bytes-like object

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 446, in run
    self.upload_file(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 367, in upload_file
    block_size=self.config.params['BITS_BLOCK_SIZE'])
  File "/usr/local/lib/python3.5/dist-packages/onedrive_d-1.1.0.dev0-py3.5.egg/onedrive_d/od_onedrive_api.py", line 421, in bits_put
    response = self.http_client.request('post', url, headers=headers)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/sessions.py", line 494, in request
    prep = self.prepare_request(req)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/sessions.py", line 437, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/requests/utils.py", line 872, in check_header_validity
    "bytes, not %s" % (name, value, type(value)))
requests.exceptions.InvalidHeader: Value for header {Content-Length: 0} must be of type str or bytes, not <class 'int'>