[SERVER-47138] MSI installer produces incorrect config file Created: 26/Mar/20  Updated: 29/Oct/23  Resolved: 25/Jun/20

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 4.2.3
Fix Version/s: 4.4.1, 4.7.0, 4.2.10, 4.0.21

Type: Bug Priority: Minor - P4
Reporter: Tomáš Herceg Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-47259 Windows MSI Installer "Service Failed... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Steps To Reproduce:
  1. Run the MSI installer.
  2. On the configuration screen, enter some short paths for the database and logs (e.g. c:\data and c:\logs).
  3. The mongod.cfg file will be produced incorrectly, and the MongoDB service will be unable to start.

 

Actual output (the remaining bytes of the file are not truncated):

# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
{{ dbPath: C:\data\db}}
{{ journal:}}
{{ enabled: true}}
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
{{ destination: file}}
{{ logAppend: true}}
{{ path: C:\ProgramData\MongoDB\log\mongod.log}}# network interfaces
net:
{{ port: 27017}}
{{ bindIp: 127.0.0.1}}
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
ditLog:
#snmp:{{}}

Sprint: Dev Platform 2020-06-15, Dev Platform 2020-06-29
Participants:

 Description   

The MSI installer has a custom screen on which the user can enter the path to data files and logs. The mongod.cfg file is produced based on the settings on this screen.

If the user selects a shorter path of the log file or data directory than defaults, an incorrect config file is produced.

 

I have provided a [PR #1355 on GitHub|https://github.com/mongodb/mongo/pull/1355] that should fix the issue (I wasn't able to build and test the installer, but I hope I fixed it correctly).



 Comments   
Comment by Githook User [ 11/Aug/20 ]

Author:

{'name': 'Nir Bar', 'email': 'nir.bar@panel-sw.co.il', 'username': 'nirbar'}

Message: SERVER-47138 Fix mongod.cfg file size when replacing tokens in the custom action

Closes #1366

Signed-off-by: Andrew Morrow <acm@mongodb.com>
(cherry picked from commit c61e18a3c3e18bfa486df3c8ac5a4632a390aa3a)
(cherry picked from commit 9d0319b24e374653127f9df97af812885b6adc96)
(cherry picked from commit 4346b20b96f5e4c04d4556c02423562177488e18)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9429e8b95f587fba1d695e1599bb1ad00c6cde0a

Comment by Githook User [ 11/Aug/20 ]

Author:

{'name': 'Nir Bar', 'email': 'nir.bar@panel-sw.co.il', 'username': 'nirbar'}

Message: SERVER-47138 Fix mongod.cfg file size when replacing tokens in the custom action

Closes #1366

Signed-off-by: Andrew Morrow <acm@mongodb.com>
(cherry picked from commit c61e18a3c3e18bfa486df3c8ac5a4632a390aa3a)
(cherry picked from commit 9d0319b24e374653127f9df97af812885b6adc96)
Branch: v4.2
https://github.com/mongodb/mongo/commit/4346b20b96f5e4c04d4556c02423562177488e18

Comment by Githook User [ 06/Aug/20 ]

Author:

{'name': 'Nir Bar', 'email': 'nir.bar@panel-sw.co.il', 'username': 'nirbar'}

Message: SERVER-47138 Fix mongod.cfg file size when replacing tokens in the custom action

Closes #1366

Signed-off-by: Andrew Morrow <acm@mongodb.com>
(cherry picked from commit c61e18a3c3e18bfa486df3c8ac5a4632a390aa3a)
Branch: v4.4
https://github.com/mongodb/mongo/commit/9d0319b24e374653127f9df97af812885b6adc96

Comment by Githook User [ 25/Jun/20 ]

Author:

{'name': 'Nir Bar', 'email': 'nir.bar@panel-sw.co.il', 'username': 'nirbar'}

Message: SERVER-47138 Fix mongod.cfg file size when replacing tokens in the custom action

Closes #1366

Signed-off-by: Andrew Morrow <acm@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/c61e18a3c3e18bfa486df3c8ac5a4632a390aa3a

Comment by Andrew Morrow (Inactive) [ 02/Jun/20 ]

ujr@insynergie.de - Would you mind filing a new ticket with complete details and reproduction instructions for that behavior?

Comment by Ulf Rößler [ 27/Mar/20 ]

Great to have this fix!

 

BTW, AFAICT there's another bug resulting in corrupt configuration: when updating MongoDb with MSI installer. IMO the Custom Action isn't run at all in this case. Such the configuration file contains template values like %MONGODB_PATH%.

Generated at Thu Feb 08 05:13:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.