jxcore / jxm

Incredibly fast messaging backend for Node.JS / JXcore
http://jxm.io
Other
226 stars 30 forks source link

Openshift close listen debug #37

Open lrengunst opened 9 years ago

lrengunst commented 9 years ago

I tried my best to open jxm on OpenShift results were unexpected error returns listen AECES

jxm.io v0.3.9 HTTP -> http://127.12.248.1:8080/ events.js: 72         throw er; // Unhandled 'error' event               ^ Error: listen EACCES     at errnoException (net.js: 905: 11)     at Server._listen2 (net.js 1024: 19)     at listen (net.js: 1065: 10)     at Server.listen (net.js: 1139: 5)     at Object.exports.startServer (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server.js:268:16)     at Object.rabbit.OnConnected (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:169:17)     at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_rabbit_api.js:134:21)     at Object.exports.Start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:174:12)     at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jxm.js:327:39)     at Object. (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/server.js:16:8) DEBUG: Program exited with code 8 node server.js DEBUG: Starting child process with 'node server.js'


var server = require('jxm');

server.setApplication("kjnw89dfho2j3bfoweyhf892h", "/", "908j1n23okdnwqe98hf2oi3ubrowehf98wehroi24bfoiqewhf08293hr09243hbre8hfi0owehf420ith20"); var server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';

server.addJSMethod("serverMethod", function (env, params) { server.sendCallBack(env, params + " World!"); });

server.linkResource("/", ["index.html", "text/html" ]); server.on('request', function(req, res){ return true; });

server.start({address:server_ip_address,port:server_port });

ktrzeciaknubisa commented 9 years ago

I bet 8080 is already taken on that machine?

lrengunst commented 9 years ago

I tried replacing each one process.env.OPENSHIFT_NODEJS_IP but the result is still like I'm wondering.

ktrzeciaknubisa commented 9 years ago

So it looks like process.env.OPENSHIFT_NODEJS_IP is null or undefined ?

lrengunst commented 9 years ago

I have tried many ways to find the cause, but there is no way but it runs on OpenShift What I do not understand why! also a code which I tried on c9.io it works very well.

lrengunst commented 9 years ago

the truth I am very interested in jxm but by no vps / server should run on OpenShift free

ktrzeciaknubisa commented 9 years ago

What is the result of the following code?

console.log('env port', process.env.OPENSHIFT_NODEJS_PORT);
lrengunst commented 9 years ago

env port 8080 jxm.io v0.3.9 HTTP -> http://127.12.248.1:3008/ events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EACCES at errnoException (net.js:905:11) at Server._listen2 (net.js:1024:19) at listen (net.js:1065:10) at Server.listen (net.js:1139:5) at Object.exports.startServer (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server.js:268:16) at Object.rabbit.OnConnected (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:169:17) at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_rabbit_api.js:134:21) at Object.exports.Start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:174:12) at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jxm.js:327:39) at Object. (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/server.js:16:8) DEBUG: Program node server.js exited with code 8 DEBUG: Starting child process with 'node server.js'

ktrzeciaknubisa commented 9 years ago

OK, but if you say:

no vps / server should run on OpenShift free

then maybe this is a reason? Are you using OpenShift free ?

lrengunst commented 9 years ago

I'm testing right on OpenShift free.

ktrzeciaknubisa commented 9 years ago

So maybe this is the reason for error?

lrengunst commented 9 years ago

I'm thinking maybe jxm code system problems when running on the host Openshift? one listen was closed after the show: jxm.io v0.3.9 HTTP -> http://127.12.248.1:8080/123


jx_server.js: 268: 16) jx_server_events.js: 169: 17) jx_rabbit_api.js: 134: 21) jx_server_events.js: 174: 12) jxm.js: 327: 39)

ktrzeciaknubisa commented 9 years ago

You can do a simple test without jxm:

var http = require('http');
var server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
var server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';

var server = http.createServer(function (request, response){
  response.end('Request received ' + request.url);
});

server.listen(server_port, server_ip_address, function(){
  console.log("Server listening on: http://%s:%s", server_ip_address, server_port);
});

server.on('error', function(e) {
  console.log(e);
});
lrengunst commented 9 years ago

code good not debug ! [ujshjrnfsdf90j23fj2ofjwof-freid.rhcloud.com repo]> node server Server listening on: http://127.12.248.1:8080

ktrzeciaknubisa commented 9 years ago

Maybe today the port 8080 is free? Try jxm today.

lrengunst commented 9 years ago

jxm.io v0.3.9 HTTP -> http://127.12.248.1:8080/123

events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EACCES at errnoException (net.js:905:11) at Server._listen2 (net.js:1024:19) at listen (net.js:1065:10) at Server.listen (net.js:1139:5) at Object.exports.startServer (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server.js:268:16) at Object.rabbit.OnConnected (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:169:17) at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_rabbit_api.js:134:21) at Object.exports.Start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:174:12) at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jxm.js:327:39) at Object. (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/server.js:16:8)

a connection port has been closed .

obastemur commented 9 years ago

BTW; I've updated it on npm to latest 0.4