formidable icon indicating copy to clipboard operation
formidable copied to clipboard

Use formidable upload files, always get "Error Request Aborted"

Open EricCat opened this issue 12 years ago • 52 comments

  • I use Express(3.6.0) + formidable(latest) for upload files to S3.
  • When I submit post , then I always got Error Request Aborted.
  • incoming_form.js:
IncomingForm.prototype.parse = function(req, cb) {
.......
.......
.......
req
    .on('aborted', function() {
      self.emit('aborted');
      self._error(new Error('Request aborted'));
    })
.......
.......
.......
}
[Error: Request aborted]
child process: Request aborted
Error: Request aborted
at IncomingMessage.<anonymous>      
(/node_modules/formidable/lib/incoming_form.js:107:19)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at abortIncoming (http.js:1911:11)
at Socket.serverSocketCloseListener (http.js:1923:5)
at Socket.EventEmitter.emit (events.js:117:20)
at TCP.close (net.js:465:12)

I want to know why I got aborted and how to debug it.

EricCat avatar May 25 '14 23:05 EricCat

same here for big file uploads (1mb - 15mb)

anorsich avatar May 29 '14 07:05 anorsich

+1

piotrkowalczuk avatar Jun 11 '14 11:06 piotrkowalczuk

yep this is crashing my site (image uploads) every once in a while... not good.

floticerus avatar Jun 11 '14 16:06 floticerus

Has anyone found a solution? I am having same issue. Other uploads are working fine, but image upload is failing. This started after I upgraded node to the latest 0.10.29

nehautkur avatar Aug 13 '14 18:08 nehautkur

It is the client that is aborting, not the server. It's an error you can always get and which you must handle. It's not a bug in formidable.

OrangeDog avatar Aug 14 '14 09:08 OrangeDog

+1

yuchienho avatar Oct 28 '14 13:10 yuchienho

Same here.. happening with files lesser than 100 kb.. Anyone handled this case?

vivasaayi avatar Nov 17 '14 16:11 vivasaayi

I see this for files as small as 10kb. My client aborts the request after 2 mins latency. So there is something here at play. Removing the express bodyparser didn't helped either

Midnight-Coder avatar Apr 04 '15 22:04 Midnight-Coder

Same here....but I find the reason is that I use ths multer module for parsing multipart/form-data. So that is resulting in the formidable can't parse correctly.

yiwei1223 avatar Apr 15 '15 10:04 yiwei1223

to disable body-parser for multipart/form-data in your router

exmple solution of nodejs

app.use(express.json()).use(express.urlencoded())

bugall avatar Feb 22 '16 09:02 bugall

+1 Removing the express bodyparser didn't helped either

seanfly avatar Jul 15 '16 10:07 seanfly

Very weird this issue!!

I believe it is Express or browser problem, because I did many test with Firefox, Chrome and Chrome Canary. Only the Chrome Canary stopped! By the way... I used many ways to do upload, including my own upload lib... always stop!!

lagden avatar Jul 19 '16 01:07 lagden

+1 how to solve it

felix-w01 avatar Dec 12 '16 09:12 felix-w01

how to sovle it.

baihanbing avatar Apr 13 '17 06:04 baihanbing

try to delete this in your app.js.
app.use(express.bodyParser());
I have sovled this proplem.

baihanbing avatar Apr 13 '17 06:04 baihanbing

Getting rid of the app.use(bodyParser.json()); helped.

ksawaneh avatar Nov 26 '17 12:11 ksawaneh

I'm trying to use formidable in a firebase function, and am getting this error for every request.

nicholasstephan avatar Nov 28 '17 18:11 nicholasstephan

Same problem here, but it is very strange that my app is running perfectly on local machine, but when i upload that on c9 and my digital ocean droplet it started to giving this error. i remove body parser as well and try this from firefox also, but no luck. Have you guys got any other solution ?

nisan92 avatar Dec 13 '17 05:12 nisan92

What if I need bodyparser and formidable and i can't remove bodyparser from my app? What I should do?

VladGavriuk avatar Jan 07 '18 13:01 VladGavriuk

I have many more post request routes for which I am using body parser and in few of them I need formidable. What should I do?

kanadChourasia avatar Feb 22 '18 06:02 kanadChourasia