Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
deeuu
8 years agoExplorer | Level 4
list_folder_continue -> 504 errors
Hello, I'm using `list_folder_continue` of the Python SDK to recursively traverse (via pagination) a folder with a very large number of files (hundreds of thousands). After a while, I'm running int...
- 8 years ago
Thanks for the report! This can be related to these operations taking a long time due to a large number of files and/or a large amount of file activity in the affected account(s).
We'll look into it, but there are a few potential workarounds:
1) Use the 'limit' parameter on files_list_folder:
https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.files_list_folder
If you specify a smaller value (the default is effectively around 2000), that should help reduce how long each of these calls takes and reduce the likelihood that they will fail. Note that you supply the 'limit' value to files_list_folder itself, and it will apply to all results from files_list_folder_continue using the returned cursor as well.2) If you are using recursive=True, switch to recursive=False when calling files_list_folder. This means you would need to make a call for each sub-folder you need though.
Greg-DB
Dropbox Community Moderator
8 years agoYes, this is likely related to the number of files, but possibly also the amount of file activity. (So, yes, as the number of files goes to infinity, the working limit would go down.)
deeuu
8 years agoExplorer | Level 4
Hi Greg-DB,
So, after about 270,000 files/folders, I received an Internal Server Error (with `limit` set to 50), and can't seem to get going again with the cursor I stored prior to the collapse.
I guess I have to conclude that cursors aren't reliable for traversing folders with many files and sub-folders.
I'm not even sure its worth re-designing my app to use cursors for checking the state of each sub-directory, so I'll have to go with your #2 each time.
- Greg-DB8 years ago
Dropbox Community Moderator
Thanks for trying that, and my apologies for the trouble. I'll follow up here when I have any updates on this issue.
- NathanA4 years agoNew member | Level 2
Hello, any updates on this issue ? The issue is not solved, we still face this issue
- kylea4 years ago
Dropbox Staff
In addition to the techniques mentioned in this thread, I would also suggest traversing with include_mounted_folders=false.
Mounted folders refer to folder shares or team folders. With that option, the mount point (shared folder id) is still returned in the output, but not the share's content. You could then traverse the share independently with a different cursor.
This is particularly helpful for large team folders or scenarios with a lot of large shares.
We have updated our reference guides with best practices since this thread started, check them out here.
I don't have a specific update on the 504 error the original poster mentioned - are you seeing the 504 code, or something else? Including a little more detail on the error response you're seeing may help.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!