0

I'm developing a website , that should send push notifications to iOS devices. I followed this tutorial to send notifications. On my localhost apnagent works fine, but when I git push it to my Openshift cloud I get the following errors in the terminal:

remote: Waiting for application port (8080) become available ...
remote: Application 'apnagent' failed to start (port 8080 not available)
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 55c3344c89f5cf720xxxxxxx (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55c3344c89f5cf720xxxxxxx/nodejs
remote: #<IO:0x00000000f1c278>
remote: #<IO:0x00000000f1c200>
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://55c3344c89f5cf720xxxxxxx@apnagent-xxxxxxx.rhcloud.com/~/git/apnagent.git/
   bbcf2a3..87exxxx  master -> master

My package.json looks like this:

{
  "private": true,
  "name": "apnagent",
  "version": "0.0.0",
  "dependencies": {
    "apnagent": "1.0.x"
  },
  "engines": {
    "node": ">=0.10.22",
    "npm": ">=1.3.14"
  },
  "scripts": {
    "start": "node agent/_header.js"
  },
  "main": "agent/_header.js"
}

I think i should use somehow process.env.OPENSHIFT_NODEJS_PORT as port on the server, or something like this. I'm sure, I've done some configuration mistake since on my local machine everything works fine.

János
  • 32,867
  • 38
  • 193
  • 353
dnnagy
  • 3,711
  • 4
  • 24
  • 34
  • Do you have any idea, what is wrong in `apnagent` connection? http://stackoverflow.com/questions/40615488/why-apnagent-not-connecting – János Nov 15 '16 at 17:00

1 Answers1

1

Did you check the logs on the server? SSH into your app and use

less app-root/logs/nodejs.log

and press shift+g to view the recent console outputs for the server. I had a few syntax errors in my scripts and they were causing a similar error.

If that doesn't help, could you post your server script?

Jimmy Pruitt
  • 223
  • 1
  • 9