Coder Social home page Coder Social logo

Comments (6)

niksumeiko avatar niksumeiko commented on June 14, 2024

Have tried to debug a little more, and found out that the issue is happening before I do any uploading to S3. When logging ReadStreams from files array, I get some with an empty buffer (see first ReadStream in the example below):

[ReadStream {
   _readableState:
   ReadableState {
     objectMode: false,
     highWaterMark: 65536,
     buffer: [],
     length: 0,
     pipes: null,
     pipesCount: 0,
     flowing: null,
     ended: false,
     endEmitted: false,
     reading: false,
     sync: true,
     needReadable: false,
     emittedReadable: false,
     readableListening: false,
     resumeScheduled: false,
     defaultEncoding: 'utf8',
     ranOut: false,
     awaitDrain: 0,
     readingMore: false,
     decoder: null,
     encoding: null },
  readable: true,
  domain: null,
  _events:
   { end: [Function],
     open: { [Function: g] listener: [Function: close] } },
  _eventsCount: 2,
  _maxListeners: undefined,
  path: '/var/folders/fh/w1h08fy12fngm0x499_3xr300000gn/T/1461446649726files174659 copy.jpg',
  fd: null,
  flags: 'r',
  mode: 438,
  start: undefined,
  end: undefined,
  autoClose: true,
  pos: undefined,
  fieldname: 'files',
  filename: '174659 copy.jpg',
  encoding: '7bit',
  transferEncoding: '7bit',
  mime: 'image/jpeg',
  mimeType: 'image/jpeg',
  destroyed: true

}, ReadStream {
  _readableState:
   ReadableState {
     objectMode: false,
     highWaterMark: 65536,
     buffer: [ <Buffer ff d8 ff e1 23 a8 45 78 69 66 00 00 49 49 2a 00 08 00 ... > ],
     length: 58676,
     pipes: null,
     pipesCount: 0,
     flowing: null,
     ended: true,
     endEmitted: false,
     reading: false,
     sync: false,
     needReadable: false,
     emittedReadable: true,
     readableListening: false,
     resumeScheduled: false,
     defaultEncoding: 'utf8',
     ranOut: false,
     awaitDrain: 0,
     readingMore: false,
     decoder: null,
     encoding: null },
  readable: true,
  domain: null,
  _events: { end: [Function] },
  _eventsCount: 1,
  _maxListeners: undefined,
  path: '/var/folders/fh/w1h08fy12fngm0x499_3xr300000gn/T/1461446650318filesJANA8828-logo.jpg',
  fd: 35,
  flags: 'r',
  mode: 438,
  start: undefined,
  end: undefined,
  autoClose: true,
  pos: undefined,
  fieldname: 'files',
  filename: 'JANA8828-logo.jpg',
  encoding: '7bit',
  transferEncoding: '7bit',
  mime: 'image/jpeg',
  mimeType: 'image/jpeg'
}]

Also interesting to notice, that first ReadStream from the example above has destroyed: true property, but the second one lacks it. Directly opposite to buffer property values.

Probably, means the problem is inside async-busboy or inside busboy itself.

from async-busboy.

m4nuC avatar m4nuC commented on June 14, 2024

@manakor Thanks for reporting!
We have been using the library quite extensively (on stage) on Mac OSX and Ubuntu 15 without bumping into this issue so far. What OS/NodeJS version are you running ?

from async-busboy.

niksumeiko avatar niksumeiko commented on June 14, 2024

Mac OSX 10, Nodejs 5.

from async-busboy.

m4nuC avatar m4nuC commented on June 14, 2024

I've made a small fix in 0.0.6 that hopefully should solve your problem.

Basically the code now waits that the writeStream is opened before creating the readStream.
This should ensure that the file array always contains valid read stream.

Check it out and let me know if that doesn't solve your issue.

Thanks again for reporting!

from async-busboy.

ivancortesromero avatar ivancortesromero commented on June 14, 2024

@m4nuC do you think this issue is related? It seems similar.

from async-busboy.

m4nuC avatar m4nuC commented on June 14, 2024

@ivancortesromero sorry for the delay. Will check over the weekend

from async-busboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.