[SERVER-5275] When installing MongoDB as a Windows service, the --config argument is not quoted correctly if there are spaces in the path name Created: 09/Mar/12 Updated: 10/Mar/12 Resolved: 09/Mar/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Jarrell | Assignee: | Tad Marshall |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 Pro, SP1 |
||
| Issue Links: |
|
||||||||
| Operating System: | Windows | ||||||||
| Participants: | |||||||||
| Description |
|
When installing MongoDB as a Windows Service, if the mongod.conf file is located in a path with spaces the service will not start correctly. Inspecting the ImagePath in the registry reveals that the --config path is not quoted correctly. Steps to repro 2) Attempt the start the MongoDB service using net start Inspecting the ImagePath key in the registry at HKLM/System/CurrentControlSet/services/MongoDB/ImagePath reveals the following value: Note that the --config value is NOT quoted even though it was quoted on the command line when the service was installed. The work around for this issue to simply to install the config file in a path without spaces, such as "c:\mongo\mongod.conf". |
| Comments |
| Comment by Jeremy Jarrell [ 10/Mar/12 ] |
|
Thanks, Tad! I didn't realize this was already fixed. Also, the trick to simply edit the registry key is indeed an easier work around...I hadn't thought about that. Thanks for such a quick response, |
| Comment by Tad Marshall [ 09/Mar/12 ] |
|
Another workaround for version 2.0.3 is to manually edit the incorrect command line that you found in the registry. If you add the quotes that should have been placed there by the --install operation then you can use paths that include spaces. Change "c:\mongo\bin\mongod.exe" --config c:\program files\mongo\mongod.conf --service to "c:\mongo\bin\mongod.exe" --config "c:\program files\mongo\mongod.conf" --service |
| Comment by Tad Marshall [ 09/Mar/12 ] |
|
Sorry you hit this problem in 2.0.3. This is fixed in 2.1.0 – see https://jira.mongodb.org/browse/SERVER-4410 . |