doramart / DoraCMS

DoraCMS是基于Nodejs+eggjs+mongodb编写的一套内容管理系统,结构简单,较目前一些开源的cms,doracms易于拓展,特别适合前端开发工程师做二次开发。
https://www.html-js.cn
MIT License
3.47k stars 1.02k forks source link

建议迁移到koa上吧 #13

Closed chinakids closed 4 years ago

chinakids commented 8 years ago
GET /admin/manage/adminUsersList 500 103.779 ms - -
_http_outgoing.js:335
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
    at ServerResponse.setWriteHeadHeaders (/Users/xuanyong/Downloads/DoraCMS-master/node_modules/express-session/node_modules/on-headers/index.js:82:19)
    at ServerResponse.writeHead (/Users/xuanyong/Downloads/DoraCMS-master/node_modules/express-session/node_modules/on-headers/index.js:41:36)
    at ServerResponse.writeHeader (_http_server.js:233:18)
    at /Users/xuanyong/Downloads/DoraCMS-master/models/db/siteFunc.js:486:21
    at /Users/xuanyong/Downloads/DoraCMS-master/models/db/siteFunc.js:429:21
    at /Users/xuanyong/Downloads/DoraCMS-master/models/ContentTemplate.js:47:17
    at Query.<anonymous> (/Users/xuanyong/Downloads/DoraCMS-master/node_modules/mongoose/lib/query.js:2140:28)
    at /Users/xuanyong/Downloads/DoraCMS-master/node_modules/mongoose/node_modules/kareem/index.js:177:19
    at /Users/xuanyong/Downloads/DoraCMS-master/node_modules/mongoose/node_modules/kareem/index.js:109:16
    at process._tickCallback (node.js:355:11)

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/xuanyong/.nvm/versions/node/v0.12.2/bin/node" "/Users/xuanyong/.nvm/versions/node/v0.12.2/bin/npm" "start"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! doracms@1.0.9 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the doracms@1.0.9 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the doracms package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get their info via:
npm ERR!     npm owner ls doracms
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xuanyong/Downloads/DoraCMS-master/npm-debug.log
chinakids commented 8 years ago

初始化部署就出问题了...不知道哪里提前res.end了貌似.....懒得调...express天生让人累

chinakids commented 8 years ago

1.0.9初次部署始终会触发db/siteFunc.js 486/487行的res.end ... 也要先注释掉 才能初次设置。不然后面没办法setHeader导致错误...........po主检查一下吧

chinakids commented 8 years ago

找到问题了

(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

redis错误没有抛出错误,直接导致renderToTargetPageByType()方法执行出了问题..

解决(此问题在内存大于16G 的时候比较常见....):

[零时]
redis-cli
config set stop-writes-on-bgsave-error no

[最佳]
修改/etc/sysctl.conf
增加:
vm.overcommit_memory = 1

mac的同学注意下 redis 的 db 写入权限

loaden commented 5 years ago

老版本的问题解决了就关了吧