Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Android: Unexpected end of stream - bugs after updating SDK #150

@plougsgaard

Description

@plougsgaard

Problem

I am making presigned putObject requests like this (to AWS S3):

RNFetchBlob.fetch(
  'PUT',
  someUrl,
  { 'Content-Type': 'application/octet-stream' },
  RNFetchBlob.wrap(pathToImageFile)
)

And it worked perfectly until I updated my Android SDK (to these versions):

  • Android SDK Tools 25.2.2
  • Android SDK Platform-tools 24.0.3
  • SDK Platform (API 23) 23.0.3

I don't know what the versions were before and I don't think I can downgrade them either. Any clue where to start?

Edit: PUTing with httpie still works as it did before.

http put someUrl Content-Type:application/octet-stream < pathToImageFile

Versions

  • "react-native-fetch-blob": "^0.9.6"
  • "react-native": "^0.35.0-rc.0"

console.warn in chrome dev tools console

This is what the dev tools give me before crashing the app with the unexpected end of stream error.

timeout
RNFetchBlob error when sending request : unexpected end of stream
timeout

Stacktrace from adb logcat

10-10 20:16:24.081  6042  6982 W System.err: java.net.SocketTimeoutException: timeout
10-10 20:16:24.083  6042  6982 W System.err:    at okio.Okio$3.newTimeoutException(Okio.java:210)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.AsyncTimeout.exit(AsyncTimeout.java:277)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.AsyncTimeout$1.write(AsyncTimeout.java:186)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.RealBufferedSink.write(RealBufferedSink.java:41)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.Http1xStream$FixedLengthSink.write(Http1xStream.java:282)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
10-10 20:16:24.084  6042  6982 W System.err:    at okio.RealBufferedSink.write(RealBufferedSink.java:91)
10-10 20:16:24.084  6042  6982 W System.err:    at com.RNFetchBlob.RNFetchBlobBody.pipeStreamToSink(RNFetchBlobBody.java:268)
10-10 20:16:24.084  6042  6982 W System.err:    at com.RNFetchBlob.RNFetchBlobBody.writeTo(RNFetchBlobBody.java:119)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:47)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-10 20:16:24.084  6042  6982 W System.err:    at com.RNFetchBlob.RNFetchBlobReq$1.intercept(RNFetchBlobReq.java:298)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
10-10 20:16:24.084  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-10 20:16:24.085  6042  6982 W System.err:    at com.RNFetchBlob.RNFetchBlobReq$2.intercept(RNFetchBlobReq.java:306)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.RealCall.access$100(RealCall.java:33)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
10-10 20:16:24.085  6042  6982 W System.err:    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
10-10 20:16:24.086  6042  6982 W System.err:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
10-10 20:16:24.086  6042  6982 W System.err:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
10-10 20:16:24.086  6042  6982 W System.err:    at java.lang.Thread.run(Thread.java:818)

Edit 2016-10-11

The same code is working on iOS (10.0.2).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions