cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

error during upload file

New member | Level 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
Highlighted

Re: error during upload file

New member | Level 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))
Highlighted

Re: error during upload file

Dropboxer
Dropboxer

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

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?