Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Sergio B.1's avatar
Sergio B.1
New member | Level 1
9 years ago

error during upload file

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

Replies have been turned off for this discussion
  • Sergio B.1's avatar
    Sergio B.1
    New member | Level 1
    9 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

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

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!