What is causing this ENOTCONN error from Node's exec on a non-socket connection?

Viewed 625

I'm getting this error:

0|test backup  | Error: read ENOTCONN
0|test backup  |     at tryReadStart (net.js:574:20)
0|test backup  |     at Socket._read (net.js:585:5)
0|test backup  |     at Socket.Readable.read (_stream_readable.js:469:10)
0|test backup  |     at Socket.read (net.js:625:39)
0|test backup  |     at new Socket (net.js:377:12)
0|test backup  |     at Object.Socket (net.js:268:41)
0|test backup  |     at createSocket (internal/child_process.js:315:14)
0|test backup  |     at ChildProcess.spawn (internal/child_process.js:438:23)
0|test backup  |     at spawn (child_process.js:553:9)
0|test backup  |     at Object.execFile (child_process.js:237:17)
0|test backup  |     at exec (child_process.js:158:25)
0|test backup  |     at /home/testuser/projects/test-web-app/testBackup.js:141:5
0|test backup  |     at new Promise (<anonymous>)
0|test backup  |     at addToStorj (/home/testuser/projects/test-web-app/testBackup.js:140:27) {
0|test backup  |   errno: 'ENOTCONN',
0|test backup  |   code: 'ENOTCONN',
0|test backup  |   syscall: 'read'
0|test backup  | }

Where /home/testuser/projects/test-web-app/testBackup.js:141:5 is this:

const uploaded = await new Promise((resolve, reject) => {
    exec(`cd ${storjConfig.connectorPath} && runScript`, {
        timeout: 60000 //60 secs
    }, (error, stdout, stderr) => {
        if (error) {
            reject('exec error:' + error.message);
            return;
        }
        if (stderr) {
            reject('exec stderr:' + stderr);
            return;
        }
        console.log(`---added ${CID}---`);
        resolve(true);
    });
}).catch(console.error);

If I were to run the runScript script by itself, I get no errors. So I don't think it's the script that is throwing an error. So what is this error from? I don't make any socket connections. Can anyone shed some light on where this error is coming from and why?

0 Answers
Related