[TIMOB-17170] Android: Cloud: File Upload: Getting Exception while uploading file above 25 mb
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 3.3.0 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | qe-3.3.0 |
| Reporter | Priya Agarwal |
| Assignee | Unknown |
| Created | 2014-06-17T11:07:52.000+0000 |
| Updated | 2018-02-28T20:03:14.000+0000 |
Description
Getting Exception while uploading file above 25 mb
Steps followed:
Download any file above 25mb in size and locate in "Resources/windows/files" in the sample app and then
In "files", open "create.js" and replace the file name 'sampleFile.txt' with the new file name which was downloaded.
1.Now install the app on to a device
2. Go to Files > Create File
3. Specify the ACS file object.
4. Press Create
Expected Result:
4.Should get a message saying "File size cannot exceed 25mb."
Actual Result:
4. Getting Exception.
Refer to logs attached.
Attachments
Which sample application is this?
Have used the sample application from latest sdk's modules folder -> modules/commonjs/ti.cloud/3.2.3/example
I tried to reproduce this issue with a video file of 30MB. I did not get
as seen by [~pagarwal] but ,got an HTTP error of the file being too large.Environment: Appc Studio : 3.3.0.201406171619 Ti SDK : 3.3.0.v20140617161713 Mac OSX : 10.8.5 Alloy : 1.4.0-rc CLI - 3.3.0-rc Code Processor: 1.1.1 Nexus 5 - android 4.4.3The ACS request from ti.cloud module is not reaching ACS server since we don't see the ACS logs contain file/create.json so this is likely failing in either ti.cloud or HTTPRequest API.
06-18 11:39:37.758: W/TiBaseFile(8586): (KrollRuntimeThread) [6087,46910] Method is not supported org.appcelerator.titanium.io.TiResourceFile : getParent 06-18 11:39:37.768: D/audio_hw_primary(185): select_devices: out_snd_device(2: speaker) in_snd_device(0: ) 06-18 11:39:37.798: I/TiAPI(8586): ACS Request: { url: "files/create.json", verb: "POST", data: {"name":"test","file":{"hidden":false,"nativePath":"file:///android_asset/Resources/windows/files/testfile.mkv","writable":false,"executable":false,"parent":null,"readonly":true,"directoryListing":[],"size":32211719,"apiName":"Ti.Filesystem.File","name":"/testfile.mkv","symbolicLink":false,"bubbleParent":true}} }) 06-18 11:39:37.808: I/TiAPI(8586): POST: https://api.cloud.appcelerator.com/v1/files/create.json?key=AKgvd9EtDRV53DqGVDNMm6rKkSWpbAIq&_session_id=yI_v1fmbObXz8a2_5Uv_O0h81m0 06-18 11:39:37.808: I/TiAPI(8586): header: {} 06-18 11:39:37.808: W/TiBaseFile(8586): (KrollRuntimeThread) [47,46957] Method is not supported org.appcelerator.titanium.io.TiResourceFile : getParent 06-18 11:39:37.848: I/TiAPI(8586): data: {"name":"test","suppress_response_codes":"true","ti_analytics":"{\"mid\":\"3d7da741d7d61c15\",\"sid\":\"e073f381-2134-469d-8b25-552c4727d264\",\"app_version\":\"1.0\",\"platform\":\"android\"}","file":{"hidden":false,"nativePath":"file:///android_asset/Resources/windows/files/testfile.mkv","writable":false,"executable":false,"parent":null,"readonly":true,"directoryListing":[],"size":32211719,"apiName":"Ti.Filesystem.File","name":"/testfile.mkv","symbolicLink":false,"bubbleParent":true}}According to Jon, this is HTTP client.
[~emerriman] to confirm this a regression.
Tested on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.2.3.201404181520, 3.3.0.201406171619 Titanium SDK, build: 3.2.3.GA, 3.3.0.v20140619124113 Titanium CLI, build: 3.2.3.GA, 3.3.0-rc Alloy: 1.3.1 Ti.Cloud: 3.2.2 and 3.2.3 Broken pipe error occurred using the following combination: ti.cloud 3.2.2 with SDK 3.2.3.GA: {color:red}ERROR{color} ti.cloud 3.2.3 with SDK 3.2.3.GA: {color:red}ERROR{color} ti.cloud 3.2.2 with SDK 3.3.0.v20140619124113: {color:red}ERROR{color} ti.cloud 3.2.3 with SDK 3.3.0.v20140619124113: {color:red}ERROR{color}
Thank you. Not a regression, moving to 3.3.1.
[~jalter], thoughts?
[~ingo] I'm guessing the devices are running out of memory... It looks like all of the file's data is being held in memory. As far as NATIVESDK goes, iOS will be fixed once this is resolved on APSHTTPClient, on Android we will need to make some changes. [~wluu] Go ahead and create tickets for NATIVESDK iOS and Android... the iOS one will be dependent on this ticket's equivalent in iOS and will just involve updating the library.
[~jalter] Filed the NATIVESDK ticket for Android. And, I was not able to reproduce the iOS issue anymore; might've been a backend hiccup. I am getting this expected response when I set debug to true:
APS Response: <html> <head><title>413 Request Entity Too Large</title></head> <body bgcolor="white"> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx/1.2.9</center> </body> </html>Re-opening: Windows 8.1 Appcelerator Studio, build: 3.3.0.201407081443 Titanium SDK, build: 3.3.0.v20140709184436 Titanium CLI, build: 3.3.0-rc4 Alloy: 1.4.0-rc4 Ti.Cloud: 3.2.3 Getting the following errors:
E/TiHttpClient(17693): (TiHttpClient-3) [121174,211102] HTTP Error (javax.net.ssl.SSLException): Write error: ssl=0x727d4d98: I/O error during system call, Broken pipe E/TiHttpClient(17693): javax.net.ssl.SSLException: Write error: ssl=0x727d4d98: I/O error during system call, Broken pipe E/TiHttpClient(17693): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_write(Native Method) E/TiHttpClient(17693): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:706) E/TiHttpClient(17693): at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:87) E/TiHttpClient(17693): at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:94) E/TiHttpClient(17693): at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:169) E/TiHttpClient(17693): at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:192) E/TiHttpClient(17693): at org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:161) E/TiHttpClient(17693): at org.apache.http.impl.conn.AbstractPooledConnAdapter.close(AbstractPooledConnAdapter.java:158) E/TiHttpClient(17693): at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) E/TiHttpClient(17693): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637) E/TiHttpClient(17693): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1291) E/TiHttpClient(17693): at java.lang.Thread.run(Thread.java:856) E/TiHttpClient(17693): (TiHttpClient-4) [120832,847167] HTTP Error (javax.net.ssl.SSLProtocolException): Write error: ssl=0x7276b710: Failure in SSL library, usually a protocol error E/TiHttpClient(17693): javax.net.ssl.SSLProtocolException: Write error: ssl=0x7276b710: Failure in SSL library, usually a protocol error E/TiHttpClient(17693): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_write(Native Method) E/TiHttpClient(17693): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:706) E/TiHttpClient(17693): at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:87) E/TiHttpClient(17693): at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:94) E/TiHttpClient(17693): at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:169) E/TiHttpClient(17693): at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:192) E/TiHttpClient(17693): at org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:161) E/TiHttpClient(17693): at org.apache.http.impl.conn.AbstractPooledConnAdapter.close(AbstractPooledConnAdapter.java:158) E/TiHttpClient(17693): at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) E/TiHttpClient(17693): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653) E/TiHttpClient(17693): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637) E/TiHttpClient(17693): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1291) E/TiHttpClient(17693): at java.lang.Thread.run(Thread.java:856)Was this ever resolved? I still see it as "open," not reopened. Reviewing the history, it does not appear to have been resolved.
[~cbarber] the ticket (I believe) was that the API should be returning that the file size was too large. Instead, it was throwing an exception. So, a wierd case, but still valid AFAIK.
Yes we have a limit of 25m
I see now. The error was not properly handled. How unfortunate.