-
Notifications
You must be signed in to change notification settings - Fork 97
node: ../deps/uv/src/uv-common.c:143: uv_err_name: Assertion `0' failed. #63
Comments
We're going to need a test case to reproduce. Or at minimum a stack trace from a debug build from yourself. |
I can provide you with a code block. How can i get the stack trace? // ------------------------------------------------------------------------------------------------
// Functions
// ------------------------------------------------------------------------------------------------
function padd(n) {
if (parseInt(n) < 10) {
return 0 + n.toString();
} else {
return n;
}
}
// ------------------------------------------------------------------------------------------------
// Global variables
// ------------------------------------------------------------------------------------------------
var fs = require('fs');
var chokidar = require('chokidar');
var mysql = require('mysql');
var xml2js = require('xml2js');
var io = require('socket.io');
var folder = '/mnt/rhotex320/HotFolders/PrintEvents';
var watcher = chokidar.watch(folder, {
usePolling: true,
useFsEvents: false,
depth: 1,
interval: 1,
atomic: false
});
var parser = new xml2js.Parser({
explicitArray: false,
trim: true,
mergeAttrs: true
});
var date = new Date();
var year = date.getFullYear();
var month = padd(date.getMonth() + 1); // From 0 to 11
var day = padd(date.getDate()) // From 1 to 31
var hours = padd(date.getHours()); // From 0 to 23
var minutes = padd(date.getMinutes()); // From 0 to 59
var seconds = padd(date.getSeconds()); // From 0 to 59
var dateTime = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
// MySQL connection
var pool = mysql.createPool({
host: 'XX.XX.XX.XX',
user: 'myser',
database: 'mydb',
password: 'mypassword'
});
// Socket.io
var socket = require('socket.io-client')('http://mydomain:3000');
// ------------------------------------------------------------------------------------------------
// Initialize Watcher
// ------------------------------------------------------------------------------------------------
watcher.on('ready', function() {
watcher.on('add', function(path, stats) {
// Read the XML
fs.readFile(path, function(err, data) {
// Parse the XML
parser.parseString(data, function (err, result) {
var job_state = path.split('_').slice(-1).pop().split('.')[0];
if (job_state == 'printing' || job_state == 'done') {
pool.getConnection(function(err, connection) {
var resultJobState = result.sequence.sequence_entry.state;
var resultJobName = result.sequence.sequence_entry.job.job_name + '%';
var resultPrintsDone = result.sequence.sequence_entry.job.number_prints_done;
var resultNrToPrint = result.sequence.sequence_entry.job.number_to_print;
var statusCode = (resultJobState == 'Done') ? 2 : 1;
if (parseInt(resultPrintsDone) === parseInt(resultNrToPrint)) {
// Here we want to update the status to done!
var q1a = connection.query('SELECT * FROM `nests` WHERE `job_name` LIKE ? AND `job_state` != ?',[ resultJobName, 'Done' ], function(error, results, fields) {
if (typeof(results[0]) == 'object') {
var q1b = connection.query('UPDATE `nests` SET `printed_item` = ?, `nr_of_prints` = ?, `job_state` = ?, `statuscode` = ? WHERE `job_name` LIKE ?',
[ resultPrintsDone, resultNrToPrint, resultJobState, statusCode, resultJobName ], function(err, result) {
socket.emit(
'Rhotex 320 - Job State',
[{
path: path,
job_name: resultJobName.split('%')[0].trim(),
affected_rows: result.affectedRow,
job_state: resultJobState
}]
);
});
};
});
} else {
// Here we want to update the status to printing!
var q1a = connection.query('SELECT * FROM `nests` WHERE `job_name` LIKE ?',[ resultJobName ], function(error, results, fields) {
if (typeof(results[0]) == 'object') {
var q1b = connection.query('UPDATE `nests` SET `printed_item` = ?, `nr_of_prints` = ?, `job_state` = ?, `statuscode` = ? WHERE `job_name` LIKE ?',
[ resultPrintsDone, resultNrToPrint, resultJobState, statusCode, resultJobName ], function(err, result) {
socket.emit(
'Rhotex 320 - Job State',
[{
nestcode: results[0].nestcode,
path: path,
job_name: resultJobName.split('%')[0].trim(),
affected_rows: result.affectedRow,
job_state: resultJobState
}]
);
});
};
})
}
});
}
});
});
});
});
// ------------------------------------------------------------------------------------------------``` |
The best way to get a stack trace is to run the script using the debug build. Though those are not available for download so it would need to be built for your system. If that isn't an option then if you can provide me a more minimal test case (preferably one without any external dependencies) then I will be able to debug the issue for you. Also, was there a previous version of node where this didn't happen? If so, what was it? |
Well what i can say is that i compiled and installed it from scratch. I downloaded the source from the official site. The operating system i used it on was an old linux distro running Debian 6.0. Previously i ran v0.12.3 then i got the same error only on line 75. |
Thanks much. When building you want to run |
Thanx! I'll work on it today. |
Trevor, You i wil close this for now. Someone else in my team working on the problem right now. |
And did they resolve the issue? I am getting the same error |
Hey there, Well it doesn't occur anymore because we rewrote the scripts. It seems to appear only when there is some kind of memory leak on the system. But to answer your question more clearly no they did not resolve it, they just rewrote the script and the error does not occur anymore. |
Well I have resolved my issue. Turns out my VPS had run out of disk space.. Nice and obscure error message didn't help too much. |
Make uv_err_name() and uv_strerror() return a dynamically allocated string when the error code is not recognized. It leaks a few bytes of memory but that can't be helped. Asserting and aborting is, in my opinion, much less helpful. Fixes: nodejs/node#63
Hey everyone, i'm getting this error below. How can i figure out what i can do to fix this?
Thanx!
node: ../deps/uv/src/uv-common.c:143: uv_err_name: Assertion '0' failed.
Aborted
user@machine:
/Documents/NodeScripts$ node -v/Documents/NodeScripts$ npm -vv0.12.6
user@machine:
2.11.2
user@machine:~/Documents/NodeScripts$`
The text was updated successfully, but these errors were encountered: