Mockgoose: prepareStorage don't work

Hi, I use

Header:

const Mockgoose = require('mockgoose').Mockgoose;
const mongoose = require('mongoose');

let mockgoose = new Mockgoose(mongoose);

Before:

before((done) => {
  mockgoose.prepareStorage()
    .then(() =>
      mongoose.connect("mongodb://localhost/testdb", done));
});

Ps: I using mocha and supertest for tests

And reporter this error:

Error: Timeout of 24000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

Ps: This error happen in before method from mocha

Can anyone help me? I checked with example from README and for me its equal.

Tks

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 23
  • Comments: 22

Commits related to this issue

Most upvoted comments

Experienced the same issue as OP as well. Managed to get it working by manually specifying a mongodb version. I’m using mongolab with version 3.2.1, so I used 3.2.1 as well for mockgoose now.

Specifying a version is done as follows: mockgoose.helper.setDbVersion('3.2.1');

Hope this helps!

Also having same issues as OP with mockgoose.prepareStorage() never resolving. Using mockgoose@7.3.3 node@6.1.

Haven’t been able to find a workaround yet.

Not working on Ubuntu 18.

I’ve debugged through this today and have some insight as to the nature of the issue.

First and foremost, this issue does not appear to occur on Windows. It appears to be specific to Linux distributions. I imagine that would be why the issues are arising in CI implementations as they would be using a Node image built on a Linux distro.

Secondly, the issue appears to arise because the mongo binary is not emitting a specific message to stdout in the latest build. mongodb-prebuilt (which Mongoose depends upon) appears to be seeking the phrase “waiting for connections on port” as its trigger to resolve the promise upon which prepareStorage depends. Until that message is emitted in stdout, the promise is not resolved (nor is it rejected for that matter). When running prepareStorage without a version parameter, v3.5.9-72-g1faf33b is downloaded. This version is NOT emitting the “waiting for connections on port” message, thus the promise is never resolved.

Interestingly, this version reports itself as a “development version of MongoDB” and is “not recommended for production”. I’m not sure if it is intended to download this version when mongodb-prebuilt initializes without a version, but either way, the nature of the actual issue is that it doesn’t emit this message.

I’ve attached a text log of what version 3.2.14 looks like at startup and what the latest version looks like at startup. You can see that 3.2.14 emits the “waiting for connections on port” message while the latest version does not.

I think there are a variety of different ways this problem could possibly be resolved, so I’ll leave this information in the repo maintainer’s hands to take from here. Please let me know if there are any questions.

mongodb 3-2-14 startup.txt

mongodb latest startup.txt

Just a heads up for those using mockgoose on linux.

I was facing the same timeout issues on my CI server even though tests were passing localy. Turned out libcurl wasn’t installed.

sudo apt-get install libcurl3

This solved my issue.

P.S.: Running with DEBUG=* maybe a lot of output but it’s definitely worth it.

Not working on Windows 10 either.

@sjorssnoeren great, but I continue with a new problem (haha). When I pull the mongodb version 3.2.1, I get an status code 403 (Access Denied) and I think that the promise don’t resolve the reject.

Stdout log from setDbVersion.

