cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Dropbox API not returning all files

Re: Dropbox API not returning all files

LRomano
Explorer | Level 3

Hey Greg,

 

I've tried to adapt this code in order to get a bunch of files that begin with the letters 'zas', but I found the script just ran for hours without any luck, so I stripped it back to see what was happening.

 

I define my root and result:

root_path = '/MarketingCreative/External/Bidalgo_Zynga_CSR2/'

result = dbx.files_list_folder(root_path, recursive=True)

And then I'm just printing the file name if its a file, and the folder name if it's a folder:

 

def process_entries(entries):
  for entry in entries:
    if isinstance(entry, dropbox.files.FileMetadata):
      file = entry.path_display.rsplit('/', 1)[1]
      print(file)
    else:
      print("Folder "+entry.path_display)

process_entries(result.entries)

while result.has_more:
  result = dbx.files_list_folder_continue(result.cursor)
  process_entries(result.entries)

Again, this is just to see why the script is taking so long with no results.

 

It seems that after the first few files, the script just keeps repeating the root folder, and not progressing the the subfolders (and files) within (see photos).

 

Screenshot 2020-05-11 at 16.08.57.pngScreenshot 2020-05-11 at 16.09.04.png

 

If I specific a sub folder in the root path, eg:

root_path = '/MarketingCreative/External/Bidalgo_Zynga_CSR2/C2_112118_2.1_FormulaItalia3_Trailer_VS_AlfaRomeo_[LOC]/'

result = dbx.files_list_folder(root_path, recursive=True)

The script does what I need it to, but at this one level up, it seems to be an infinite loop.

 

How could I go about debugging this? Is it a cursor issue do you think?

 

Thanks

 

11 Replies 11

Greg-DB
Dropbox Staff

@IanHarker This issue is still open with engineering, but I don't have an update to share yet.

Greg-DB
Dropbox Staff

The team is reporting that this issue is now fixed and should be working properly.

 

Apologies for any inconvenience this may have caused, and thanks again for bringing this to our attention.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    IanHarker New member | Level 2
What do Dropbox user levels mean?