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

Getting the following error Write error: ssl=0xc32e7440: I/O error during system call, Broken pipe

Open developercode1 opened this issue 6 years ago • 5 comments

I'm getting the following error Write error: ssl=0xc32e7440: I/O error during system call, Broken pipe when trying to uplaod an image to AWS S3 Bucket. It happens only when image size is greater or equal to 6MB.

react native version: 0.51 react native fetch blob version: 0.10.8 OS: Android Oreo

Here is the code snippet(If it's helpful)

import RNFetchBlob from 'react-native-fetch-blob';
import { API } from 'aws-amplify';

export const getSignedUrl = (key, metaData) => (
	new Promise<{ url: string}>((resolve, reject) => {
		let apiName = "GetSignedURL";
		let path = '/';
		let options = { body: { key: `public/${key}`, metaData }};
		API.post(apiName, path, options)
		.then(res => resolve(res))
		.catch(err => reject(err));
	})
)

 const generalisedUploadImage = (key, metaData, imageLocalPath) => (
	new Promise((resolve, reject) => {
		getSignedUrl(key, metaData)
			.then(res => {
				console.log(res);
				RNFetchBlob.fetch('PUT', res.url, 
					{ 
						'Content-Type': 'image/jpeg', 
						'x-amz-acl': 'bucket-owner-full-control',
						'x-amz-meta-timestamp': metaData.timestamp 
					},
					RNFetchBlob.wrap(imageLocalPath)
				)
				.then(res => { console.log(res); resolve(res) })
				.catch(err => { console.log("reject", err); reject(err); })
			})
			.catch(err => {
				console.log("err", err);
				reject(err);
			})
	})
);

I suspect the problem with the RNFetchBlob.wrap method. Is there any size limit for upload ?

TIA

developercode1 avatar Aug 02 '18 13:08 developercode1

@developercode1 Have you managed to figure it out? I'm also having this issue

lucas-dolsan avatar Jan 31 '19 13:01 lucas-dolsan

I got same issue when uploading a video file. Another one is that the S3 object is not created even though everything seems to succeed (no error).

ngocketit avatar Mar 30 '19 10:03 ngocketit

Getting the same issue on marshmallow (23), pie (28) and Q beta 2 while uploading a image file of appx 1 Mb. Any solution ? react-native version: 0.59.2

neilharia7 avatar Apr 23 '19 08:04 neilharia7

Getting the same issue on marshmallow (23), pie (28) and Q beta 2 while uploading a image file of appx 1 Mb. Any solution ? react-native version: 0.59.2

Works as of now, the issue was probably on the server side limiting the amount of data sent on the request

neilharia7 avatar Apr 25 '19 10:04 neilharia7

I'm still getting this with blobs that I create from blob.slice

Sid-Turner-Ellis avatar Apr 13 '23 06:04 Sid-Turner-Ellis