Skip to content

Kue crashes parse server #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AmbroiseCollon opened this issue Mar 17, 2016 · 7 comments
Closed

Kue crashes parse server #1078

AmbroiseCollon opened this issue Mar 17, 2016 · 7 comments

Comments

@AmbroiseCollon
Copy link

Environment Setup

express@4.2.0
kerberos@0.0.19
kue@0.10.5
parse@1.6.14
parse-server@2.1.6
redis@2.5.2
Heroku + MongoLab

Steps to reproduce

I'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 :

var express = require('express')
  , kue = require('due')
  , redis = require('redis');

var ParseServer = require('parse-server').ParseServer;

var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;

if (!databaseUri) {
  console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '',
  serverURL: process.env.SERVER_URL
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

// connect to REDIS
var client = redis.createClient(process.env.REDIS_URL);

var app = express();

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api)
.use(kue.app); // wire up Kue (see /active for queue interface)


// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
  res.status(200).send('I dream of being a web site.');
});

var port = process.env.PORT || 1337;
app.listen(port, function() {
    console.log('parse-server-example running on port ' + port + '.');
});

I've found out that the app crashes at the line : .use(kue.app). Here is the error I get :

Starting process with command `node index.js`
parse-server-example running on port 22995.
/app/node_modules/parse-server/lib/index.js:298
        throw err;
        ^

Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at Object.exports._errnoException (util.js:890:11)
    at exports._exceptionWithHostPort (util.js:913:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)
Process exited with status 7
State changed from starting to crashed

I 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. :)

Why bother ?

I'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 !

@davimacedo
Copy link
Member

It seems that kue is not able to connect to Redis. Is it Redis installed in your server and the connection (127.0.0.1:6379) valid?

@gfosco
Copy link
Contributor

gfosco commented Mar 17, 2016

Yeah this seems to be a pretty straightforward error, your Kue instance cannot connect to Redis.

@gfosco gfosco closed this as completed Mar 17, 2016
@AmbroiseCollon
Copy link
Author

I found out my mistake here. Thank you for your help.

@rendragon83
Copy link

Does anyone know of a working tutorial for this. I am having a few problems getting this up and running on my end

@christianpbrink
Copy link

@AmbroiseCollon Did you ever publish the tutorial on using Kue with Parse Server?

@AmbroiseCollon
Copy link
Author

@rendragon83 @christianpbrink didn't have time to finish it. But I've detailed a bit my code in #1628. Hope you'll find this helpful.

@christianpbrink
Copy link

Thanks!

On Mon, Aug 1, 2016 at 4:31 AM, Ambroise Collon notifications@github.com
wrote:

@rendragon83 https://github.com/rendragon83 @christianpbrink
https://github.com/christianpbrink didn't have time to finish it. But
I've detailed a bit my code in #1628
#1628. Hope you'll
find this helpful.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1078 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAbap4nmgFHaWRFV45UPwtZo4ufiprBtks5qba7bgaJpZM4HzELp
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants