最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Unable to deploy Node app to Openshift - Stack Overflow

programmeradmin7浏览0评论

I'm trying to deploy a simple ExpressJS app I have to Openshift using the mand line tools. I've provided a debug trace below:

>npm info ok 
Preparing build for deployment
Deployment id is 5e2abc99
Activating deployment
HAProxy already running
HAProxy instance is started
Starting NodeJS cartridge
Sat Aug 15 2015 15:17:47 GMT-0400 (EDT): Starting application 'xxxxx' ...
Waiting for application port (8080) bee available ...
Application 'xxxxx' failed to start (port 8080 not available)

and

Git Post-Receive Result: failure
Activation status: failure
Activation failed for the following gears:
55cf8fc589f5cf9dbf00023c (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55cf8fc589f5cf9dbf00023c/nodejs
#<IO:0x00000001ec7290>
#<IO:0x00000001ec7218>
>)
Deployment pleted with status: failure
postreceive failed

However my app is listening on port 8080:

app.listen(process.env.OPENSHIFT_NODEJS_PORT || 8080);

Can anyone help?

Deploying an empty application doesn't seem to throw any errors.

I'm trying to deploy a simple ExpressJS app I have to Openshift using the mand line tools. I've provided a debug trace below:

>npm info ok 
Preparing build for deployment
Deployment id is 5e2abc99
Activating deployment
HAProxy already running
HAProxy instance is started
Starting NodeJS cartridge
Sat Aug 15 2015 15:17:47 GMT-0400 (EDT): Starting application 'xxxxx' ...
Waiting for application port (8080) bee available ...
Application 'xxxxx' failed to start (port 8080 not available)

and

Git Post-Receive Result: failure
Activation status: failure
Activation failed for the following gears:
55cf8fc589f5cf9dbf00023c (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55cf8fc589f5cf9dbf00023c/nodejs
#<IO:0x00000001ec7290>
#<IO:0x00000001ec7218>
>)
Deployment pleted with status: failure
postreceive failed

However my app is listening on port 8080:

app.listen(process.env.OPENSHIFT_NODEJS_PORT || 8080);

Can anyone help?

Deploying an empty application doesn't seem to throw any errors.

Share Improve this question edited Jun 2, 2016 at 12:00 zabumba 12.4k18 gold badges75 silver badges134 bronze badges asked Aug 15, 2015 at 19:25 sparrowmansparrowman 811 silver badge4 bronze badges 1
  • did you fix the issue? I'm having the same problem – Jonas D. Commented Jun 2, 2016 at 0:44
Add a ment  | 

2 Answers 2

Reset to default 9

Have you checked the log on the server? I was encountering a similar issue and it was because I had syntax errors in my script. If you SSH into your application and

tail app-root/logs/nodejs.log

you can see the console output for the app. Use -n [# of lines] to view more of the log if 10 isn't enough or use less and press shift + g to view the document starting at the bottom if you want to scroll up and down through it all.

Try to login via ssh to your openshift node. I use the rhc tool. Run your code and you will see where the problem is.

发布评论

评论列表(0)

  1. 暂无评论