icloud-drive-docker: [BUG] Crash with KeyError: 'data_token'

I tried to use newest version published and successfully authenticated and started downloading all files in Documents folder, then suddenly icloud crashed on sync:

icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/for_blog_post/Figure_1.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 09.55.18.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.00.59.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.05.13.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.10.45.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.22.21.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.26.28.png
icloud-drive    | No changes detected. Skipping the file /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems/Screenshot 2020-02-11 at 10.34.40.png
icloud-drive    | Downloading /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems.md ...
icloud-drive    | Downloading /app/drive/Documents/Foundation Ontologies for Distributed Multi-Agent systems.textbundle ...
icloud-drive    | Traceback (most recent call last):
icloud-drive    |   File "/app/./src/main.py", line 6, in <module>
icloud-drive    |     sync.sync_drive()
icloud-drive    |   File "/app/src/sync.py", line 159, in sync_drive
icloud-drive    |     sync_directory(drive=api.drive, destination_path=destination_path, root=destination_path,
icloud-drive    |   File "/app/src/sync.py", line 136, in sync_directory
icloud-drive    |     files.update(sync_directory(drive=item, destination_path=new_folder, items=item.dir(), root=root,
icloud-drive    |   File "/app/src/sync.py", line 141, in sync_directory
icloud-drive    |     process_file(item=item, destination_path=destination_path,
icloud-drive    |   File "/app/src/sync.py", line 102, in process_file
icloud-drive    |     download_file(item=item, local_file=local_file, verbose=verbose)
icloud-drive    |   File "/app/src/sync.py", line 82, in download_file
icloud-drive    |     with item.open(stream=True) as response:
icloud-drive    |   File "/usr/local/lib/python3.9/site-packages/pyicloud/services/drive.py", line 270, in open
icloud-drive    |     return self.connection.get_file(self.data["docwsid"], **kwargs)
icloud-drive    |   File "/usr/local/lib/python3.9/site-packages/pyicloud/services/drive.py", line 58, in get_file
icloud-drive    |     url = response.json()["data_token"]["url"]
icloud-drive    | KeyError: 'data_token'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Not only did you fix the issue (all the files previously triggering a data_token error no longer do), it seems as if the whole thing executes a lot faster. Thanks very much for the effort to getting this resolved!

works after re-creating - I restarted container after pool and it wasn’t enough.