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

98
February 17, 2021, at 11:40 AM

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?

READ ALSO
ping: cannot resolve db1: Unknown host

ping: cannot resolve db1: Unknown host

I'm using macOS version : Catalina (1015

113
Insert a date to MySQL with php is always 0000-00-00

Insert a date to MySQL with php is always 0000-00-00

I'm trying to insert date_start and date_end fields into MySQL 80

75
How to display the date field in input box after submitting the form in javascript?

How to display the date field in input box after submitting the form in javascript?

I need to display the user-selected date in the input box on the same page once the form gets submittedI was referring this link and if I try to implement the same in my code, my form is not getting submitted and am not able to see the desired output

85