unable to get signature content { StatusCodeError: 403 - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>"
    at new StatusCodeError (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:1091:12)
    at IncomingMessage.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  name: 'StatusCodeError',
  statusCode: 403,
  message: '403 - "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>"',
  error: '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>',
  options: 
   { uri: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
     callback: [Function: RP$callback],
     transform: undefined,
     simple: true,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response: 
   IncomingMessage {
     _readableState: 
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [Object],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: true,
        endEmitted: true,
        reading: false,
        sync: false,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: false,
     domain: null,
     _events: 
      { end: [Object],
        close: [Object],
        data: [Function],
        error: [Function] },
     _eventsCount: 4,
     _maxListeners: undefined,
     socket: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     connection: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     httpVersionMajor: 1,
     httpVersionMinor: 1,
     httpVersion: '1.1',
     complete: true,
     headers: 
      { 'content-type': 'application/xml',
        'transfer-encoding': 'chunked',
        connection: 'close',
        date: 'Tue, 20 Jun 2017 14:02:52 GMT',
        server: 'AmazonS3',
        age: '294',
        'x-cache': 'Error from cloudfront',
        via: '1.1 f0b1462eb6409e32cb677a16c59698e8.cloudfront.net (CloudFront)',
        'x-amz-cf-id': 'PrXAftqEDeXDwobdRTl6JWbh3WzKoL-QoBeX3EtH-79nTKqjiNJYpw==' },
     rawHeaders: 
      [ 'Content-Type',
        'application/xml',
        'Transfer-Encoding',
        'chunked',
        'Connection',
        'close',
        'Date',
        'Tue, 20 Jun 2017 14:02:52 GMT',
        'Server',
        'AmazonS3',
        'Age',
        '294',
        'X-Cache',
        'Error from cloudfront',
        'Via',
        '1.1 f0b1462eb6409e32cb677a16c59698e8.cloudfront.net (CloudFront)',
        'X-Amz-Cf-Id',
        'PrXAftqEDeXDwobdRTl6JWbh3WzKoL-QoBeX3EtH-79nTKqjiNJYpw==' ],
     trailers: {},
     rawTrailers: [],
     upgrade: false,
     url: '',
     method: null,
     statusCode: 403,
     statusMessage: 'Forbidden',
     client: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     _consuming: true,
     _dumped: false,
     req: 
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: false,
        sendDate: false,
        _removedHeader: {},
        _contentLength: 0,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'GET /linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5 HTTP/1.1\r\nhost: fastdl.mongodb.org\r\nConnection: close\r\n\r\n',
        _headers: [Object],
        _headerNames: [Object],
        _onPendingData: null,
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'GET',
        path: '/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        _ended: true,
        parser: null,
        res: [Circular] },
     request: 
      Request {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        uri: [Object],
        readable: true,
        writable: true,
        _qs: [Object],
        _auth: [Object],
        _oauth: [Object],
        _multipart: [Object],
        _redirect: [Object],
        _tunnel: [Object],
        _rp_resolve: [Function],
        _rp_reject: [Function],
        _rp_promise: [Object],
        _rp_callbackOrig: undefined,
        callback: [Function],
        _rp_options: [Object],
        headers: {},
        setHeader: [Function],
        hasHeader: [Function],
        getHeader: [Function],
        removeHeader: [Function],
        method: 'GET',
        localAddress: undefined,
        pool: {},
        dests: [],
        __isRequestRequest: true,
        _callback: [Function: RP$callback],
        proxy: null,
        tunnel: true,
        setHost: true,
        originalCookieHeader: undefined,
        _disableCookies: true,
        _jar: undefined,
        port: 443,
        host: 'fastdl.mongodb.org',
        path: '/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        httpModule: [Object],
        agentClass: [Object],
        agent: [Object],
        _started: true,
        href: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        req: [Object],
        ntick: true,
        response: [Circular],
        originalHost: 'fastdl.mongodb.org',
        originalHostHeaderName: 'host',
        responseContent: [Circular],
        _destdata: true,
        _ended: true,
        _callbackCalled: true },
     toJSON: [Function: responseToJSON],
     caseless: Caseless { dict: [Object] },
     read: [Function],
     body: '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>' } }
