Child process spawn: Unknown system errno 740 - node.js

If I execute just this one line:
require('child_process').spawn('C:\\Users\\me\\AppData\\Local\\Temp\\1131128-16232-bid56z__some_installer.exe').on('close', function (code) { });
Then I get an exception:
Error: spawn Unknown system errno 740
I'm at a loss. Can someone help me shed some light on this?

On Windows, error 740 (ERROR_ELEVATION_REQUIRED) means that the software needs to run as administrator. Run it with runas.

Related

Error: spawn EMFILE Node js

I am getting this error. While a person logs in to the application, logs are entered into a file using utilityWrapper. This file is read/Written when ever some activity is happening in the application. Then suddenly after some time
'throw errnoException(process._errno, 'spawn');
Error: spawn EMFILE
at errnoException (child_process.js:988:11)
at ChildProcess.spawn (child_process.js:935:11)
at Object.exports.spawn (child_process.js:723:9)
at Object.Logger (/web/utilityWrapper.js:21:17)
at process.env.NODE_TLS_REJECT_UNAUTHORIZED (/web/server.js:141:17)
at process.EventEmitter.emit (events.js:95:17)
at process._fatalException (node.js:272:26)
This error come up.
Please Help me.
This had happened due to various reasons. The code had many console.logs, which was printing many things on the command prompt on which the server was running. As it was writing to a file, it was using a file descriptor(fd). The ulimit of file descriptor is 1024.
using the command
lsof - -i -n -P | grep nodejs
I was able to capture the information about each fd.
Fd count used to increase when a user loogged into the application.The ldap sockets and mysql db connections also consumed a large amount of fd's.
So guys keep these points in mind when you get this kind of Error.

Crossbar Thruway worker crashes

I have a Crossbar.io server with PHP Thruway workers. Recently, I started getting the following error. It happens about once a day now:
2016-04-17T21:08:12+0000 [Router 9572] Unable to format event {'log_logger': <Logger 'crossbar.router.protocol.WampWebSocketServerProtocol'>, 'log_time': 1460927292.17918, 'log_source': None, 'log_format': 'Traceback (most recent call last):\n File "/usr/local/lib/python2.7/site-packages/autobahn/wamp/websocket.py", line 88, in onMessage\n for msg in self._serializer.unserialize(payload, isBinary):\n File "/usr/local/lib/python2.7/site-packages/autobahn/wamp/serializer.py", line 106, in unserialize\n raise ProtocolError("invalid serialization of WAMP message ({0})".format(e))\nProtocolError: invalid serialization of WAMP message (Expected object or value)\n'}: tuple index out of range
2016-04-17T21:08:15+0000 [Guest 9583] The connected has closed with reason: close
2016-04-17T21:08:19+0000 [Guest 9583] PHP Fatal error: Call to a member function call() on null in /var/www/html/pickupServer/vendor/voryx/thruway/src/Thruway/ClientSession.php on line 106
2016-04-17T21:08:19+0000 [Guest 9583] Fatal error: Call to a member function call() on null in /var/www/html/pickupServer/vendor/voryx/thruway/src/Thruway/ClientSession.php on line 106
2016-04-17T21:08:19+0000 [Controller 9565] Guest worker2 exited with error A process has ended with a probable error condition: process ended with exit code 255.
Does anyone know hot to prevent this?
How do I automatically restart the worker if it fails as in this case?
I solved it in linux with MONIT checking crossbar-controler process and adding the following line:
if children < 3 then restart
3 is the number os child processes that crossbar-controler has on my environment. If any of them exits then crossbar restarts itself and notifies me. You have to check the number of child processes you have running using:
sudo service crossbar status.
This solves the error exit worker but with a cost of restarting the crossbar-controler. I am convinced that must be a crossbar/thruway way of solving the problem.
The ideal way is to try catch all possible errors of php to prevent fatal worker exits.
Thanks

NodeJS errno 37 on socket.connect

I'm trying to connect to multiple hosts in succession, this is the code to resolve the ip address and socket.connect() to each domain name (line[1]). This works on it's own but returns an errno 37 error when run in quick succession with different hosts. The best information I have on the error is:
" code: 'EPROTO', description: 'protocol error' "
Code:
$.connect(port, line[1], function() {
this.write(request);
});
Error:
{ [Error: connect Unknown system errno 37]
code: 'Unknown system errno 37',
errno: 'Unknown system errno 37',
syscall: 'connect' }
How can I resolve this / why is this happening?
Thanks in advance.
EDIT: removed manual dns lookup code and added error report
duplicate with https://stackoverflow.com/questions/14672743/nodejs-crash-when-calling-socket-connect-in-quick-succession
Seems to me opening sockets in rapid succession is asking for trouble.
Try waiting in between opening the sockets and play with the amount of time needed to wait.

Why a mismatch between errno 34 and code ENOENT

So if I run this simple call in node.js v0.6.7 on OS X 10.6.8 with a bogus path, I get an error, as expected.
var fs = require("fs");
fs.stat("/tmp/foo", function(error, stat) {
return console.log(error);
});
It prints this output:
{ [Error: ENOENT, no such file or directory '/tmp/foo'] errno: 34, code: 'ENOENT', path: '/tmp/foo' }
My question is, according to /usr/include/sys/errno.h on my system, ENOENT should have code 2, so why is this error saying errno 34 (ERANGE in errno.h), but pairing it with the error message from ENOENT?
node.js translates system errnos to internal "errnos" (see deps/uv/include/uv.h and uv_translate_sys_error in deps/uv/src/unix/error.c or deps/uv/src/win/error.c for a mapping) as to achieve a common representation for error-conditions under Windows and Unix.
34 is the node.js-errno for ENOENT, so everything is alright.
It seems that node.js changed the errno with 0.12.0. ENOENT is -2now.
So it is probably better to check for code === 'ENOENT'
because you haven't created the folder /tmp/foo yet and it's looking for that folder
(when i added a few error handling lines to my code, the console spat out the same error code and it was because i had not yet created the directory i was telling it to save my images to)

readv from Socket returns ENOENT

What can be the reason for a Linux socket to set the error to ENOENT on readv() ?
The socket in question is non-blocking and runs on Ubuntu 10.04
errno is only set when a system call returns -1. You should only read it after checking the return value of readv.

Resources