Search code examples
node.jsmongodbopenhab

Error while connecting from openHAB-cloud to mongodb: MongoError: Authentication failed


my mongodb auth is false but it getting error my mongodb.conf file have no authenication

# Turn on/off security.  Off is currently the default


#noauth = true
#auth = true

my mongodb user conf file

 "mongodb": {
    "hosts": ["127.0.0.1"],
    "db": "openhab",
    "user": "",
    "password": ""
}

enter image description here


Solution

  • An empty string is still parsed as a value so for you to login without auth you need to omit the user and password fields. So the correct solution is this:

    "mongodb": {
        "hosts": ["127.0.0.1"],
        "db": "openhab"
    }