You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sanchit Bahal (JIRA)" <ji...@apache.org> on 2013/05/01 13:54:16 UTC

[jira] [Commented] (CB-2840) crash when disabling network connection during file download

    [ https://issues.apache.org/jira/browse/CB-2840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646515#comment-13646515 ] 

Sanchit Bahal commented on CB-2840:
-----------------------------------

I am also facing a similar issue with Cordova 2.5.0 while downloading multiple files from a server. The issue is consistently reproducible, and the way I do it is by manually killing the server while the download is in progress. 

The really strange thing that seems to be happening in this case is that while most of the downloads fail with error code 3 (Connection error, I guess), few downloads finish successfully with the response code 200 (even though the server is no longer available). And when I check the contents of these files, they have been only partially downloaded.

Here is an excerpt of the logs for the same:

2013-05-01 15:21:17.381 App[7146:907] File Transfer Error: Could not connect to the server.; http://<server ip>/documents/10010/download 
2013-05-01 15:21:17.390 App[7146:907] [ERROR] {"code":3,"source":"http://<server ip>/documents/10015/download","target":"/var/mobile/Applications/0494B6E5-E796-4A3C-9C39-F8E3BBF15359/tmp/10015","http_status":null,"body":null} 
2013-05-01 15:21:17.392 App[7146:907] [ERROR] {"code":3,"source":"http://<server ip>/documents/10010/download","target":"/var/mobile/Applications/0494B6E5-E796-4A3C-9C39-F8E3BBF15359/tmp/10010","http_status":null,"body":null} 
2013-05-01 15:21:17.402 App[7146:907] File Transfer Finished with response code 200; http://<server ip>/documents/10008/download 
2013-05-01 15:21:17.404 App[7146:907] -[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 488] Write file /var/mobile/Applications/0494B6E5-E796-4A3C-9C39-F8E3BBF15359/tmp/10008 
2013-05-01 15:21:17.417 App[7146:907] -[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 507] File Transfer Download success 
2013-05-01 15:21:17.449 App[7146:907] File Transfer Error: Could not connect to the server.; http://<server ip>/documents/10013/download 
2013-05-01 15:21:17.452 App[7146:907] [ERROR] {"code":3,"source":"http://<server ip>/documents/10013/download","target":"/var/mobile/Applications/0494B6E5-E796-4A3C-9C39-F8E3BBF15359/tmp/10013","http_status":null,"body":null}
2013-05-01 15:21:17.475 App[7146:907] File Transfer Finished with response code 200; http://<server ip>/documents/10016/download 
2013-05-01 15:21:17.476 App[7146:907] -[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 488] Write file /var/mobile/Applications/0494B6E5-E796-4A3C-9C39-F8E3BBF15359/tmp/10016 
2013-05-01 15:21:17.488 App[7146:907] -[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 507] File Transfer Download success 
                
> crash when disabling network connection during file download
> ------------------------------------------------------------
>
>                 Key: CB-2840
>                 URL: https://issues.apache.org/jira/browse/CB-2840
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.5.0
>         Environment: all iOS Versions
>            Reporter: Dominik Binz
>            Assignee: Ian Clelland
>              Labels: patch
>
> When disabling network connection during file download the app crashes to home screen with the following error:
> 2013-03-28 01:49:24.515 Cordova250[4255:907] -[CDVFileTransfer download:] [Line 350] File Transfer downloading file...
> 2013-03-28 01:49:38.440 Cordova250[4255:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: body)'
> *** First throw call stack:
> (0x345443e7 0x3c23f963 0x344a65ef 0xa30b5 0xa49b5 0x34e80915 0x34dc0769 0x34e80aeb 0x3422170b 0x34220d33 0x34249013 0x3448aacd 0x34249473 0x341ad461 0x345198f7 0x345191f3 0x34517f2f 0x3448b23d 0x3448b0c9 0x3806a33b 0x363a72b9 0x6d06f 0x6d030)
> libc++abi.dylib: terminate called throwing an exception
> (lldb)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira