Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

linux - OpenShift: "Failed to execute control start" on node application

I realize in advance this is kind of a vague question, but I'm stumped as to what else I can try here...

I've been going through other SO questions and following their recommendations but so far nothing has solved my issue yet.

Here's the specific error I'm getting.

Stopping NodeJS cartridge
Fri Jul 10 2015 10:36:28 GMT-0400 (EDT): Stopping application 'appname' ...
Fri Jul 10 2015 10:36:29 GMT-0400 (EDT): Stopped Node application 'appname'

Starting NodeJS cartridge
Fri Jul 10 2015 10:36:30 GMT-0400 (EDT): Starting application 'appname' ...

Waiting for application port (8080) become available ...

Application 'appname' failed to start (port 8080 not available)

Failed to execute: 'control restart' for /var/lib/openshift/MYID/nodejs

My package.json file is up to date will all my dependencies, has the scripts: { start: 'node server.js' } property and yet I'm still getting this error.

If I SSH in and go to my current/repo directory and run node server.js it works fine. However, I can't just use screen to run it in the background forever.

I've also tried for stopping and restarting, git pushing, and restarting through the browser. I'm stumped as to what else I can try to get my (very simple) node application running on OpenShift.

Any suggestions are much appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...