You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have deployed my code on an Azure App Service container that is running node version v12.16.3. My code works perfectly on my local machine and I am able to parse the same excel file. However on my production environment on Azure I run into this error. The parsing succeeds on every 6th/7th attempt on average.
2020-08-18T08:32:26.341702094Z Error: FILE_ENDED
2020-08-18T08:32:26.342260891Z at Parse.pull (/node_modules/read-excel-file/node_modules/unzipper/lib/PullStream.js:80:28)
2020-08-18T08:32:26.342421390Z at Parse.emit (events.js:310:20)
2020-08-18T08:32:26.344061183Z at Parse.<anonymous> (/node_modules/read-excel-file/node_modules/unzipper/lib/PullStream.js:20:10)
2020-08-18T08:32:26.344410281Z at Parse.emit (events.js:322:22)
2020-08-18T08:32:26.344805879Z at finishMaybe (_stream_writable.js:639:14)
2020-08-18T08:32:26.344834579Z at endWritable (_stream_writable.js:656:3)
2020-08-18T08:32:26.345403076Z at Parse.Writable.end (_stream_writable.js:595:5)
2020-08-18T08:32:26.345778374Z at ReadStream.onend (_stream_readable.js:660:10)
2020-08-18T08:32:26.346147072Z at Object.onceWrapper (events.js:416:28)
2020-08-18T08:32:26.346483171Z at ReadStream.emit (events.js:322:22)
2020-08-18T08:32:26.346493971Z at endReadableNT (_stream_readable.js:1187:12)
2020-08-18T08:32:26.346961268Z at processTicksAndRejections (internal/process/task_queues.js:84:21)
read-excel-file v4.0.7 unzipper version v0.9.15
asyncfunctionparseFileAsJSONArray(filePath){try{returnawaitreadXlsxFile(filePath).then((rows)=>{returnrows.map((col)=>{returncol.filter((data)=>{returndata!=null;})})});}catch(e){console.log(e);returnnull;}}router.post('/uploadFile',upload.single("data"),functions.checkRouteSecurity,async(req,res)=>{if(!req.file)returnres.send({success: false,message: "No file provided"});vardataArray=awaitparseFileAsJSONArray(req.file.path);fs.unlink(req.file.path,()=>{console.log('deleted file '+req.file.path)});// delete fileif(!(dataArray&&dataArray.length>0))returnres.send({success: false,message: "Error. Could not parse file"});else{
...
res.send(response);}});
The text was updated successfully, but these errors were encountered:
I think this has something to do with using the await function, I'm trying to figure this out now too
I have changed my code to use only promises with .then and this error still pops up from time to time. It doesn't happen all the time, which is actually more frustrating as it makes it super hard to debug.
I think this has something to do with using the await function, I'm trying to figure this out now too
I have changed my code to use only promises with .then and this error still pops up from time to time. It doesn't happen all the time, which is actually more frustrating as it makes it super hard to debug.
I am getting the same error, it's true - it doesn't pops up all the time.
I have deployed my code on an Azure App Service container that is running node version v12.16.3. My code works perfectly on my local machine and I am able to parse the same excel file. However on my production environment on Azure I run into this error. The parsing succeeds on every 6th/7th attempt on average.
read-excel-file
v4.0.7unzipper
version v0.9.15The text was updated successfully, but these errors were encountered: