Comments (10)
We're going to need a test case to reproduce. Or at minimum a stack trace from a debug build from yourself.
from node-convergence-archive.
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
}]
);
});
};
})
}
});
}
});
});
});
});
// ------------------------------------------------------------------------------------------------```
from node-convergence-archive.
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?
from node-convergence-archive.
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.
from node-convergence-archive.
Thanks much. When building you want to run ./configure --debug
to produce the debug build. Then in the folder there will be node_g
which is the debug executable. If you can reproduce the issue with this then we'll have a lot more information to go on.
from node-convergence-archive.
Thanx! I'll work on it today.
from node-convergence-archive.
Trevor,
You i wil close this for now. Someone else in my team working on the problem right now.
Thanks for your help.
from node-convergence-archive.
And did they resolve the issue? I am getting the same error
from node-convergence-archive.
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.
from node-convergence-archive.
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.
from node-convergence-archive.
Related Issues (20)
- Node Foundation TSC Meeting 2015-06-24 HOT 5
- Optionally log master secrets for TLS connections HOT 1
- Node Foundation TSC Meeting 2015-07-01 HOT 8
- Consider/Evaluate Amazon's "s2n" TLS library HOT 6
- Cannot call method then of undefined HOT 2
- Node Foundation TSC Meeting 2015-07-08 HOT 2
- uv_err_name: Assertion `0' failed during npm install HOT 3
- First release as the Node Foundation? HOT 1
- Node Foundation TSC Meeting 2015-07-15 HOT 16
- Node Foundation TSC Meetings are not being uploaded to Youtube HOT 6
- Node Foundation TSC Meeting 2015-07-22 HOT 7
- Node, OpenSSL, and patented encryption algorithms HOT 10
- Node Foundation TSC Meeting 2015-07-29 HOT 9
- net::Server.unref() failed on cluster mode HOT 3
- Provide a fs.createDirectoryReadStream (or something similar) to return a stream of files and directories within a directory HOT 1
- make install doesn't expand ~ on Linux HOT 2
- npm does nothing HOT 1
- [Converge] MSI related changes HOT 1
- save us from our own trailing periods HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-convergence-archive.