joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 770 forks source link

unexpected end of stream #399

Open AminTaghikhani opened 4 years ago

AminTaghikhani commented 4 years ago

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)

luco commented 4 years ago

This happens only on Android for me.

AminTaghikhani commented 4 years ago

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

shen-lan commented 4 years ago

Hi, How exactly did you solve it?

AminTaghikhani commented 4 years ago

Add android permission at run time WRITE_EXTERNAL_STORAGE

mohitpasiapac commented 4 years ago

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

ravikumarpvm commented 4 years ago
  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 commented 4 years ago

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 commented 4 years ago

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

hussainhspl commented 4 years ago

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

linus-komnick commented 2 years ago

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

ghoshabhi commented 2 years ago

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
}
CDBridger commented 1 year ago

having same problem, have all those permissions

supto09 commented 1 year ago

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

favazpa commented 10 months ago

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

18523237715 commented 9 months ago

This happens on some phones and why

18523237715 commented 9 months ago

image