Error: EMFILE, too many open files '/home/user/app/views/index.html'

47 views
Skip to first unread message

Chen Wang

unread,
Nov 27, 2014, 1:48:46 PM11/27/14
to nod...@googlegroups.com
Hey Guys,
I am using ejs-local to render views for my node.js application. I saw lots of too many open files" exception when rendering views:
Error: EMFILE, too many open files '/home/user/app/views/index.html'
    at Object.fs.openSync (fs.js:432:18)
    at fs.readFileSync (fs.js:289:15)
    at Object.exports.renderFile (/home/wangchen/bweb_auto/node_modules/ejs-locals/node_modules/ejs/lib/ejs.js:313:9)
    at View.module.exports [as engine] (/home/user/app/node_modules/ejs-locals/index.js:85:7)
    at View.render (/home/user/app/node_modules/express/lib/view.js:76:8)
    at Function.app.render (/home/user/app/node_modules/express/lib/application.js:506:10)
    at ServerResponse.res.render (/home/user/app/node_modules/express/lib/response.js:759:7)
    at /home/user/app/routes/index.js:226:17
    at Query._callback (/home/user/app/node_modules/orm/lib/ChainFind.js:190:13)
    at Query.Sequence.end (//home/user/appode_modules/mysql/lib/protocol/sequences/Sequence.js:75:24)

which tear down the entire website.
Although seemingly adding ulimit might solve this problem: it current is set to 1024. I am more concerted about possible bug in ejs code/node, that didn't close the file when necessary.
Have you guys come cross similar thing?

Thanks,
Chen
Reply all
Reply to author
Forward
0 new messages