Error: "Double colon in host identifer"

sleepy_daze picture sleepy_daze · Mar 24, 2016 · Viewed 10.5k times · Source

I am trying to connect to a database that I have hosted at MLab. I am using the StrongLoop API. I've placed the config information for my hosted databases into my datasources.json and config.json files, but whenever I run the directory with npm start, I get throw new Error ('double colon in host identifier';) at api\node_modules\mongodb\lib\url_parser.js:45.

I have also made sure to install the loopback-connecter-mongodb npm package.

Here is a snippet of datasources.json (without the actual database details, of course):

Here is the config.json file:

{
  "restApiRoot": "/api",
  "host": "ds047355.mlab.com",
  "port": 47355,
  "remoting": {
    "context": {
      "enableHttpContext": false
    },
    "rest": {
      "normalizeHttpPath": false,
      "xml": false
    },
    "json": {
      "strict": false,
      "limit": "100kb"
    },
    "urlencoded": {
      "extended": true,
      "limit": "100kb"
    },
    "cors": false,
    "errorHandler": {
      "disableStackTrace": false
    }
  },
  "legacyExplorer": false
}

Got any ideas?

Answer

objectively C picture objectively C · Jun 15, 2016

I finally solved my problem resulting in this error. It was reading one of my server URLs as http://0.0.0.0/:8080 but was fixed when I changed to http://0.0.0.0:8080

Hope this helps you or someone else.