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.

CSV w/ Empty Last Line causes ECONNRESET for short files.

See original GitHub issue

We have been using v1.0.3 without issue, upgraded to 1.1.3 and have been having issues.

On a really short CSV file, if there is a trailing line break (i.e. last line empty), it will throw a ECONNRESET error.

From digging into it, it looks like the csvLineBuffer gets set to empty (via setPartial) and because of this when _flush is called it doesn’t wait until everything is done processing. I think this is because it could be a partial new line, but essentially any buffer that happens to end on a line break will trigger this, as well as a file that ends on it.

This is a sample CSV we were using

code,name
C,Cinema
D,Direct Mail
B,Mobile
O,Online Display
E,Online Video
M,Opt-In Email
X,Outdoor
P,Print
R,Radio
S,Social
T,Television
V,Viral
M,Opt-In Email
X,Outdoor
P,Print
R,Radio
S,Social
T,Television
V,Viral

Edit: it seems to work without issue on longer files. Our current highWaterMark is 10,000. It also only happens with workerNum > 1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
fataltracecommented, May 30, 2017

Yes

0reactions
Keyangcommented, Jul 12, 2018

Close due to no activity

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSV file written with Python has blank lines between each ...
This code reads thefile.csv , makes changes, and writes results to thefile_subset1 . However, when I open the resulting csv in Microsoft Excel,...
Read more >
support csv files ending with empty last line · Issue #150
It is not uncommon to have files ending with an empty line. Papaparse fails in handling these, returning errors about malformed file.
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug listing with status RESOLVED with resolution FIXED as at 2022/12/24 19:46:07 ... Bug:1824 - "ebuild for LFM (Last File Manager)" status:RESOLVED ...
Read more >
"Error reading native data" When Processing CSV File With ...
Oracle(R) BPEL Process Manager 10g - Version 10.1.3.3 and later: "Error reading native data" When Processing CSV File With Empty Line From ...
Read more >
elasticdump
Standard Install. Elasticdump works by sending an input to an output . Both can be either an elasticsearch URL or a File. Elasticsearch:....
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