CloudHandler does not respond
Hi!
I'm trying to setup licode on AWS, but this error shows up:
2015-09-23 01:55:20.064 - INFO: RPC - Conected to rabbitMQ server 2015-09-23 01:55:20.070 - INFO: RPC - Exchange rpcExchange is open 2015-09-23 01:55:20.075 - INFO: RPC - Queue nuveQueue is open 2015-09-23 01:55:20.085 - INFO: RPC - ClientQueue amq.gen-gN4uGx21qvY_2nLBem64TQ is open [licode] Done, run basic_example/basicServer.js root@cloudr-server:/var/www/licode/scripts# Running process 2015-09-23 01:55:24.876 - INFO: ErizoAgent - Launched new ErizoJS 84b63aa4-7fee-873d-9741-49e6de3069b9 2015-09-23 01:55:24.988 - INFO: AMQPER - Exchange rpcExchange is open 2015-09-23 01:55:24.991 - INFO: AMQPER - Exchange broadcastExchange is open 2015-09-23 01:55:25.000 - INFO: AMQPER - ClientQueue amq.gen-wQwwasSCEeJKouS8za_89x is open 2015-09-23 01:55:25.022 - INFO: AMQPER - Queue ErizoAgent is open 2015-09-23 01:55:25.027 - INFO: AMQPER - Queue ErizoAgent_fb49da5c-def2-6222-1e23-acdd64ffe227 is open 2015-09-23 01:55:25.029 - INFO: AMQPER - Queue amq.gen-gekjHkix1Xh-u6oq2qt_Ue is open 2015-09-23 01:55:25.172 - INFO: AMQPER - Exchange rpcExchange is open 2015-09-23 01:55:25.176 - INFO: AMQPER - Exchange broadcastExchange is open 2015-09-23 01:55:25.179 - INFO: AMQPER - ClientQueue amq.gen-AvwsGWKoWqFBOp2QhWeWv0 is open 2015-09-23 01:55:25.266 - INFO: CloudHandler - private ip ###.###.###.###
/var/www/licode/node_modules/aws-lib/node_modules/xml2js/lib/xml2js.js:216
throw ex;
^
TypeError: Cannot read property 'instancesSet' of undefined
at /var/www/licode/nuve/nuveAPI/cloudHandler.js:123:52
at /var/www/licode/node_modules/aws-lib/lib/aws.js:62:14
at Parser.
I've tried public ip, private ip, elastic ip and no ip at all. Getting the same error.
Looking into the aws cli, i've executed the same command as the cloudHandler.js does: aws ec2 describe-instances --filter "Name=private-ip-address, Values=###.###.###.###" and it works great.
I've noticed that the response in cloudHandler.js looks like this: { '@': { xmlns: 'http://ec2.amazonaws.com/doc/2012-12-01/' }, requestId: 'd0726e18-7ce0-467d-9030-34b06ce33809', reservationSet: {} }
Thanks in advance!
@gocloudr: I'm responding pretty late. I hope it helps someone.
The line where it crashes is:
publicIP = response.reservationSet.item.instancesSet.item.ipAddress;
What this line is doing is that its trying to retrieve the public ip address of your ec2 instance. The issue is that (most probably) machine on ec2 is not a reserved instance. Yet the instances list that you extracted from AWS is of the reserved instances. So obviously you won't get an instance in return.
The work around is that you simply put your public id address directly in to the publicIP variable, like this
publicIP = '52.23.xxx.xxx';
Though this is not a solution by any means, yet this would get your code running and you can avoid the crash as well.