Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 83DBA200D0F for ; Fri, 29 Sep 2017 17:47:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 828221609D1; Fri, 29 Sep 2017 15:47:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 03E721609C5 for ; Fri, 29 Sep 2017 17:47:08 +0200 (CEST) Received: (qmail 65046 invoked by uid 500); 29 Sep 2017 15:47:08 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 65035 invoked by uid 99); 29 Sep 2017 15:47:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2017 15:47:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 23F1D1A4205 for ; Fri, 29 Sep 2017 15:47:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.702 X-Spam-Level: X-Spam-Status: No, score=-98.702 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ExEZs5yJcIwW for ; Fri, 29 Sep 2017 15:47:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1808E5FD33 for ; Fri, 29 Sep 2017 15:47:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 682B8E0E56 for ; Fri, 29 Sep 2017 15:47:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2EFAD242C9 for ; Fri, 29 Sep 2017 15:47:01 +0000 (UTC) Date: Fri, 29 Sep 2017 15:47:01 +0000 (UTC) From: "Florent (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-13374) Chunked upload cause a javax.net.ssl.SSLException on Android 6.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 29 Sep 2017 15:47:10 -0000 [ https://issues.apache.org/jira/browse/CB-13374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Florent updated CB-13374: ------------------------- Description: I have troubles uploading a video (potentially heavy file) to a PHP API endpoint, with chunkedMode enabled. It ends up to a javax.net.ssl.SSLException: *{color:#d04437}Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe{color}* Can't figure out if this is due to a misconfiguration either client-side or server-side? Here is the code I execute (JS - cordova) : {code:javascript|title=upload.js|borderStyle=solid} const options = new FileUploadOptions(); options.fileKey = 'video'; options.fileName = 'VID_20170721_161557.mp4'; options.mimeType = 'video/mp4'; options.chunkedMode = true; options.httpMethod = 'POST'; options.headers = { Authorization: 'Bearer xxxxxx.yyyyyy.zzzzzz' }; const uploader = new FileTransfer(); uploader.onprogress = (progressEvent) => { console.log('progress', progressEvent); }; // Launch the upload uploader.upload('cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4', encodeURI('https://domain.tld/api/v1/videos/upload'), (response) => { console.log('SUCCESS!', response); }, (error) => { console.error('FAIL...', error); }, options); {code} Here are the complete logs from Android Studio : {panel:title=Android Studio logs} 09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: upload cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4 to https://domain.tld/api/v1/videos/upload *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileKey: video* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileName: VID_20170721_161557.mp4* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: mimeType: video/mp4* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: params: {}* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: trustEveryone: false* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: chunkedMode: true* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: headers: null* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: objectId: 6* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: httpMethod: POST* *09-29 16:46:31.911 4208-3275/__APP_ID__ D/FileTransfer: Content Length: 9199611* *09-29 16:46:31.987 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 114806 of 9199611 bytes* *09-29 16:46:32.002 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 229494 of 9199611 bytes* *09-29 16:46:32.027 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 344182 of 9199611 bytes* *09-29 16:46:33.008 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 458870 of 9199611 bytes* *09-29 16:46:34.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 573558 of 9199611 bytes* *09-29 16:46:35.061 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 688246 of 9199611 bytes* *09-29 16:46:36.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 802934 of 9199611 bytes* *09-29 16:46:37.051 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 917622 of 9199611 bytes* *09-29 16:46:38.076 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1032310 of 9199611 bytes* *09-29 16:46:39.501 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1146998 of 9199611 bytes* *09-29 16:46:40.028 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1261686 of 9199611 bytes* *09-29 16:46:41.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1376374 of 9199611 bytes* *09-29 16:46:42.071 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1491062 of 9199611 bytes* *09-29 16:46:43.046 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1605750 of 9199611 bytes* *09-29 16:46:44.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1720438 of 9199611 bytes* *09-29 16:46:45.033 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1835126 of 9199611 bytes* *09-29 16:46:46.030 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1949814 of 9199611 bytes* *09-29 16:46:47.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2064502 of 9199611 bytes* *09-29 16:46:48.623 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2179190 of 9199611 bytes* *09-29 16:46:48.713 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2293878 of 9199611 bytes* *09-29 16:46:49.280 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2408566 of 9199611 bytes* *09-29 16:46:50.249 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2523254 of 9199611 bytes* *09-29 16:46:51.694 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2637942 of 9199611 bytes* *09-29 16:46:52.257 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2752630 of 9199611 bytes* *09-29 16:46:53.247 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2867318 of 9199611 bytes* *09-29 16:46:54.271 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2982006 of 9199611 bytes* *09-29 16:46:55.308 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3096694 of 9199611 bytes* *09-29 16:46:56.320 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3211382 of 9199611 bytes* *09-29 16:46:57.314 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3326070 of 9199611 bytes* *09-29 16:46:58.807 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3440758 of 9199611 bytes* *09-29 16:46:59.324 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3555446 of 9199611 bytes* *09-29 16:47:00.309 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3670134 of 9199611 bytes* *09-29 16:47:01.294 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3784822 of 9199611 bytes* {color:#d04437}*09-29 16:47:02.031 4208-3275/__APP_ID__ W/FileTransfer: Error getting HTTP status code from connection.* java.lang.IllegalStateException: closed at com.android.okhttp.okio.RealBufferedSink.emit(RealBufferedSink.java:181) at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:761) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) at org.apache.cordova.filetransfer.FileTransfer.createFileTransferError(FileTransfer.java:652) at org.apache.cordova.filetransfer.FileTransfer.access$600(FileTransfer.java:69) at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:553) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: \{"code":3,"source":"cdvfile:\/\/localhost\/sdcard\/DCIM\/Camera\/VID_20170721_161557.mp4","target":"https:\/\/domain.tld\/api\/v1\/videos\/upload","http_status":0,"exception":"Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe"\}* javax.net.ssl.SSLException: Write error: ssl=0x9c9050c0: I/O error during system call, Broken pipe at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method) at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:771) at com.android.okhttp.okio.Okio$1.write(Okio.java:76) at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155) at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) at com.android.okhttp.okio.RealBufferedSink.write(RealBufferedSink.java:46) at com.android.okhttp.internal.http.HttpConnection$ChunkedSink.write(HttpConnection.java:339) at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) at com.android.okhttp.okio.RealBufferedSink$1.write(RealBufferedSink.java:198) at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:479) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818){color} *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: Failed after uploading 3899510 of 9199611 bytes.* {panel} It seems the error always comes avec 30s, is it related to any timeout? (Might be some server-side timeout) What I don't exactly understand is why, when I disable the chunkedMode, it works without any problem? was: I have troubles uploading a video (potentially heavy file) to a PHP API endpoint, with chunkedMode enabled. It ends up to a javax.net.ssl.SSLException: *Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe* Can't figure out if this is due to a misconfiguration either client-side or server-side? Here is the code I execute (JS - cordova) : {code:javascript|title=upload.js|borderStyle=solid} const options = new FileUploadOptions(); options.fileKey = 'video'; options.fileName = 'VID_20170721_161557.mp4'; options.mimeType = 'video/mp4'; options.chunkedMode = true; options.httpMethod = 'POST'; options.headers = { Authorization: 'Bearer xxxxxx.yyyyyy.zzzzzz' }; const uploader = new FileTransfer(); uploader.onprogress = (progressEvent) => { console.log('progress', progressEvent); }; // Launch the upload uploader.upload('cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4', encodeURI('https://domain.tld/api/v1/videos/upload'), (response) => { console.log('SUCCESS!', response); }, (error) => { console.error('FAIL...', error); }, options); {code} Here are the complete logs from Android Studio : {panel:title=Android Studio logs} *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: upload cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4 to https://domain.tld/api/v1/videos/upload* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileKey: video* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileName: VID_20170721_161557.mp4* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: mimeType: video/mp4* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: params: {}* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: trustEveryone: false* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: chunkedMode: true* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: headers: null* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: objectId: 6* *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: httpMethod: POST* *09-29 16:46:31.911 4208-3275/__APP_ID__ D/FileTransfer: Content Length: 9199611* *09-29 16:46:31.987 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 114806 of 9199611 bytes* *09-29 16:46:32.002 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 229494 of 9199611 bytes* *09-29 16:46:32.027 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 344182 of 9199611 bytes* *09-29 16:46:33.008 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 458870 of 9199611 bytes* *09-29 16:46:34.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 573558 of 9199611 bytes* *09-29 16:46:35.061 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 688246 of 9199611 bytes* *09-29 16:46:36.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 802934 of 9199611 bytes* *09-29 16:46:37.051 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 917622 of 9199611 bytes* *09-29 16:46:38.076 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1032310 of 9199611 bytes* *09-29 16:46:39.501 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1146998 of 9199611 bytes* *09-29 16:46:40.028 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1261686 of 9199611 bytes* *09-29 16:46:41.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1376374 of 9199611 bytes* *09-29 16:46:42.071 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1491062 of 9199611 bytes* *09-29 16:46:43.046 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1605750 of 9199611 bytes* *09-29 16:46:44.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1720438 of 9199611 bytes* *09-29 16:46:45.033 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1835126 of 9199611 bytes* *09-29 16:46:46.030 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1949814 of 9199611 bytes* *09-29 16:46:47.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2064502 of 9199611 bytes* *09-29 16:46:48.623 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2179190 of 9199611 bytes* *09-29 16:46:48.713 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2293878 of 9199611 bytes* *09-29 16:46:49.280 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2408566 of 9199611 bytes* *09-29 16:46:50.249 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2523254 of 9199611 bytes* *09-29 16:46:51.694 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2637942 of 9199611 bytes* *09-29 16:46:52.257 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2752630 of 9199611 bytes* *09-29 16:46:53.247 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2867318 of 9199611 bytes* *09-29 16:46:54.271 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2982006 of 9199611 bytes* *09-29 16:46:55.308 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3096694 of 9199611 bytes* *09-29 16:46:56.320 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3211382 of 9199611 bytes* *09-29 16:46:57.314 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3326070 of 9199611 bytes* *09-29 16:46:58.807 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3440758 of 9199611 bytes* *09-29 16:46:59.324 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3555446 of 9199611 bytes* *09-29 16:47:00.309 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3670134 of 9199611 bytes* *09-29 16:47:01.294 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3784822 of 9199611 bytes* {color:#d04437}*09-29 16:47:02.031 4208-3275/__APP_ID__ W/FileTransfer: Error getting HTTP status code from connection.* java.lang.IllegalStateException: closed at com.android.okhttp.okio.RealBufferedSink.emit(RealBufferedSink.java:181) at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:761) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) at org.apache.cordova.filetransfer.FileTransfer.createFileTransferError(FileTransfer.java:652) at org.apache.cordova.filetransfer.FileTransfer.access$600(FileTransfer.java:69) at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:553) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: \{"code":3,"source":"cdvfile:\/\/localhost\/sdcard\/DCIM\/Camera\/VID_20170721_161557.mp4","target":"https:\/\/domain.tld\/api\/v1\/videos\/upload","http_status":0,"exception":"Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe"\}* javax.net.ssl.SSLException: Write error: ssl=0x9c9050c0: I/O error during system call, Broken pipe at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method) at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:771) at com.android.okhttp.okio.Okio$1.write(Okio.java:76) at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155) at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) at com.android.okhttp.okio.RealBufferedSink.write(RealBufferedSink.java:46) at com.android.okhttp.internal.http.HttpConnection$ChunkedSink.write(HttpConnection.java:339) at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) at com.android.okhttp.okio.RealBufferedSink$1.write(RealBufferedSink.java:198) at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:479) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818){color} *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: Failed after uploading 3899510 of 9199611 bytes.* {panel} It seems the error always comes avec 30s, is it related to any timeout? (Might be some server-side timeout) What I don't exactly understand is why, when I disable the chunkedMode, it works without any problem? > Chunked upload cause a javax.net.ssl.SSLException on Android 6.0.1 > ------------------------------------------------------------------ > > Key: CB-13374 > URL: https://issues.apache.org/jira/browse/CB-13374 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-file-transfer > Environment: android : 6.0.1 > cordova-android : 6.2.3 > cordova-plugin-file-transfer : 1.6.3 > Reporter: Florent > > I have troubles uploading a video (potentially heavy file) to a PHP API endpoint, with chunkedMode enabled. > It ends up to a javax.net.ssl.SSLException: > *{color:#d04437}Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe{color}* > Can't figure out if this is due to a misconfiguration either client-side or server-side? > Here is the code I execute (JS - cordova) : > {code:javascript|title=upload.js|borderStyle=solid} > const options = new FileUploadOptions(); > options.fileKey = 'video'; > options.fileName = 'VID_20170721_161557.mp4'; > options.mimeType = 'video/mp4'; > options.chunkedMode = true; > options.httpMethod = 'POST'; > options.headers = { > Authorization: 'Bearer xxxxxx.yyyyyy.zzzzzz' > }; > const uploader = new FileTransfer(); > uploader.onprogress = (progressEvent) => { > console.log('progress', progressEvent); > }; > // Launch the upload > uploader.upload('cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4', encodeURI('https://domain.tld/api/v1/videos/upload'), (response) => { > console.log('SUCCESS!', response); > }, (error) => { > console.error('FAIL...', error); > }, options); > {code} > Here are the complete logs from Android Studio : > {panel:title=Android Studio logs} > 09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: upload cdvfile://localhost/sdcard/DCIM/Camera/VID_20170721_161557.mp4 to https://domain.tld/api/v1/videos/upload > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileKey: video* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: fileName: VID_20170721_161557.mp4* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: mimeType: video/mp4* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: params: {}* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: trustEveryone: false* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: chunkedMode: true* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: headers: null* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: objectId: 6* > *09-29 16:46:31.905 4208-4429/__APP_ID__ D/FileTransfer: httpMethod: POST* > *09-29 16:46:31.911 4208-3275/__APP_ID__ D/FileTransfer: Content Length: 9199611* > *09-29 16:46:31.987 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 114806 of 9199611 bytes* > *09-29 16:46:32.002 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 229494 of 9199611 bytes* > *09-29 16:46:32.027 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 344182 of 9199611 bytes* > *09-29 16:46:33.008 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 458870 of 9199611 bytes* > *09-29 16:46:34.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 573558 of 9199611 bytes* > *09-29 16:46:35.061 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 688246 of 9199611 bytes* > *09-29 16:46:36.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 802934 of 9199611 bytes* > *09-29 16:46:37.051 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 917622 of 9199611 bytes* > *09-29 16:46:38.076 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1032310 of 9199611 bytes* > *09-29 16:46:39.501 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1146998 of 9199611 bytes* > *09-29 16:46:40.028 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1261686 of 9199611 bytes* > *09-29 16:46:41.070 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1376374 of 9199611 bytes* > *09-29 16:46:42.071 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1491062 of 9199611 bytes* > *09-29 16:46:43.046 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1605750 of 9199611 bytes* > *09-29 16:46:44.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1720438 of 9199611 bytes* > *09-29 16:46:45.033 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1835126 of 9199611 bytes* > *09-29 16:46:46.030 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 1949814 of 9199611 bytes* > *09-29 16:46:47.011 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2064502 of 9199611 bytes* > *09-29 16:46:48.623 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2179190 of 9199611 bytes* > *09-29 16:46:48.713 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2293878 of 9199611 bytes* > *09-29 16:46:49.280 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2408566 of 9199611 bytes* > *09-29 16:46:50.249 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2523254 of 9199611 bytes* > *09-29 16:46:51.694 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2637942 of 9199611 bytes* > *09-29 16:46:52.257 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2752630 of 9199611 bytes* > *09-29 16:46:53.247 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2867318 of 9199611 bytes* > *09-29 16:46:54.271 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 2982006 of 9199611 bytes* > *09-29 16:46:55.308 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3096694 of 9199611 bytes* > *09-29 16:46:56.320 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3211382 of 9199611 bytes* > *09-29 16:46:57.314 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3326070 of 9199611 bytes* > *09-29 16:46:58.807 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3440758 of 9199611 bytes* > *09-29 16:46:59.324 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3555446 of 9199611 bytes* > *09-29 16:47:00.309 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3670134 of 9199611 bytes* > *09-29 16:47:01.294 4208-3275/__APP_ID__ D/FileTransfer: Uploaded 3784822 of 9199611 bytes* > {color:#d04437}*09-29 16:47:02.031 4208-3275/__APP_ID__ W/FileTransfer: Error getting HTTP status code from connection.* > java.lang.IllegalStateException: closed > at com.android.okhttp.okio.RealBufferedSink.emit(RealBufferedSink.java:181) > at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:761) > at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443) > at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) > at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) > at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) > at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) > at org.apache.cordova.filetransfer.FileTransfer.createFileTransferError(FileTransfer.java:652) > at org.apache.cordova.filetransfer.FileTransfer.access$600(FileTransfer.java:69) > at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:553) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) > at java.lang.Thread.run(Thread.java:818) > *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: \{"code":3,"source":"cdvfile:\/\/localhost\/sdcard\/DCIM\/Camera\/VID_20170721_161557.mp4","target":"https:\/\/domain.tld\/api\/v1\/videos\/upload","http_status":0,"exception":"Write error: ssl=0x9c9050c0: I\/O error during system call, Broken pipe"\}* > javax.net.ssl.SSLException: Write error: ssl=0x9c9050c0: I/O error during system call, Broken pipe > at com.android.org.conscrypt.NativeCrypto.SSL_write(Native Method) > at com.android.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:771) > at com.android.okhttp.okio.Okio$1.write(Okio.java:76) > at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155) > at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) > at com.android.okhttp.okio.RealBufferedSink.write(RealBufferedSink.java:46) > at com.android.okhttp.internal.http.HttpConnection$ChunkedSink.write(HttpConnection.java:339) > at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) > at com.android.okhttp.okio.RealBufferedSink$1.write(RealBufferedSink.java:198) > at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:479) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) > at java.lang.Thread.run(Thread.java:818){color} > *09-29 16:47:02.032 4208-3275/__APP_ID__ E/FileTransfer: Failed after uploading 3899510 of 9199611 bytes.* > {panel} > It seems the error always comes avec 30s, is it related to any timeout? > (Might be some server-side timeout) > What I don't exactly understand is why, when I disable the chunkedMode, it works without any problem? -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org