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: 

error during upload file

error during upload file

Sergio B.1
New member | Level 1

I have an error with a file upload of ~452 MB this is the exception:

the code is picked from here

('64cb960257abb6a107b327cfefbad8ab', 502, u'\n\nDropbox - 5xx\n\n\n\n\n
\nError: 5xx\n
\n
\n

Error (5xx)

Something went wrong. Don\'t worry, your files are still safe and the Dropboxers have been notified. Check out our Help Center and forums for help, or head back to home.\n
\n\n\n\n\n\n\n')
2 Replies 2

Sergio B.1
New member | Level 1

this is the code that generate the exception:

try:
backup = open(BACKUP_DIR + '/' + backups_in_folder[-1], 'rb')
file_size = os.path.getsize(BACKUP_DIR + '/' + backups_in_folder[-1])
CHUNK_SIZE = 4 * 1024 * 1024
dbx = dropbox.Dropbox(DROPBOX_UPLOAD_ACCESSKEY)
if file_size <= CHUNK_SIZE:
dbx.files_upload(backup, '/' + backups_in_folder[-1])
else:
upload_session_start_result = dbx.files_upload_session_start(backup.read(CHUNK_SIZE))
cursor = files.UploadSessionCursor(session_id=upload_session_start_result.session_id, offset=backup.tell())
commit = files.CommitInfo(path='/' + backups_in_folder[-1])

while backup.tell() < file_size:
if (file_size - backup.tell()) <= CHUNK_SIZE:
dbx.files_upload_session_finish(backup.read(CHUNK_SIZE), cursor, commit)
else:
dbx.files_upload_session_append(backup.read(CHUNK_SIZE), cursor.session_id, cursor.offset)
cursor.offset = backup.tell()

except Exception, e:
print('* ERROR:' + str(e))

Greg-DB
Dropbox Staff

Hi Sergio, is this happening on every API call, or only some of them? If it's only some of them, about what percent?

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Sergio B.1 New member | Level 1
What do Dropbox user levels mean?