question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: write after end

See original GitHub issue

https://gist.github.com/devTristan/5aa69c2822a0da3f5e51

If the stream fast-csv is piped to doesn’t always write immediately, I get a write after end error. This happens if it waits 100ms every 100 records, or every 10ms on every other record, or pretty much any other combination.

I’ve tried this with through and through2. I’m not familiar enough with streams to replicate this issue without using a helper module, so it’s possible that this bug is present in both through and through2 instead of fast-csv. However, I’m pretty sure this is a fast-csv thing, because I can’t replicate it using other csv readers.

Commenting out this line prevents this issue from happening, but it also causes a test to fail (specifically, the github issue test for #68).

Help me, @doug-martin, you’re my only hope.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ifalldevcommented, Mar 16, 2018

Hello everybody!

I’m stuck in this issue. That is my stream pipeline:

const s3 = new AWS.S3({...})
const csvStream = csv({ headers: true }).
  on.('data', ...);
const stream = s3.getObject(params).createReadStream().pipe(csvStream)

And that is the error message: Error [ERR_STREAM_WRITE_AFTER_END]: write after end

I would appreciate any help, thanks!

0reactions
doug-martincommented, Feb 23, 2015

@seamusabshere @devTristan Np thanks for using the library!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write After End error in node.js webserver - Stack Overflow
I am struggling with my node.js hobby project due to a "write after end" Error. I have a created a node.js webserver that...
Read more >
write after end · Issue #928 · tulios/kafkajs - Connection error
After the update, we noticed that a new error is logged in our production server: Message: Connection error: write after end Stack: Error ......
Read more >
Server crashes with even simplest code. : r/node - Reddit
this is error events.js:352 throw er; // Unhandled 'error' event Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd…
Read more >
Error: write after end (Example) | Treehouse Community
Node is asynchronous, which means that functions happen at the same time. Write after end means that something is being written after the...
Read more >
Object Storage upload: [ERR_STREAM_WRITE_AFTER_END]
Hey guys! I use aws-sdk for NodeJS for Linode Object Storage but I get the following error `[ERR_STREAM_WRITE_AFTER_END]: write after end` when uploading ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found