sous-chefs / sc-mongodb

Development repository for the sc-mongodb cookbook
https://supermarket.chef.io/cookbooks/sc-mongodb
Apache License 2.0
76 stars 91 forks source link

Storage.Journal.Enabled option does not exist on MongoDB versions >= 6.1 #318

Open ixl-cchew opened 3 weeks ago

ixl-cchew commented 3 weeks ago

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

According to MongoDB documentation for journaling, starting in version 6.1 the storage.journal.enabled option has been removed. When running the cookbook, it adds the storage.journal.enabled = true to the /etc/mongod.conf file and consequently, the mongod.service fails to start because storage.journal.enabled is an invalid argument.

:pancakes: Cookbook version

sc-mongodb (5.1.23)

:woman_cook: Chef-Infra Version

version 16.17.51

:tophat: Platform details

Ubuntu 20.04.6 LTS

Steps To Reproduce

Steps to reproduce the behavior:

Ran cinc-client and here is the output

Recipe: sc-mongodb::default * template[/etc/default/mongodb] action create (up to date) * template[/etc/mongod.conf] action create - update content in file /etc/mongod.conf from 9bdb8b to 76b393 --- /etc/mongod.conf 2024-10-25 15:00:00.807304479 +0000 +++ /etc/.chef-mongod20241104-417455-g48drr.conf 2024-11-04 22:10:06.311581922 +0000 @@ -14,6 +14,8 @@ fork: false pidFilePath: "/var/run/mongodb/mongod.pid" storage: + journal: + enabled: true dbPath: "/mongo" engine: wiredTiger replication:

And this is the output from systemctl status mongod.service

Nov 04 22:10:23 mongo-instance mongod[420180]: Unrecognized option: storage.journal.enabled Nov 04 22:10:23 mongo-instance mongod[420180]: try '/usr/bin/mongod --help' for more information Nov 04 22:10:23 mongo-instance systemd[1]: mongod.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

:police_car: Expected behavior

The storage.journal.enabled should not be included in the /etc/mongod.conf file for mongodb versions >= 6.1 and mongod.service should be started without errors.

:heavy_plus_sign: Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

shae128 commented 3 days ago

We’re facing the same issue. While a workaround is possible (albeit with some extra effort), it would be much better to address this error directly in the original cookbook.