Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8761417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:16:49+00:00 2026-06-13T15:16:49+00:00

I’ve read answers in this question and tried many ways to resolve my issue

  • 0

I’ve read answers in this question and tried many ways to resolve my issue but could not – hence posting this query from my side.

Basically I have a list of services in an array – which comes to ~ 1500 in numbers running on a different box other that where my NodeJS application is running. As per my code I ssh to the/a box and via expect script, then cd to a specific directory to get each service version / build id which is stored in a specific file at specific individual path for each service. There are chances that for some of the services the same file (having version / build information) may be stored at a different location in the box. So I have algo in app that in case attempt to get the details fails for the first path I will use other script to look for information at different path:

Main Block of code:

exports.getservicedetails = function(box,res) {
        var job = [];
        for (i = 0; i < services.length; i++ )
        {
                var children = new Object();
                children.server = services[i];
                children.box = box;
                children.process = spawn('./scripts/info.sh', [children.server , children.box , getStageURL(children.box)]);
                children.runstate = 1;
                job.push(children);
                createChildEvents(job, i, res);
        }
}

Now I set all events for each spawned tasks:

function createChildEvents(child, id, res){
        (child[id]).process.stderr.on('data', function (data) {
                (child[id]).runstate = 0;
        });
        (child[i]).process.on('exit', function (code) {
                (child[id]).runstate = 0;
                checkstate(child, res); // function to check if all spawned tasks has exited
        });
        (child[id]).process.stdout.on('data', function (data) {
                var result = data.toString().split("\r\n"); // split the stdout outputted lines
                for (var i = 0; i < result.length; i++)
                {
                       console.log('Server : ' +  (child[id]).server + " PID : " + (child[id]).process.pid + ' ' + (child[id]).box);
                        if ((child[id]).box.length > 0 && result[i].match(/No such file or directory/gi) != null) {
                                (child[id]).process = spawn('./scripts/info2.sh ',[(child[id]).server, (child[id]).box, getStageURL((child[id]).box)]);
                                (child[id]).box = '';
                                (child[id]).runstate = 1;
                                createChildEvents(child, id, res);
                                break;
                        }
                        if(result[i].match(/release_version*/) != null || result[i].match(/app.version*/) != null)
                                (child[id]).serversion = (result[i].split('='))[1];
                        if(result[i].match(/release_number*/) != null || result[i].match(/app.id*/) != null)
                                (child[id]).serproduct = (result[i].split('='))[1];
                }
        });
}

The issue is that after getting 11th console logs as mentioned below I see error:

Server : a PID : 27200 myboxname
Server : b PID : 31650 myboxname
Server : d PID : 31644 myboxname
Server : e PID : 31664 myboxname
Server : f PID : 28946 myboxname
Server : g PID : 32507 myboxname
Server : h PID : 29329 myboxname
Server : i PID : 29905 myboxname
Server : j PID : 29883 myboxname
Server : k PID : 481 myboxname
Server : l PID : 777 myboxname
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:168:15)
    at EventEmitter.once (events.js:189:8)
    at Transport.logException (src/node_modules/winston/lib/winston/transports/transport.js:118:8)
    at logAndWait (src/node_modules/winston/lib/winston/logger.js:613:15)
    at async.forEach (src/node_modules/winston/node_modules/async/lib/async.js:86:13)
    at Array.forEach (native)
    at _forEach (src/node_modules/winston/node_modules/async/lib/async.js:26:24)
    at Object.async.forEach (src/node_modules/winston/node_modules/async/lib/async.js:85:9)
    at Logger._uncaughtException (src/node_modules/winston/lib/winston/logger.js:636:9)
    at process.EventEmitter.emit (events.js:115:20)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:168:15)
    at EventEmitter.once (events.js:189:8)
    at Transport.logException (src/node_modules/winston/lib/winston/transports/transport.js:117:8)
    at logAndWait (src/node_modules/winston/lib/winston/logger.js:613:15)
    at async.forEach (src/node_modules/winston/node_modules/async/lib/async.js:86:13)
    at Array.forEach (native)
    at _forEach (src/node_modules/winston/node_modules/async/lib/async.js:26:24)
    at Object.async.forEach (src/node_modules/winston/node_modules/async/lib/async.js:85:9)
    at Logger._uncaughtException (src/node_modules/winston/lib/winston/logger.js:636:9)
    at process.EventEmitter.emit (events.js:115:20)

I tried adding ‘process.setMaxListeners(0);’ at many points in my code but still I keep seeing this error?

Any idea how can I solve this issue? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:16:50+00:00Added an answer on June 13, 2026 at 3:16 pm

    You have a typo. child[i] instead of child[id]

    You are thus setting a listener for the same emitter in each createChildEvents call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I want to count how many characters a certain string has in PHP, but
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.