Node js BackEnd error Error: read ECONNRESET
-
Chào các cao thủ,
em newbie làm backend Node js + PG SQL khi em dùng Postman test gọi query lên server thỉnh thoảng bị lỗiError: read ECONNRESET
at _errnoException (util.js:992:11)
at TCP.onread (net.js:618:25)
đoạn truy vấn của em :
try {
var userName = req.body.userName;
var passWord =utils._hashPassword(req.body.passWord);
var permission = req.body.permission;
const data = await db.query(contants.stringSQL.insertUser,[userName,passWord,permission]);
var message = 'Success';
var token = utils.toAuthJSON(userName);
return res.status(HTTPStatus.CREATED).json({message,token});
} catch (e) {
console.log(e);
return res.status(HTTPStatus.BAD_REQUEST).json(e);
}
Mong các anh chỉ giúp em các fix em cảm ơn nhiều ạ :((
-
Bạn có Log của PG không. Lôĩ này là do 1 bên kill connection của bạn.
-
Nguyen Hien em hỏi ngu log của PG là log gì lấy thế nào hả bác
-
@Johnny-Tran https://www.postgresql.org/docs/9.1/static/runtime-config-logging.html
/var/log/postgresql
Bạn làm với services nào cũng nên quan tâm access_log với error_log. Hai cái này giúp debug tốt.