rn-fetch-blob icon indicating copy to clipboard operation
rn-fetch-blob copied to clipboard

unexpected end of stream

Open AminTaghikhani opened this issue 5 years ago • 16 comments

here my info

info

React Native Environment Info:
  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    Memory: 3.32 GB / 11.89 GB
  Binaries:
    Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - ~\AppData\Roaming\npm\npm.CMD
  IDEs:
    Android Studio: Version  3.2.0.0 AI-181.5540.7.32.5056338
"react": "16.8.3",
"react-native": "0.59.9",
"rn-fetch-blob": "^0.10.13", && "rn-fetch-blob": "^0.10.15",

I using fetch Post method . and I checked with CURL and received result and it worked. before upgrading everythings work well

This has only starting happening after upgrading RN.(54 to 59)

AminTaghikhani avatar Jul 11 '19 12:07 AminTaghikhani

This happens only on Android for me.

luco avatar Jul 19 '19 18:07 luco

@luco I checked my code, and added write and read storage permission and the problem is gone.

AminTaghikhani avatar Jul 19 '19 18:07 AminTaghikhani

Hi, How exactly did you solve it?

shen-lan avatar Aug 06 '19 03:08 shen-lan

Add android permission at run time WRITE_EXTERNAL_STORAGE

AminTaghikhani avatar Aug 07 '19 12:08 AminTaghikhani

Thanks Man!, @AminTaghikhani I searched here and there and finally this answer saved my day. Thanks

mohitpasiapac avatar Jan 23 '20 11:01 mohitpasiapac

  RNFetchBlob.config({
    trusty : true,
    timeout: 1000

  })
  .fetch(config.method,strings.API.BASE_URL+config.url,headers,JSON.stringify(config.data))
  .then((res) => {
          console.log(`We got your Response string- ${res.text()}`);
          let data = {data:res.json()}
          success(data);
  })
  .catch((err) => {
    console.log(`Whoopsy doodle! Error - ${err}`)
    failure(err);
  });

this is my code ... i am getting error

" sl=0x9eaa0e80 info_callback ignored 02-05 14:43:59.249 8855-11266/com.consumerconnect D/NativeCrypto: doing handshake -- ret=1 02-05 14:43:59.249 8855-11266/com.consumerconnect I/System.out: gba_cipher_suite:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 02-05 14:43:59.250 8855-11266/com.consumerconnect I/System.out: [CDS]rx timeout:1000 02-05 14:43:59.250 8855-11266/com.consumerconnect I/System.out: [CDS]rx timeout:1000 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 NativeCrypto_SSL_interrupt 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: sslNotify, appData=0x9dc9db40 ret=1 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: sslNotify, appData=0x9dc9db40 ret=1 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 info_callback where=0x4008 ret=256 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 SSL3 alert write:W:CN warning close notify 02-05 14:43:59.254 8855-11266/com.consumerconnect D/NativeCrypto: ssl=0x9eaa0e80 info_callback ignored 02-05 14:43:59.255 8855-11266/com.consumerconnect I/System.out: close [socket][/192.168.43.243:35867] ReactNativeJS: Whoopsy doodle! Error - Error: unexpected end of stream "

ravikumarpvm avatar Feb 05 '20 09:02 ravikumarpvm

is it related to ssl pinning? i am using UAT server and don't want to do ssl pinning. how i can track my error with " unexpected end of stream". **

this code is working in development mode but in release mode..

** anyone help me out this?

ravikumarpvm avatar Feb 05 '20 09:02 ravikumarpvm

this code is working in development mode but not in release mode..

ravikumarpvm avatar Feb 05 '20 09:02 ravikumarpvm

Add line below in AndroidManifest.xml <uses-permission android:name="android.permission.CAMERA" /> Refer PermissionsAndroid in react native docs

hussainhspl avatar Mar 27 '20 10:03 hussainhspl

I fixed it by upgrading my FLIPPER_VERSION to 0.145.0 in "./android/gradle.properties" as suggested here: https://github.com/joltup/rn-fetch-blob/issues/628#issuecomment-1106784980

linus-komnick avatar May 16 '22 15:05 linus-komnick

Can on of the contributors or anyone else explain why is this related to permissions at all ? FWIW, we already have the storage write and camera perms, not for this issue but because our app uses it.

The error we see is:

unexpected end of stream on Connection{
  api-stg.example.com:443,
  proxy=DIRECT
  hostAddress=api-stg.example.com/xxx.xx.x.xx:443
  cipherSuite=TLS_AES_128_GCM_SHA256
  protocol=http/1.1
}

ghoshabhi avatar May 17 '22 18:05 ghoshabhi

having same problem, have all those permissions

CDBridger avatar Oct 12 '22 00:10 CDBridger

Suddenly started facing the same problem in FLIPPER_VERSION=0.125.0. Event updating to FLIPPER_VERSION=0.182.0 is not helping

supto09 avatar May 09 '23 05:05 supto09

@luco did your issue got fixed? if yes please tell how you fixed.

favazpa avatar Jul 27 '23 09:07 favazpa

This happens on some phones and why

18523237715 avatar Aug 23 '23 08:08 18523237715

image

18523237715 avatar Aug 23 '23 08:08 18523237715