telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 87 forks source link

Problem with running tests related to project #97

Closed marcinbudny closed 9 years ago

marcinbudny commented 9 years ago

I'm having issues with running tests for the IoT agent library. Here's error description from mocha:

1) MongoDB Group Registry test When a new device group creation request arrives should store the service information from the headers into the DB:
 Uncaught TypeError: Cannot read property 'length' of undefined
  at processResults (/home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1581:31)
  at /home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1619:20
  at /home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1157:7
  at b (domain.js:183:18)
  at /home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1890:9
  at b (domain.js:183:18)
  at Server.Base._callHandler (/home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)
  at /home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:481:18
  at MongoReply.parseBody (/home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
  at null.<anonymous> (/home/marcin/iotagent-node-lib/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)

My environment is:

The problem is also occuring on Windows.

What might be the problem?

dmoranj commented 9 years ago

The first thing you should try is to use a lower version of MongoDB. We are working with 2.4 and 2.6 versions, so maybe there is some incompatibility between the version of Mongoose and the one of MongoDB. I'll try to check it myself. By the way, what version of Node.js are you using?

marcinbudny commented 9 years ago

Thank you for quick reply. I'll check the lower mongo version as soon as I have some time and will let you know. I have already updated the issue description with node (0.10.25) and npm (1.3.10) versions.

marcinbudny commented 9 years ago

As I mentioned, I also tried to run the tests on Windows. Node version was 0.12.4

dmoranj commented 9 years ago

The Node version in Ubuntu is the appropriate one. You should stick to 0.10.x for the moment, but that shouldn't be a problem really (some of the IoTAgents we are developing are using 0.12.x; for instance, the Sigfox one). I hope I have some time tomorrow to fix some issues in the agents, and I'll try to reproduce this bug.

marcinbudny commented 9 years ago

Hi Daniel, After downgrading to mongo 2.6.10, the tests pass. Do you plan to support mongo 3 any time soon?

dmoranj commented 9 years ago

Sorry, I missed this message. It's in the roadmap, but I don't think it will be supported in the short term, as we have some more urgent issues. I will close this issue and open a new one, concerning the support of Mongo 3.