新手求助:昨天写了一个服务器,放后台昨晚跑还正常,今天看下服务崩掉了~
发布于 5 年前 作者 huangzh123 3637 次浏览 最后一次编辑是 4 年前 来自 问答

错误信息: console.log(“node: …/deps/uv/src/unix/stream.c:1329: uv_read_stop: Assertion `!uv__io_active(&stream->io_watcher, 4) || !(&stream->write_completed_queue == (&stream->write_completed_queue)->prev) || !(&stream->write_queue == (&stream->write_queue)->prev) || stream->shutdown_req != ((void *)0) || stream->connect_req != ((void *)0)’ failed. ’)”

app.js

var express=require("express");
var http=require("http");
var bodyParser = require('body-parser');
var DBTool=require("./DBTool");
var log4j=require('./Log4j');
var app=express();

app.set('port', '4005');

log4j.use(app);
app.use(express.static('public'));
app.use(bodyParser.json());
app.use("/favicon.ico",function(req,res){
    res.send();
});
app.post("/insert",function(req,res){
    var sql=" INSERT INTO list (`company`, `name`, `count`, `time`) VALUES ( ?,?,?,?)";
    var options=req.body;
    if(!options.company || !options.name || !options.count || !options.time){
        res.send({status:"500","data":"请将内容填写完整!"});
    }
    var param=[
        options.company?options.company:null,
        options.name?options.name:null,
        options.count?options.count:null,
        options.time?options.time:null
    ]
    console.log(param)
    DBTool.Execute(sql,param,function(err,datas){
        if(err){
            res.send({status:"500","exception":"插入出错了!"});
        }
        res.send({status:"200","data":"添加成功!"})
    })

})

http.createServer(app).listen(app.get('port'), function(){
    console.log(">>服务器已启动,端口号:" + app.get('port'));
});

//捕获系统异常
process.on('uncaughtException', function (err) {});

 \n```
2 回复

node: …/deps/uv/src/unix/stream.c:1329: uv_read_stop: Assertion `!uv__io_active(&stream->io_watcher, 4) || !(&stream->write_completed_queue == (&stream->write_completed_queue)->prev) || !(&stream->write_queue == (&stream->write_queue)->prev) || stream->shutdown_req != ((void *)0) || stream->connect_req != ((void *)0)

这个是什么错误呢 ?求大牛帮忙下

接口就一个应该没问题, 这个主要是一个静态网站,最后报错日志如下:(linux时间不准确) … [2015-03-13 08:44:22.106] [DEBUG] OpenServer - GET /Tools/MoCoop/img/back.png [2015-03-13 08:44:22.173] [DEBUG] OpenServer - GET /Tools/MoCoop/img/forward-grey.png [2015-03-13 08:44:27.429] [DEBUG] OpenServer - GET /img/test2.jpg [2015-03-13 08:44:27.560] [DEBUG] OpenServer - GET /img/test2.jpg [2015-03-13 08:45:00.404] [DEBUG] OpenServer - GET /index.html?from=timeline&isappinstalled=0 [2015-03-13 08:45:00.507] [DEBUG] OpenServer - GET /Tools/MoCoop/MoCoop.css [2015-03-13 08:45:00.565] [DEBUG] OpenServer - GET /css/style.css [2015-03-13 08:45:00.913] [DEBUG] OpenServer - GET /Tools/jquery-2.1.3.js [2015-03-13 08:45:00.922] [DEBUG] OpenServer - GET /Tools/Ractive.js [2015-03-13 08:45:00.952] [DEBUG] OpenServer - GET /js/pages/index.js [2015-03-13 08:45:00.959] [DEBUG] OpenServer - GET /js/common.js [2015-03-13 08:45:00.960] [DEBUG] OpenServer - GET /Tools/MoCoop/MoCoop.js [2015-03-13 08:45:00.963] [DEBUG] OpenServer - GET /js/dataInterface.js [2015-03-13 08:45:04.790] [DEBUG] OpenServer - GET /img/test2.jpg [2015-03-13 08:45:04.794] [DEBUG] OpenServer - GET /img/bg.png [2015-03-13 08:45:04.928] [DEBUG] OpenServer - GET /Tools/fastclick.js node: …/deps/uv/src/unix/stream.c:1329: uv_read_stop: Assertion `!uv__io_active(&stream->io_watcher, 4) || !(&stream->write_completed_queue == (&stream->write_completed_queue)->prev) || !(&stream->write_queue == (&stream->write_queue)->prev) || stream->shutdown_req != ((void *)0) || stream->connect_req != ((void *)0)’ failed.

回到顶部