error parsing in YAML config file

6,632 views
Skip to first unread message

Raghava Mutharaju

unread,
Jan 14, 2015, 5:59:56 PM1/14/15
to mongod...@googlegroups.com
Hi,

I am using the following YAML config file for MongoDB version 2.8.0-rc4 and I get an error: Error parsing YAML config file: yaml-cpp: error at line 34, column 2: end of map not found

-------------------------------
# Default YAML Configuration file for RPM Packaging
# Replacing legacy mongod.conf format

# Specify where and how to log
# Leave at default verbosity (0)

systemLog:
   destination: file
   path: "/home/ec2-user/mongo-config/log/mongodb.log"
   logAppend: true
#  verbosity: 0

# fork and run in background
# location of pidfile

processManagement:
   fork: true
   pidFilePath: "/home/ec2-user/mongo-config/mongod.pid"

# Listen to local interface only. Comment out to listen on all interfaces. 
# HTTP interface is disabled by default

net:
#   bindIp: 127.0.0.1
   port: 27017
   http:
      enabled: false

storage:
   dbPath: "/home/ec2-user/mongo-config/data"
   engine: "wiredTiger"
   wiredTiger:
        engineConfig: "cache_size=13G"
        collectionConfig: "block_compressor=zlib"

security:
   authorization: disabled
-------------------------------

line 34 is engineConfig. What is the going wrong here?

Regards,
Raghava.

Asya Kamsky

unread,
Jan 16, 2015, 2:42:51 AM1/16/15
to mongodb-user
You have the syntax slightly wrong.  It should be:

   wiredTiger:
        engineConfig:
             configString: "cache_size=13G"
        collectionConfig: 
             block_compressor: "zlib"

Use "key=value" string syntax as argument to "configString:" only, otherwise it's keyName: "value"

Asya


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAHCfvsQR5bD%3DhGvSPvR9cHVd3GCT8hTDYaDBNrOG_fH61cFFpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Raghava Mutharaju

unread,
Jan 16, 2015, 5:53:02 AM1/16/15
to mongod...@googlegroups.com
Thank you. I tried that, but I still get the same error.

storage:
   dbPath: "/home/ec2-user/mongo-config/data"
   engine: "wiredTiger"
   wiredTiger:
        engineConfig:
                configString: "cache_size=13G"
        collectionConfig:
                block_compressor: "zlib"

I got the same error.

Error parsing YAML config file: yaml-cpp: error at line 34, column 2: end of map not found

line 34 is engineConfig

Is there something else that I am missing?

Regards,
Raghava.

Eric Milkie

unread,
Jan 16, 2015, 8:23:00 AM1/16/15
to mongod...@googlegroups.com
Because the error message says column 2, but your config file appears to have more than 2 space characters on that line before the first printable character, I suspect you may have a literal tab on that line.  That would explain why it thinks the line begins at column "2".
For this whitespace-specific format style of YAML, all your lines must use the same whitespace character.

Raghava Mutharaju

unread,
Jan 16, 2015, 12:27:10 PM1/16/15
to mongod...@googlegroups.com
Thank you, that was the issue. I had a tab before engineConfig on the next line, just so that it would be properly indented. I replaced it with white space and it worked. But, now I have a different error.

Unrecognized option: storage.wiredTiger.collectionConfig.block_compressor

What is the correction option to set zlib compression?

Regards,
Raghava.

On Fri, Jan 16, 2015 at 8:23 AM, Eric Milkie <mil...@10gen.com> wrote:
Because the error message says column 2, but your config file appears to have more than 2 space characters on that line before the first printable character, I suspect you may have a literal tab on that line.  That would explain why it thinks the line begins at column "2".
For this whitespace-specific format style of YAML, all your lines must use the same whitespace character.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.

Eric Milkie

unread,
Jan 16, 2015, 12:40:18 PM1/16/15
to mongod...@googlegroups.com

Raghava Mutharaju

unread,
Jan 16, 2015, 7:18:00 PM1/16/15
to mongod...@googlegroups.com
that worked, thank you.

Regards,
Raghava.

On Fri, Jan 16, 2015 at 12:40 PM, Eric Milkie <mil...@10gen.com> wrote:

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
Reply all
Reply to author
Forward
0 new messages