Use CosmoDB as Mongo replacement

Technical Support
  • Hi I am trying to do a fresh install on CosmoDB azure's mongo compatible database. Link To Example
    And I am getting a error below. I have gotten it to successfully to right through to the datastore at one point so i know it can work but after it then fails on the read. Has anyone successfully gotten his to work?

    Error: listen EADDRINUSE :::36887
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Agent.Server._listen2 (net.js:1258:14)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at _combinedTickCallback (internal/process/next_tick.js:83:11)

  • What is your config.json? The EADDRINUSE exception usually occurs because you're trying to run nodebb while another instance is already running. Have you tried killing other node processes?

  • @pitaj

    I restarted and now when I
    from the command line installer "./nodebb install" I get this error

    26/10 12:20:12 [41716] - warn: NodeBB Setup Aborted.
    MongoError: Syntax error, incorrect syntax near '12'.
    at Function.MongoError.create (C:\dev\source\nodebb\10-26\NodeBB\node_modules\mongodb-core\lib\error.js:31:11)
    at queryCallback (C:\dev\source\nodebb\10-26\NodeBB\node_modules\mongodb-core\lib\cursor.js:197:34)
    at C:\dev\source\nodebb\10-26\NodeBB\node_modules\mongodb-core\lib\connection\pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

    this is the function throwing the error


    • Creates a new MongoError object
    • @method
    • @param {object} options The error options
    • @return {MongoError} A MongoError instance
      MongoError.create = function(options) {
      var err = null;

    if(options instanceof Error) {
    err = new MongoError(options.message);
    err.stack = options.stack;
    } else if(typeof options == 'string') {
    err = new MongoError(options);
    } else {
    err = new MongoError(options.message || options.errmsg || options.$err || "n/a");
    // Other options
    for(var name in options) {
    err[name] = options[name];

    return err;

    this is the mongo connection string.. Its currently live if you want to give it a try..
    its on a free trial account that ill delete shortly.

    as you can see by the data explorer it installed on the instance at one point.
    ![0_1509077576474_0af16d55-b37f-439d-94c4-3b551589396c-image.png](Uploading 100%)

  • What's node -v?

    Also, ./nodebb setup is the command line installer.

  • @PitaJ

    node = 6.11.2
    npm = 5.5.1

Suggested Topics

  • 0 Votes
    6 Posts

    I finally figured it out... you need to put the path to the socket replacing the slashes with %2F.

    For example:

    "mongo": { "uri": "mongodb://username:password@%2Fvar%2Frun%2Fmongodb%2Fmongodb-27017.sock/dbname" }

    Thank you for your help. Hope this post helps anybody who is facing the same issue.

  • Using NodeBB with MySQL

    Technical Support
    0 Votes
    3 Posts

    By default, it's no possible to use mysql directly. But if you really want it, some efforts could be take to migrate the db from existing dbs to mysql database.

    So, in short, it's possible to use mysql only if you can successfuly migrate all schemas and existing database operations in the code from mongodb/redis/postgresql(any of these) into mysql.

  • 0 Votes
    1 Posts

    I see that its possible to convert from BBpress to Nodebb, But I want to take my attachments from GD bbPress Attachments and my likes from all posts from WP ULike with me, I know this is a very far-fetched request, but someone may have done this before, is there anything out there to perform this conversion?

  • 0 Votes
    7 Posts

    Sorry, I write the correct command (I copy and paste like instructions), but it doesn´t works.

  • 0 Votes
    11 Posts

    @qgp9 I can't say exactly how I installed Mongo. When I google, "ubuntu install mongo", my web browser tells me that this page

    has been visited and it looks familiar. I think it's what I used to guide me.

    And, no, I did not compile. And no, I am not using docker.

    A detail, since you seem to be interested, is that the install does not leave my system with a functioning "service mongod restart" command. At present, Upstart runs Mongo. "stop mongod" does not work.