Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17170] Android: Cloud: File Upload: Getting Exception while uploading file above 25 mb

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsqe-3.3.0
ReporterPriya Agarwal
AssigneeUnknown
Created2014-06-17T11:07:52.000+0000
Updated2018-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

FileDateSize
exception.txt2014-06-17T11:07:52.000+00003110

Comments

  1. Ingo Muschenetz 2014-06-17

    Which sample application is this?
  2. Priya Agarwal 2014-06-18

    Have used the sample application from latest sdk's modules folder -> modules/commonjs/ti.cloud/3.2.3/example
  3. Lokesh Choudhary 2014-06-18

    I tried to reproduce this issue with a video file of 30MB. I did not get
    I/O error during system call, Broken pipe
    as seen by [~pagarwal] but ,got an HTTP error of the file being too large.
       [ERROR] :  TiHttpClient: (TiHttpClient-2) [27571,56991] HTTP Error (org.apache.http.client.HttpResponseException): Request Entity Too Large
       [ERROR] :  TiHttpClient: org.apache.http.client.HttpResponseException: Request Entity Too Large
       [ERROR] :  TiHttpClient: 	at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:259)
       [ERROR] :  TiHttpClient: 	at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:218)
       [ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)
       [ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)
       [ERROR] :  TiHttpClient: 	at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1291)
       [ERROR] :  TiHttpClient: 	at java.lang.Thread.run(Thread.java:841)
       [ERROR] :  undefined: Unexpected token <
       [ERROR] :  Unexpected token <
       
    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.3
  4. Lokesh Choudhary 2014-06-18

    The 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}}
       
  5. Eric Merriman 2014-06-18

    According to Jon, this is HTTP client.
  6. Ingo Muschenetz 2014-06-19

    [~emerriman] to confirm this a regression.
  7. Samuel Dowse 2014-06-19

    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}
  8. Ingo Muschenetz 2014-06-19

    Thank you. Not a regression, moving to 3.3.1.
  9. Wilson Luu 2014-06-19

  10. Ingo Muschenetz 2014-06-19

    [~jalter], thoughts?
  11. Jon Alter 2014-06-19

    [~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.
  12. Wilson Luu 2014-06-20

    [~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>
        
  13. Samuel Dowse 2014-07-10

    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)
        
  14. Ingo Muschenetz 2014-07-11

    Was this ever resolved? I still see it as "open," not reopened. Reviewing the history, it does not appear to have been resolved.
  15. Ingo Muschenetz 2016-09-20

    [~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.
  16. Wei Kong 2016-09-20

    Yes we have a limit of 25m
  17. Chris Barber 2016-09-20

    I see now. The error was not properly handled. How unfortunate.

JSON Source