CImrie / mongomem

In-memory MongoDB Server. Ideal for testing.
58 stars 7 forks source link

Server never starts, with no error #3

Closed SebT closed 5 years ago

SebT commented 7 years ago

Hi. I'm trying to use this lib (for ava tests) but I can't get the server working.

The following example hangs and the server never seems to start :

(async function() {
    console.log('start');
    MongoDBServer.debug = true;
    await MongoDBServer.start();
    console.log('started');
})();

This outputs:

start
Fri, 28 Jul 2017 11:15:47 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] MongoDB starting : pid=23655 port=35493 dbpath=/tmp/mongomem-23637qKAvX7uT2BP6 64-bit host=ouistiti
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] db version v3.5.10-191-g6cc2dfe7ed
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] git version: 6cc2dfe7edd312b8596355edef454e15988e350e
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] allocator: tcmalloc
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] modules: none
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] build environment:
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten]     distarch: x86_64
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten]     target_arch: x86_64
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] options: { net: { port: 35493 }, security: { authorization: "disabled" }, storage: { dbPath: "/tmp/mongomem-23637qKAvX7uT2BP6", engine: "ephemeralForTest" } }

Fri, 28 Jul 2017 11:15:47 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] ** NOTE: This is a development version (3.5.10-191-g6cc2dfe7ed) of MongoDB.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **       Not recommended for production.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **          addressses it should serve responses from, or with --bind_ip_all to
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] ** NOTE: The ephemeralForTest storage engine is for testing only. 
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] **       Do not use in production.
2017-07-28T13:15:47.272+0200 I CONTROL  [initandlisten] 
2017-07-28T13:15:47.273+0200 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/tmp/mongomem-23637qKAvX7uT2BP6/diagnostic.data'
2017-07-28T13:15:47.273+0200 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.6          

Yet, /tmp/mongomem-23637qKAvX7uT2BP6/diagnostic.data seems to be correcly created:

$ tree /tmp/mongomem-23637qKAvX7uT2BP6/diagnostic.data/
/tmp/mongomem-23637qKAvX7uT2BP6/diagnostic.data/
└── metrics.2017-07-28T11-15-47Z-00000

I'm using node 8.1.3, npm 5.3.0 and the latests release of mogomem.

Any help ?

nodkz commented 7 years ago

Maybe this helps to you https://github.com/avajs/ava/pull/1420#issuecomment-316919928

SebT commented 7 years ago

My problem isn't even with ava yet. This happens even if I just execute the function of my origin post in the node cli.

The server just hangs and never start.

CImrie commented 5 years ago

Sorry, I haven't been able to keep up with a lot of open source work recently. If you're still having issues, please comment and I'll reopen this issue.