Openshift: "Failed to Execute Control Start" on Node Application

OpenShift: Failed to execute control start on node application

For an OpenShift Node app you need to specify the start script as: main: "server.js" instead of using scripts. This is due to the way Node applications are started on OpenShift using node-supervisor.

nodejs/postgresql on openshift: Failed to execute: 'control restart'

Problem resolved by Openshift already :) @developercorey

Openshift node app error when restarting

If you're creating a new Node project, start with npm init to create the package.json file. You can add the --auto option to give it safe defaults.

Remember, the JSON file must be valid JSON, so test it with jsonlint or a tool like an online validator.

Any dependencies your project has should be spelled out in the package file. This is done automatically with things like npm install express --save.

Node Js Application host in openshift

Can you show me your code how you are setting ip and port for listening.

Please use below code if you are using express framework:

var ipaddress = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
var port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
app.listen(port, ipaddress, function() {
// Do your stuff
});

You need to use IP and Port, defined by OpenShift and Specified in its Enviorment Variable.

process.env.OPENSHIFT_NODEJS_IP

process.env.OPENSHIFT_NODEJS_PORT

https://developers.openshift.com/en/node-js-environment-variables.html



Related Topics



Leave a reply



Submit