Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openshift close listen debug #37

Open
lrengunst opened this issue Nov 5, 2015 · 16 comments
Open

Openshift close listen debug #37

lrengunst opened this issue Nov 5, 2015 · 16 comments

Comments

@lrengunst
Copy link

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
Copy link
Member

I bet 8080 is already taken on that machine?

@lrengunst
Copy link
Author

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

@ktrzeciaknubisa
Copy link
Member

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

@lrengunst
Copy link
Author

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
Copy link
Author

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

@ktrzeciaknubisa
Copy link
Member

What is the result of the following code?

console.log('env port', process.env.OPENSHIFT_NODEJS_PORT);

@lrengunst
Copy link
Author

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
Copy link
Member

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
Copy link
Author

I'm testing right on OpenShift free.

@ktrzeciaknubisa
Copy link
Member

So maybe this is the reason for error?

@lrengunst
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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

@ktrzeciaknubisa
Copy link
Member

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

@lrengunst
Copy link
Author

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants