dropbox / dbxcli

A command line client for Dropbox built using the Go SDK
Other
1.05k stars 100 forks source link

dbxcli download issues ( Error: unexpected EOF ) #75

Open dhanasekaran-anbalagan opened 7 years ago

dhanasekaran-anbalagan commented 7 years ago

Hi Guys,

When I try to download the file using dbxcli utility, I am getting unexpected end of file error.

~]$ dbxcli version dbxcli version: v2.0.6 SDK version: 1.0.0-beta Spec version: 6194bea

Downloading 0 B/6.2 GiB

Downloading 2.9 KiB/6.2 GiB

Downloading 40 MiB/6.2 GiB

Downloading 87 MiB/6.2 GiB

Downloading 120 MiB/6.2 GiB

Downloading 166 MiB/6.2 GiB

Downloading 200 MiB/6.2 GiB

Downloading 248 MiB/6.2 GiB

Downloading 289 MiB/6.2 GiB

Downloading 336 MiB/6.2 GiB

Downloading 382 MiB/6.2 GiB

Downloading 420 MiB/6.2 GiB

Downloading 464 MiB/6.2 GiB

Downloading 505 MiB/6.2 GiB

Downloading 543 MiB/6.2 GiB

Downloading 576 MiB/6.2 GiB

Downloading 608 MiB/6.2 GiB

Downloading 640 MiB/6.2 GiB

Downloading 675 MiB/6.2 GiB

Downloading 708 MiB/6.2 GiB

Downloading 743 MiB/6.2 GiB

Downloading 780 MiB/6.2 GiB

Downloading 816 MiB/6.2 GiB

Downloading 853 MiB/6.2 GiB

Downloading 896 MiB/6.2 GiB

Downloading 2.9 GiB/6.2 GiB

> Error: unexpected EOF

please let us know if we need more info.

diwakergupta commented 7 years ago

@dhanasekaran-anbalagan is the error with any files, or just this particular file? Specifically, can you try downloading smaller files and LMK if that works. Basically trying to isolate if this is an issue with very large files.

dhanasekaran-anbalagan commented 7 years ago

@diwakergupta thanks for the reply. smaller files ( less than 1GB ) we don't have an issue. The only issue with bigger file more the 2GB+

can you please guide me any workaround is there.

NOTE: One more info. the same file we are able to download via Python API

please let me know if you need more info

mikaelmantel commented 7 years ago

I got the same thing but with a smaller file (1,1 Mo) :

`root@pmx1:/home/dropbox/backup# ./dbx get "Operations/Tools/WinX32/7z920.exe" "Operations/Tools/WinX32/7z920.exe"

Error: unexpected end of JSON input`

diwakergupta commented 7 years ago

@mikaelmantel this looks like a different error (unexpected EOF vs. end of JSON input). Do you mind sending me the version info (dbxcli version) and verbose output (dbxcli -v get ...)? Also make sure you are working with the latest release.

diwakergupta commented 7 years ago

@dhanasekaran-anbalagan when you say you're able to download via the Python API, are you using the built-in helper utilities or have you written your own code using the API?

dhanasekaran-anbalagan commented 7 years ago

Yes, we are using built-in helper utilities, have attached example program.

#!/usr/bin/env python

import dropbox
import os
import logging
import urllib3

# to disable warnings.
urllib3.disable_warnings(urllib3.exceptions.InsecurePlatformWarning)
urllib3.disable_warnings(urllib3.exceptions.SNIMissingWarning)

level = "INFO"
logging.basicConfig(level=level, format="%(levelname)-10s| %(asctime)-10s | %(funcName)-10s | %(message)s")

TOKEN = ''
DBX = dropbox.Dropbox(TOKEN)

def dbx_downloader(dbx_location, local_fs_location):
    try:
        logging.info("let's start download file from DropBox dbx_location=%s and local_fs_location=%s", dbx_location,
                     local_fs_location)
        DBX.files_download_to_file(
            download_path=local_fs_location,
            path=dbx_location
        )
        logging.info("Download completed successfully ..")
    except:
        import traceback
        traceback.print_exc()

if __name__ == '__main__':
    import argparse
    from argparse import RawTextHelpFormatter

    description = '%r\n\nDropBox Downloader..\n%r' \
                  % ('_' * 60, '_' * 60)
    parser = argparse.ArgumentParser(description=description.replace("'", ""), formatter_class=RawTextHelpFormatter)
    parser.add_argument('--path', help='Please provide valid path from DropBox', type=str, required=True)
    parser.add_argument('--download_path', help='Please provide valid local destination', type=str, default=None)
    args = parser.parse_args()

    path = args.path
    filename = os.path.basename(path)
    download_path = filename if args.download_path is None else os.path.join(args.download_path, filename)
    dbx_downloader(dbx_location=path, local_fs_location=download_path)
mikaelmantel commented 7 years ago

@diwakergupta Oouupss, I did not see that the message was different.

dbxcli version: v2.0.6 SDK version: 1.0.0-beta Spec version: 6194bea

2017/09/11 16:22:00 sdk.go:76: arg: &{/Operations/Tools/WinX32/7z920.exe } 2017/09/11 16:22:00 sdk.go:76: req: &{POST https://content.dropboxapi.com/2/files/download HTTP/1.1 1 1 map[Dropbox-Api-Arg:[{"path":"/Operations/Tools/WinX32/7z920.exe"}]] <nil> <nil> 0 [] false content.dropboxapi.com map[] map[] <nil> map[] <nil> <nil> <nil> <nil>} 2017/09/11 16:22:01 sdk.go:76: resp: &{409 path/restricted_content/.. 409 HTTP/1.1 1 1 map[Content-Type:[application/json] Connection:[keep-alive] X-Dropbox-Request-Id:[a53e0f5476eaf422b70b91570ddff60b] X-Robots-Tag:[noindex, nofollow, noimageindex] Server:[nginx] Date:[Mon, 11 Sep 2017 14:22:01 GMT]] 0xc420128180 -1 [chunked] false false map[] 0xc42000ac00 0xc4200a02c0} 2017/09/11 16:22:01 sdk.go:76: body: [] Error: unexpected end of JSON input

szarnyasg commented 3 years ago

This issue is still present (using version a871c88e22f4575d2f2cb1b77af9a91975acd296) when downloading large files. I have a 200 GB file which can reproduce this issue reliably. I can download 20 GB files, so the problem arises somewhere between these two sizes.

edoyango commented 2 years ago

Are there any updates on this? This is happening to me now with a 164GiB file:

Downloading 50 GiB/164 GiB
Error: unexpected EOF

This is with the dbxcli command utility.

nightpool commented 2 years ago

This is also happening to me with large files.