{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1078","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1078/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1078/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1078/events","html_url":"https://github.com/ParsePlatform/parse-server/issues/1078","id":141621812,"number":1078,"title":"Kue crashes parse server","user":{"login":"AmbroiseCollon","id":2622390,"avatar_url":"https://avatars.githubusercontent.com/u/2622390?v=3","gravatar_id":"","url":"https://api.github.com/users/AmbroiseCollon","html_url":"https://github.com/AmbroiseCollon","followers_url":"https://api.github.com/users/AmbroiseCollon/followers","following_url":"https://api.github.com/users/AmbroiseCollon/following{/other_user}","gists_url":"https://api.github.com/users/AmbroiseCollon/gists{/gist_id}","starred_url":"https://api.github.com/users/AmbroiseCollon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmbroiseCollon/subscriptions","organizations_url":"https://api.github.com/users/AmbroiseCollon/orgs","repos_url":"https://api.github.com/users/AmbroiseCollon/repos","events_url":"https://api.github.com/users/AmbroiseCollon/events{/privacy}","received_events_url":"https://api.github.com/users/AmbroiseCollon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-17T15:44:03Z","updated_at":"2016-03-17T22:40:30Z","closed_at":"2016-03-17T22:40:30Z","body":"#### Environment Setup\r\nexpress@4.2.0\r\nkerberos@0.0.19\r\nkue@0.10.5\r\nparse@1.6.14\r\nparse-server@2.1.6\r\nredis@2.5.2\r\nHeroku + MongoLab\r\n\r\n#### Steps to reproduce\r\nI'm trying to use kue for scheduled jobs on my Parse Server. For now I've modified my index.js file like so as stated in the several tutorials I found about Kue : \r\n\r\n```\r\nvar express = require('express')\r\n  , kue = require('due')\r\n  , redis = require('redis');\r\n\r\nvar ParseServer = require('parse-server').ParseServer;\r\n\r\nvar databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;\r\n\r\nif (!databaseUri) {\r\n  console.log('DATABASE_URI not specified, falling back to localhost.');\r\n}\r\n\r\nvar api = new ParseServer({\r\n  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',\r\n  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',\r\n  appId: process.env.APP_ID || 'myAppId',\r\n  masterKey: process.env.MASTER_KEY || '',\r\n  serverURL: process.env.SERVER_URL\r\n});\r\n// Client-keys like the javascript key or the .NET key are not necessary with parse-server\r\n// If you wish you require them, you can set them as options in the initialization above:\r\n// javascriptKey, restAPIKey, dotNetKey, clientKey\r\n\r\n// connect to REDIS\r\nvar client = redis.createClient(process.env.REDIS_URL);\r\n\r\nvar app = express();\r\n\r\n// Serve the Parse API on the /parse URL prefix\r\nvar mountPath = process.env.PARSE_MOUNT || '/parse';\r\napp.use(mountPath, api)\r\n.use(kue.app); // wire up Kue (see /active for queue interface)\r\n\r\n\r\n// Parse Server plays nicely with the rest of your web routes\r\napp.get('/', function(req, res) {\r\n  res.status(200).send('I dream of being a web site.');\r\n});\r\n\r\nvar port = process.env.PORT || 1337;\r\napp.listen(port, function() {\r\n    console.log('parse-server-example running on port ' + port + '.');\r\n});\r\n```\r\nI've found out that the app crashes at the line : `.use(kue.app)`. Here is the error I get : \r\n```\r\nStarting process with command `node index.js`\r\nparse-server-example running on port 22995.\r\n/app/node_modules/parse-server/lib/index.js:298\r\n        throw err;\r\n        ^\r\n\r\nError: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379\r\n    at Object.exports._errnoException (util.js:890:11)\r\n    at exports._exceptionWithHostPort (util.js:913:20)\r\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)\r\nProcess exited with status 7\r\nState changed from starting to crashed\r\n```\r\nI don't know why this is happening. And I need help on that as I'm not a Node/Express/Redis/Kue/Heroku ninja at all. :)\r\n\r\n#### Why bother ?\r\nI'm setting up a tutorial for anyone trying to get Kue up and running for Parse Server on Heroku. This could be useful according to #153. So any help could help me finish this for the community !\r\n"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments/198111745","html_url":"https://github.com/ParsePlatform/parse-server/issues/1078#issuecomment-198111745","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1078","id":198111745,"user":{"login":"gfosco","id":406732,"avatar_url":"https://avatars.githubusercontent.com/u/406732?v=3","gravatar_id":"","url":"https://api.github.com/users/gfosco","html_url":"https://github.com/gfosco","followers_url":"https://api.github.com/users/gfosco/followers","following_url":"https://api.github.com/users/gfosco/following{/other_user}","gists_url":"https://api.github.com/users/gfosco/gists{/gist_id}","starred_url":"https://api.github.com/users/gfosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfosco/subscriptions","organizations_url":"https://api.github.com/users/gfosco/orgs","repos_url":"https://api.github.com/users/gfosco/repos","events_url":"https://api.github.com/users/gfosco/events{/privacy}","received_events_url":"https://api.github.com/users/gfosco/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T22:40:30Z","updated_at":"2016-03-17T22:40:30Z","body":"Yeah this seems to be a pretty straightforward error, your Kue instance cannot connect to Redis."}}