Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download error with 206 #967

Closed
Jeffin21 opened this issue Mar 9, 2018 · 3 comments · Fixed by #968
Closed

Download error with 206 #967

Jeffin21 opened this issue Mar 9, 2018 · 3 comments · Fixed by #968
Assignees
Milestone

Comments

@Jeffin21
Copy link

Jeffin21 commented Mar 9, 2018

https://www.telegraph.co.uk/content/dam/news/2017/11/11/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg?imwidth=480

file downloader got the size of the file and error to download

03-09 10:27:15.424 12667-12667/download D/FileDownloader.DownloadTask: setPath /storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg
03-09 10:27:15.424 12667-12667/download D/FileDownloader.DownloadTask: setListener com.liulishuo.filedownloader1.demo.notifications.NotificationListener@31b9e8
03-09 10:27:15.425 12667-12667/download V/FileDownloader.DownloadTaskHunter: call start Url[https://www.telegraph.co.uk/content/dam/news/2017/11/11/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg?imwidth=480-rw], Path[/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg] Listener[com.liulishuo.filedownloader1.demo.notifications.NotificationListener@31b9e8], Tag[null]
03-09 10:27:15.427 12667-12667/download I/System.out: generateId: /storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg
03-09 10:27:15.427 12667-12667/download V/FileDownloader.DownloadTaskHunter: the task[126155360] has been into the launch pool.
03-09 10:27:15.427 12667-12667/download V/SHB: File Size:0,https://www.telegraph.co.uk/content/dam/news/2017/11/11/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg?imwidth=480-rw,Internal

03-09 10:27:15.433 12667-13346/download V/FileDownloader.FileDownloadEventPool: setListener event.service.connect.changed
03-09 10:27:15.434 12667-13346/download D/FileDownloader.FileDownloadMessenger: notify begin 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94
03-09 10:27:15.437 12667-12667/download V/ClearFromRecentService: Service Started
03-09 10:27:15.438 12667-13346/download V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@8b5233d by 11
03-09 10:27:15.439 12667-13346/download V/FileDownloader.FileDownloadList: add list in all 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94 11 1
03-09 10:27:15.440 12766-12777/download:filedownloader D/FileDownloader.FileDownloadManager: request start the task with url(https://www.telegraph.co.uk/content/dam/news/2017/11/11/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg?imwidth=480-rw) path(/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg) isDirectory(FALSE)
03-09 10:27:15.440 12766-12777/download:filedownloader I/System.out: generateId: /storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg
03-09 10:27:15.441 12766-12777/download:filedownloader I/System.out: generateId: /storage/emulated/0/GDM
03-09 10:27:15.444 12766-12777/download:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 126155360 file not suit, exists[FALSE], directory[FALSE]
03-09 10:27:15.454 12667-13349/download D/FileDownloader.MessageSnapshotGate: ~~~callback 126155360 old[11] new[1] 1
03-09 10:27:15.454 12667-13349/download D/FileDownloader.FileDownloadMessenger: notify pending 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94
03-09 10:27:15.455 12667-13349/download D/FileDownloader.MessageSnapshotGate: updateKeepFlow
03-09 10:27:15.455 12667-13349/download D/FileDownloader.MessageSnapshotGate: ~~~callback 126155360 old[1] new[6] 1
03-09 10:27:15.456 12667-13349/download D/FileDownloader.FileDownloadMessenger: notify started 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94
03-09 10:27:15.456 12667-13349/download D/FileDownloader.MessageSnapshotGate: updateKeepFlow
03-09 10:27:15.481 12766-13348/download:filedownloader D/FileDownloader.DownloadMgrInitialParams: initial FileDownloader manager with the customize connection creator: com.liulishuo.filedownloader.connection.FileDownloadUrlConnection$Creator@8d728d6
03-09 10:27:15.483 12766-13348/download:filedownloader D/FileDownloader.ConnectTask: <---- 126155360 request header {Range=[bytes=0-0], User-Agent=[FileDownloader/1.0.78]}

03-09 10:27:15.698 12766-13348/download:filedownloader D/FileDownloader.ConnectTask: ----> 126155360 response header {null=[HTTP/1.1 206 Partial Content], Cache-Control=[no-transform, max-age=31536000], Connection=[keep-alive], Content-Range=[bytes 0-0/339877], Content-Type=[image/jpeg], Date=[Fri, 09 Mar 2018 04:57:57 GMT], ETag=["6db11-55db47dbe9573"], Last-Modified=[Tue, 27 Feb 2018 08:09:17 UTC], Server=[Akamai Image Manager], Vary=[Accept-Encoding], X-Android-Received-Millis=[1520609235696], X-Android-Response-Source=[NETWORK 206], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1520609235674], X-Check-Cacheable=[YES], X-Serial=[773]}
03-09 10:27:15.698 12766-13348/download:filedownloader D/FileDownloader.FileDownloadUtils: etag find "6db11-55db47dbe9573" for task(126155360)
03-09 10:27:15.699 12667-13349/download D/FileDownloader.MessageSnapshotGate: ~~~callback 126155360 old[6] new[2] 1
03-09 10:27:15.699 12667-13349/download D/FileDownloader.FileDownloadMessenger: notify connected 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94
03-09 10:27:15.699 12667-13349/download D/FileDownloader.MessageSnapshotGate: updateKeepFlow
03-09 10:27:15.701 12766-13348/download:filedownloader D/FileDownloader.FileDownloadUtils: can't continue 126155360 file not suit, exists[FALSE], directory[FALSE]
03-09 10:27:15.701 12766-13348/download:filedownloader V/SRL: FileDownloadOutputStream:/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg.temp
03-09 10:27:15.710 12766-13348/download:filedownloader I/System.out: File Utile:Internal==/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg.tempFile Utile file:/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg.temp
03-09 10:27:15.711 12766-13348/download:filedownloader I/System.out: FileDownloadRandomAccessFile : Internal
03-09 10:27:15.718 12766-13348/download:filedownloader I/System.out: determineConnectionCount1 :No::/storage/emulated/0/GDM/Lam4_trans_NvBQzQNjv4BqJHrDUa6dqErW26Sw56Or3qMEnM2GVw2Lj-vOsEqwR0o.jpg
03-09 10:27:15.719 12766-13348/download:filedownloader I/System.out: determineConnectionCount:No
03-09 10:27:15.721 12766-13348/download:filedownloader D/FileDownloader.ConnectTask: <---- 126155360 request header {If-Match=["6db11-55db47dbe9573"], Range=[bytes=0-], User-Agent=[FileDownloader/1.0.78]}
03-09 10:27:15.770 12766-13348/download:filedownloader D/FileDownloader.ConnectTask: ----> 126155360 response header {null=[HTTP/1.1 206 Partial Content], Cache-Control=[no-transform, max-age=31536000], Connection=[keep-alive], Content-Range=[bytes 0-339876/339877], Content-Type=[image/jpeg], Date=[Fri, 09 Mar 2018 04:57:57 GMT], ETag=["6db11-55db47dbe9573"], Last-Modified=[Tue, 27 Feb 2018 08:09:17 UTC], Server=[Akamai Image Manager], Vary=[Accept-Encoding], X-Android-Received-Millis=[1520609235769], X-Android-Response-Source=[NETWORK 206], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1520609235721], X-Check-Cacheable=[YES], X-Serial=[773]}
03-09 10:27:15.770 12766-13348/download:filedownloader D/FileDownloader.DownloadRunnable: the connection[-1] for 126155360, is connected range[0, -1) current offset[0] with code[206]
03-09 10:27:15.772 12766-13348/download:filedownloader D/FileDownloader.FileDownloadUtils: -1 response header is not legal but HTTP lenient is true, so handle as the case of transfer encoding chunk
03-09 10:27:15.873 12766-13348/download:filedownloader D/FileDownloader.RemitDatabase: sync cache to db 126155360
03-09 10:27:15.913 12667-13349/download D/FileDownloader.MessageSnapshotGate: ~~~callback 126155360 old[2] new[-1] 1
03-09 10:27:15.913 12667-13349/download V/FileDownloader.FileDownloadList: remove 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94 left -1 0
03-09 10:27:15.913 12667-13349/download D/FileDownloader.FileDownloadMessenger: notify error 126155360@com.liulishuo.filedownloader.DownloadTask@5c8c94 com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: require range[0-) with contentLength(339877), but the backend response contentLength is -1 on downloadId[126155360]-connectionIndex[-1], please ask your backend dev to fix such problem.
03-09 10:27:15.913 12667-13349/download V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@8b5233d by -1
03-09 10:27:15.913 12667-13349/download D/FileDownloader.MessageSnapshotGate: updateKeepFlow
03-09 10:27:15.924 12667-12667/download V/SRL: Exception :com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: require range[0-) with contentLength(339877), but the backend response contentLength is -1 on downloadId[126155360]-connectionIndex[-1], please ask your backend dev to fix such problem.
03-09 10:27:15.924 12667-12667/download I/System.out: error msg nottii: require range[0-) with contentLength(339877), but the backend response contentLength is -1 on downloadId[126155360]-connectionIndex[-1], please ask your backend dev to fix such problem.
03-09 10:27:15.927 12667-12667/download V/SRL: Error:require range[0-) with contentLength(339877), but the backend response contentLength is -1 on downloadId[126155360]-connectionIndex[-1], please ask your backend dev to fix such problem.
03-09 10:27:15.927 12667-12667/download W/System.err: com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: require range[0-) with contentLength(339877), but the backend response contentLength is -1 on downloadId[126155360]-connectionIndex[-1], please ask your backend dev to fix such problem.
03-09 10:27:15.927 12667-12667/download W/System.err: at com.liulishuo.filedownloader.download.FetchDataTask.run(FetchDataTask.java:100)
03-09 10:27:15.927 12667-12667/download W/System.err: at com.liulishuo.filedownloader.download.DownloadRunnable.run(DownloadRunnable.java:141)
03-09 10:27:15.927 12667-12667/download W/System.err: at com.liulishuo.filedownloader.download.DownloadLaunchRunnable.realDownloadWithSingleConnection(DownloadLaunchRunnable.java:593)
03-09 10:27:15.927 12667-12667/download W/System.err: at com.liulishuo.filedownloader.download.DownloadLaunchRunnable.run(DownloadLaunchRunnable.java:294)
03-09 10:27:15.927 12667-12667/download W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-09 10:27:15.927 12667-12667/download W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-09 10:27:15.927 12667-12667/download W/System.err: at java.lang.Thread.run(Thread.java:818)

@rantianhua
Copy link
Collaborator

It's very strange that your FileDownload version is 1.0.78 . So please tell me the real version of FileDownloader.

@Jeffin21
Copy link
Author

Jeffin21 commented Mar 9, 2018

1.7.1

@rantianhua rantianhua added bug and removed need-info labels Mar 10, 2018
@rantianhua
Copy link
Collaborator

Thanks to your report, it's a bug of FileDownloader. However, I find a server bug of this url. When I use FileDownloader to send request, the server response that the content length is 30749, but the real length is 30997. I will fix FileDownloader's bug and you also need to fix your backend bug.

@rantianhua rantianhua added this to the 1.7.2 milestone Mar 11, 2018
rantianhua pushed a commit to rantianhua/FileDownloader that referenced this issue Mar 11, 2018
should get content length from Content-Range if there is no Content-Length in the response during download connections

close lingochamp#967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants