title: Failed to integrate redis server with express node js app
body: <p>I am new to Node.js and I have been trying to create a small app integrated with KUE library for task queuing.</p>
  
  <p>When I trying to run the app i.e. <code>node app.js</code> I get the following error:</p>
  
  <pre><code>{ ReplyError: ERR wrong number of arguments for 'set' command
      at parseError (.......\node_modules\redis-parser\lib\parser.js:193:12)
      at parseType (........\node_modules\redis-parser\lib\parser.js:303:14)
    command: 'SET',
    args: [ 'promotion:lock', 'H5BCCsomeRandomString==', 'PX', 2000, 'NX' ],
    code: 'ERR' }
  </code></pre>
  
  <p>I did see this error at a lot of places but they all dont seem to be a solution for my problem. </p>
  
  <p>Here is my <code>app.js</code></p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  var session = require('express-session');
  var dotenv = require('dotenv');
  dotenv.load();
  
  var queue = require('./routes/queueJob');
  
  var app = express();
  
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(cookieParser());
  app.use(session({
    secret: 'secret',
    resave: true,
    saveUninitialized: true
  }));
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/jobs', queue);
  
  app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
  });
  
  app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
      message: err.message,
      error: err
    });
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>And here is the routes/queuejob.js</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var kue = require('kue'),
    jobs = kue.createQueue();
  var env = {};
  
  
  jobs.on('ready', () =&gt; {
    console.info('Queue is ready!');
  });
  
  jobs.on('error', (err) =&gt; {
    console.error('There was an error in the main queue!');
    console.error(err);
    console.error(err.stack);
  });
  
  router.get('/addnewjob', function(req, res) {
    let callback = function() {
      console.log('Callback has been triggered');
    }
    newJob('Request Job', callback);
    res.end('Successfully added a new job');
  });
  
  function newJob(name, callback) {
  
    name = name || 'Default_Name';
  
    var job = jobs.create('new job', {
      name: name
    });
  
    job
      .on('complete', function() {
        console.log('Job', job.id, 'with name', job.data.name, 'is done');
        callback();
      })
      .on('failed', function() {
        console.log('Job', job.id, 'with name', job.data.name, 'has failed');
        callback();
      })
  
    job.save();
  }
  
  jobs.process('new job', function(job, done) {
    setTimeout(function() {
      console.log('Job Processing finished');
    }, 5000);
    done();
  });
  
  module.exports = router;
  </code></pre>
  
  <p>Since there isnt much in the error message I am not sure how to fix this issue. I would really appreciate some help on this. </p>