title: Node: Callback was already called
body: <p>I know that here are few duplicate questions about this. However, I don't know how to solve this problem. My code is this:</p>
  
  <pre><code>/**
   * DEFINE
   * @connection_kill
   */
  apiRoutes.post('/balancer_connection_drop', function(req, res) {
      /* BALANCER - connection kill */
      async.auto({
          decrypt_kill: function(callback, drop, user, stream) {
              /* DROP - decrypt */
              try {
                  /* DEFINE - drop */
                  var drop = JSON.parse(decrypt(Object.keys(req.body)[0], encryption));
  
                  /* DROP - user &amp; stream */
                  callback(null, drop['drop'], drop['user'], drop['stream']);
              } catch(s) {
                  /* CLOSE - connection */
                  res.end();
              }
          },
          remove_connection: ['decrypt_kill', function(results, callback) {
              /* DROP - balancer || user &amp; stream */
              if ((results[Object.keys(results)[0]])[0] !== 'null') {
                  /* DROP - balancer users */
                  if (results[Object.keys(results)[0]][0] == 'balancer') {
                      console.log('callback users...');
                      /* DROP - balancer users */
                      pool.query('UPDATE live SET remove=?',[1], function(err, results) {
                          /* DROP - failed */
                          if (err) return callback('Could NOT Drop Users From Live Table!');
                      })
                  } else {
                      console.log('callback user...');
                      /* DROP - balancer user */
                      pool.query('UPDATE live SET remove=? WHERE user=? AND stream=?',[1, results[Object.keys(results)[0]][1], results[Object.keys(results)[0]][2]], function(err, results) {
                          /* DROP - failed */
                          if (err) return callback('Could NOT Drop Users From Live Table!');
                      })
                  }
              } else {
                  console.log('failed to kill data empty...');
                  return callback('Balancer Connection Kill Data Empty!');
              }
              console.log('callback...');
              callback();
          }]
      }, function(err, results) {
          /* CHECK - error */
          if (err) return res.send(encrypt(JSON.stringify({'status': 'false'}), encryption));
          /* DROP - success */
          res.send(encrypt(JSON.stringify({'status': 'true'}), encryption));
          /* END - connection */
          res.end();
      })
  })
  </code></pre>
  
  <p>Now when I call this api C get this error from node:</p>
  
  <blockquote>
    <p>Callback was already called</p>
  </blockquote>
  
  <p>So I put in code console.log to see what is twice called and I get this from console.log before it throws error that is twice called:</p>
  
  <pre><code>callback user...
  callback...
  </code></pre>
  
  <p>So I see that I made mistake that I call it twice but I don't know how to rewrite above code to work as it should be so when callback user... is called. I need to go to </p>
  
  <pre><code>function(err, results) {
  </code></pre>
  
  <p>function  and in that function return json to my server api, but I don't know how to rewrite it. I try using this code above to move callback outside functions but then callback is never called.</p>