unable to get signature content { StatusCodeError: 403 - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>"
    at new StatusCodeError (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/guiferpa/Projects/src/stash.b2w/B2CSPACEY/campaign-service/node_modules/request/request.js:1091:12)
    at IncomingMessage.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  name: 'StatusCodeError',
  statusCode: 403,
  message: '403 - "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>"',
  error: '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>',
  options: 
   { uri: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
     callback: [Function: RP$callback],
     transform: undefined,
     simple: true,
     resolveWithFullResponse: false,
     transform2xxOnly: false },
  response: 
   IncomingMessage {
     _readableState: 
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [Object],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: true,
        endEmitted: true,
        reading: false,
        sync: false,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: false,
     domain: null,
     _events: 
      { end: [Object],
        close: [Object],
        data: [Function],
        error: [Function] },
     _eventsCount: 4,
     _maxListeners: undefined,
     socket: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     connection: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     httpVersionMajor: 1,
     httpVersionMinor: 1,
     httpVersion: '1.1',
     complete: true,
     headers: 
      { 'content-type': 'application/xml',
        'transfer-encoding': 'chunked',
        connection: 'close',
        date: 'Tue, 20 Jun 2017 14:02:52 GMT',
        server: 'AmazonS3',
        age: '294',
        'x-cache': 'Error from cloudfront',
        via: '1.1 f0b1462eb6409e32cb677a16c59698e8.cloudfront.net (CloudFront)',
        'x-amz-cf-id': 'PrXAftqEDeXDwobdRTl6JWbh3WzKoL-QoBeX3EtH-79nTKqjiNJYpw==' },
     rawHeaders: 
      [ 'Content-Type',
        'application/xml',
        'Transfer-Encoding',
        'chunked',
        'Connection',
        'close',
        'Date',
        'Tue, 20 Jun 2017 14:02:52 GMT',
        'Server',
        'AmazonS3',
        'Age',
        '294',
        'X-Cache',
        'Error from cloudfront',
        'Via',
        '1.1 f0b1462eb6409e32cb677a16c59698e8.cloudfront.net (CloudFront)',
        'X-Amz-Cf-Id',
        'PrXAftqEDeXDwobdRTl6JWbh3WzKoL-QoBeX3EtH-79nTKqjiNJYpw==' ],
     trailers: {},
     rawTrailers: [],
     upgrade: false,
     url: '',
     method: null,
     statusCode: 403,
     statusMessage: 'Forbidden',
     client: 
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: null,
        npnProtocol: false,
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 9,
        connecting: false,
        _hadError: false,
        _handle: null,
        _parent: null,
        _host: 'fastdl.mongodb.org',
        _readableState: [Object],
        readable: false,
        domain: null,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        destroyed: true,
        _bytesDispatched: 114,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: null,
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Object],
        read: [Function],
        _consuming: true,
        _idleNext: null,
        _idlePrev: null,
        _idleTimeout: -1 },
     _consuming: true,
     _dumped: false,
     req: 
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: false,
        sendDate: false,
        _removedHeader: {},
        _contentLength: 0,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'GET /linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5 HTTP/1.1\r\nhost: fastdl.mongodb.org\r\nConnection: close\r\n\r\n',
        _headers: [Object],
        _headerNames: [Object],
        _onPendingData: null,
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'GET',
        path: '/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        _ended: true,
        parser: null,
        res: [Circular] },
     request: 
      Request {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        uri: [Object],
        readable: true,
        writable: true,
        _qs: [Object],
        _auth: [Object],
        _oauth: [Object],
        _multipart: [Object],
        _redirect: [Object],
        _tunnel: [Object],
        _rp_resolve: [Function],
        _rp_reject: [Function],
        _rp_promise: [Object],
        _rp_callbackOrig: undefined,
        callback: [Function],
        _rp_options: [Object],
        headers: {},
        setHeader: [Function],
        hasHeader: [Function],
        getHeader: [Function],
        removeHeader: [Function],
        method: 'GET',
        localAddress: undefined,
        pool: {},
        dests: [],
        __isRequestRequest: true,
        _callback: [Function: RP$callback],
        proxy: null,
        tunnel: true,
        setHost: true,
        originalCookieHeader: undefined,
        _disableCookies: true,
        _jar: undefined,
        port: 443,
        host: 'fastdl.mongodb.org',
        path: '/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        httpModule: [Object],
        agentClass: [Object],
        agent: [Object],
        _started: true,
        href: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.1.tgz.md5',
        req: [Object],
        ntick: true,
        response: [Circular],
        originalHost: 'fastdl.mongodb.org',
        originalHostHeaderName: 'host',
        responseContent: [Circular],
        _destdata: true,
        _ended: true,
        _callbackCalled: true },
     toJSON: [Function: responseToJSON],
     caseless: Caseless { dict: [Object] },
     read: [Function],
     body: '<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>' } }
