question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Crash with KeyError: 'data_token'

See original GitHub issue

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'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
robdejongecommented, Jan 28, 2022

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!

1reaction
AlexMikhalevcommented, Apr 11, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug #498933 “Crash when restoring data KeyError”
I have it setup to backup my home directory, and tried restoring to both the original location as well as a completely different...
Read more >
python - Tkinter redirect stdout crash with KeyError : 'None'
I got this looks weird problem that sometimes my tkinter application crashed with KeyError : 'None'. It's very unstable:(.
Read more >
TB Variant Report crashes (with an error about KeyError
This is a bug present in TB Variant Report (aka tbvcfreport) version 0.1.8 and earlier. In this case it is triggered by the...
Read more >
Getting a crash using multi-workfiles missing task template
Hi I think I am hitting a bug, and I am unclear why it's popping up. ... for the File Open form is...
Read more >
QuerySet.prefetch_related() crashes with KeyError if model ...
#28375 closed Bug (fixed). QuerySet.prefetch_related() crashes with KeyError if model uses to_field and string primary key ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found