open-webrtc-toolkit / owt-server

General server (streaming/conference/transcoding/anayltics) for OWT. (A.k.a. MediaServer)
https://01.org/open-webrtc-toolkit
Apache License 2.0
1.14k stars 375 forks source link

Create token error with "ssl" #384

Open qzn928 opened 4 years ago

qzn928 commented 4 years ago

When I creating a token , return a error: {"error":{"code":2001,"message":"TypeError Cannot read property 'ssl' of undefined"}} at https://owt.com/5dce6b42320c401cb2ef165a/tokens (HTTP status: 500) the nuve log is: 2019-12-03 08:46:31.616 - WARN: Nuve - TypeError: Cannot read property 'ssl' of undefined at /var/www/Release-v4.1/nuve/resource/tokensResource.js:1:984 at Object.callback (/var/www/Release-v4.1/nuve/cloudHandler.js:1:630) at Object.exports.callRpc (/var/www/Release-v4.1/nuve/rpc/rpc.js:1:1186) at t (/var/www/Release-v4.1/nuve/cloudHandler.js:1:401) at Object.exports.schedulePortal (/var/www/Release-v4.1/nuve/cloudHandler.js:1:649) at generateToken (/var/www/Release-v4.1/nuve/resource/tokensResource.js:1:922) at exports.create (/var/www/Release-v4.1/nuve/resource/tokensResource.js:1:1360) at Layer.handle [as handle_request] (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/layer.js:95:5) at next (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/layer.js:95:5) at /var/www/Release-v4.1/nuve/node_modules/express/lib/router/index.js:281:22 at param (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/index.js:354:14) at param (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/index.js:365:14) at Function.process_params (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/index.js:410:3) at next (/var/www/Release-v4.1/nuve/node_modules/express/lib/router/index.js:275:10)

MrSmith87 commented 4 years ago

I am also facing the same issue with v4.3. Any update on this?

starwarfan commented 4 years ago

If this issue can be reproduced, edit "log4js_configuration" file under "cluster_manager" directory, change the "ClusterManager" from "INFO" to "DEBUG", and provide us the log when the problem occurs.

MrSmith87 commented 4 years ago

But I am running the server as a standalone node and not in a cluster. Shall I still check the logs?

starwarfan commented 4 years ago

Check the logs, this can help.

MrSmith87 commented 4 years ago

Here are the logs, though rabbitMq is running fine : 2020-01-09 09:49:53.096 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:49:57.101 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:01.107 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:05.112 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:09.117 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:13.122 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:17.128 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } 2020-01-09 09:50:21.133 - INFO: AmqpClient - Connection to rabbitMQ server error { Error: read ECONNRESET at TCP.onread (net.js:622:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }

I ran : bin/init-rabbitmq.sh output : Rabbitmq-server already running

MrSmith87 commented 4 years ago

I think the problem was due to the fact that during the setup I had changed the users for both rabbitMq and mongodb, and specified my own. Once I re-initialised the server and did the setup again, following the same instructions with default mongo and rabbitMq users, the error was gone.