(node:2671) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): StatusCodeError: 403 - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>7B1AB6F0C3C67FBB</RequestId><HostId>D3I2GInNmDlIKMdRnHFfTWOVLT563fJbvBmd8Z5aT6FmLWhy2aX8YU6k8OO+ojUHBWE0A0HfErE=</HostId></Error>"

Hi,

Thanks for your hard work on the package - love the ability to test mongoose code easily.

I get the same problem as the OP since recently.

Following test script:

var mongoose = require("mongoose");
var Mockgoose = require("mockgoose").Mockgoose;
var mockgoose = new Mockgoose(mongoose);

console.info("PRETEST: Preparing storage for mockgoose");

const pretest = async () => {
  try {
    await mockgoose.prepareStorage();
    console.info("PRETEST: Finished, exiting process");
  } catch (err) {
    console.log(err);
  }
  process.exit(0);
};

pretest();

Mockgoose counts up to 100% the first time and mongodb is downloaded to ~.mongodb-prebuilt. But the second console.info(...) is just never called.

Output with DEBUG=* is as follows:

Mon, 19 Jun 2017 21:28:20 GMT portfinder:defaultHosts exports._defaultHosts is: [ '0.0.0.0', '127.0.0.1', '::1', '192.168.178.63', 'fe80::59f1:ca6d:4bd3:4d74' ]
Mon, 19 Jun 2017 21:28:20 GMT mongodb-prebuilt-MongoDBPrebuilt getHomeDirectory(): /home/philipp/.mongodb-prebuilt
PRETEST: Preparing storage for mockgoose
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 0.0.0.0
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): failed 0.0.0.0 w/ port 27017 with error EADDRINUSE
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 127.0.0.1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): failed 127.0.0.1 w/ port 27017 with error EADDRINUSE
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is ::1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying ::1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK ::1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 192.168.178.63
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 192.168.178.63 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 192.168.178.63 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is fe80::59f1:ca6d:4bd3:4d74
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying fe80::59f1:ca6d:4bd3:4d74 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): failed fe80::59f1:ca6d:4bd3:4d74 w/ port 27017 with error EINVAL
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with an err: EINVAL
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() result callback: err is { Error: listen EINVAL fe80::59f1:ca6d:4bd3:4d74:27017
    at Object.exports._errnoException (util.js:1016:11)
    at exports._exceptionWithHostPort (util.js:1039:20)
    at Server.setupListenHandle [as _listen2] (net.js:1290:19)
    at listenInCluster (net.js:1355:12)
    at doListen (net.js:1481:7)
    at _combinedTickCallback (internal/process/next_tick.js:105:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
  code: 'EINVAL',
  errno: 'EINVAL',
  syscall: 'listen',
  address: 'fe80::59f1:ca6d:4bd3:4d74',
  port: 27017 }
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 0.0.0.0
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): failed 0.0.0.0 w/ port 27017 with error EADDRINUSE
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 127.0.0.1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): failed 127.0.0.1 w/ port 27017 with error EADDRINUSE
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is ::1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying ::1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK ::1 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 192.168.178.63
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 192.168.178.63 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 192.168.178.63 port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27017
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() result callback: openPorts is [ 27017, 27017, 27018, 27018 ]
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 0.0.0.0
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 0.0.0.0 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 127.0.0.1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 127.0.0.1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is ::1
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying ::1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK ::1 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback: host is 192.168.178.63
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort entered testPort(): trying 192.168.178.63 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:testPort done w/ testPort(): OK 192.168.178.63 port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 27018
Mon, 19 Jun 2017 21:28:20 GMT portfinder:getPort in eachSeries() result callback: openPorts is [ 27018, 27018, 27018, 27018 ]
Mon, 19 Jun 2017 21:28:20 GMT Mockgoose @prepareStorage mongod args, --port,27018,--storageEngine,ephemeralForTest,--dbpath,/tmp/mockgoose/1497907700832
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload createDownloadDir(): /home/philipp/.mongodb-prebuilt/mongodb-download
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload createDownloadDir(): true
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getDownloadURI (url obj returned with href): https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getHttpOptions { protocol: 'https:',
  hostname: 'fastdl.mongodb.org',
  path: '/linux/mongodb-linux-x86_64-ubuntu1604-latest.tgz' }
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getTempDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz.downloading
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload sending file from cache /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz.md5
Mon, 19 Jun 2017 21:28:20 GMT mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload isDownloadPresent() md5 match: true
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload download(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz.md5
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload getExtractLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz.md5
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload getDownloadLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/philipp/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1604-latest.tgz.md5
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload getExtractLocation(): /home/philipp/.mongodb-prebuilt/mongodb-download/99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload sending file from cache /home/philipp/.mongodb-prebuilt/mongodb-download/99525d9e381c89e9b955cb405f702b97
Mon, 19 Jun 2017 21:28:21 GMT mongodb-download-MongoDBDownload isExtractPresent(): true
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongoDBPrebuilt resolveBinPath(): /home/philipp/.mongodb-prebuilt/mongodb-download/99525d9e381c89e9b955cb405f702b97/mongodb-linux-x86_64-ubuntu1604-3.5.8-250-g0d7f9a0/bin
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongoBins getCommand(): /home/philipp/.mongodb-prebuilt/mongodb-download/99525d9e381c89e9b955cb405f702b97/mongodb-linux-x86_64-ubuntu1604-3.5.8-250-g0d7f9a0/bin/mongod
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongoSupervice isWindows(): false
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongoSupervice runOnLinux()
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongoSupervice getSuperviseCommand(): /home/philipp/code/PFM-lab/PFM/server/node_modules/mongodb-prebuilt/built/bin/mongo-supervise.js
Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] MongoDB starting : pid=4795 port=27018 dbpath=/tmp/mockgoose/1497907700832 64-bit host=philipp-XPS-ubuntu
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] db version v3.5.8-250-g0d7f9a0
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] git version: 0d7f9a01b1ae168b8adfc02bb1eb0c1616138d38
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] allocator: tcmalloc
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] modules: none
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] build environment:
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten]     distmod: ubuntu1604
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten]     distarch: x86_64
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten]     target_arch: x86_64
2017-06-19T23:28:21.193+0200 I CONTROL  [initandlisten] options: { net: { port: 27018 }, storage: { dbPath: "/tmp/mockgoose/1497907700832", engine: "ephemeralForTest" } }

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** NOTE: This is a development version (3.5.8-250-g0d7f9a0) of MongoDB.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **       Not recommended for production.

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          addressses it should serve responses from, or with --bind_ip_all to
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 30123 processes, 65536 files. Number of processes should be at least 32768 : 0.5 times number of files.

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] ** NOTE: The ephemeralForTest storage engine is for testing only. 
2017-06-19T23:28:21.197+0200 I CONTROL  [initandlisten] **       Do not use in production.
2017-06-19T23:28:21.198+0200 I CONTROL  [initandlisten] 

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.198+0200 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/tmp/mockgoose/1497907700832/diagnostic.data'

Mon, 19 Jun 2017 21:28:21 GMT mongodb-prebuilt-MongodHelper mongod stdout: 2017-06-19T23:28:21.198+0200 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.6

Using mockgoose@7.3.3, the error happens with both node 7.10.0 and 8.1.3.

Tbh, to me it looks like the package is broken - doesn’t work either in CI or locally and even fails for the exact same builds that have worked before.

I really hope you can fix this issue. Let me know if there’s anything I can do.

Thanks.

I found the error https://github.com/winfinit/mongodb-prebuilt/blob/master/src/mongod-helper.ts#L76 prepareStorage completes if mongodb-prebuilt detects a line matching that regex in mongod’s stdout. newer versions don’t print that line