Open lrengunst opened 9 years ago
I bet 8080 is already taken on that machine?
I tried replacing each one process.env.OPENSHIFT_NODEJS_IP but the result is still like I'm wondering.
So it looks like process.env.OPENSHIFT_NODEJS_IP
is null
or undefined
?
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.
the truth I am very interested in jxm but by no vps / server should run on OpenShift free
What is the result of the following code?
console.log('env port', process.env.OPENSHIFT_NODEJS_PORT);
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.
OK, but if you say:
no vps / server should run on OpenShift free
then maybe this is a reason? Are you using OpenShift free ?
I'm testing right on OpenShift free.
So maybe this is the reason for error?
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)
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);
});
code good not debug ! [ujshjrnfsdf90j23fj2ofjwof-freid.rhcloud.com repo]> node server Server listening on: http://127.12.248.1:8080
Maybe today the port 8080 is free? Try jxm today.
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.
a connection port has been closed .
BTW; I've updated it on npm to latest 0.4
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 });