Thomas
Thomas

Reputation: 791

mongodb error parsing yaml config file

I've got a problem with mongodb. After upgrade from 2.6 I had to change config file - here's the new one:

storage:  
    dbPath: "/var/lib/mongodb"  
    engine: wiredTiger  

systemLog:  
    destination: file  
    path: "/var/log/mongodb/mongod.log"  
    logAppend: true  

net:  
    bindIp: 127.0.0.1,192.168.14.81
    port: 27017  
    # Enable the HTTP interface (Defaults to port 28017).  
    http:  
        enabled: false  

But startup script crashes - here's the output:

Error parsing YAML config file: yaml-cpp: error at line 5, column 5: end of map not found
try '/usr/bin/mongod --help' for more information

I'm using only white symbols (spaces - not tabs). Can anyone explain to me what's wrong with that conf?

Upvotes: 2

Views: 15568

Answers (1)

Rohit Luthra
Rohit Luthra

Reputation: 1286

Firstly try to validate your YAML file whether It is valid or not using any tool or online website for eg. http://yaml-online-parser.appspot.com/ and try to resolve the issues because I already faced the same Issue.

In my case problem was in Tab character. I checked it during validation process of YAML file Then I replaced the Tab character with the space character and replaced the single slashes() with double(\) then everything worked fine.

My config file as:

systemLog:
 destination: file
 path: "c:\\data\\log"
storage:
 dbPath: "c:\\data\\db"

Upvotes: 9

Related Questions