TypeError: Cannot read property '0' of undefined

What I would do is take the input file and split it in two and run each half thru the flow. then take the half that failed and split it in half. repeat until you have the data that is causing the problem. Then let us see that data.