[SERVER-6453] Errno:22 problem opening logfile using a config file Created: 15/Jul/12  Updated: 15/Feb/13  Resolved: 20/Aug/12

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 2.0.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Robin St.Clair Assignee: Tad Marshall
Resolution: Duplicate Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win XP SP3 (Mongo says SP2)


Issue Links:
Duplicate
duplicates SERVER-4410 Windows Service --install option isn'... Closed
Operating System: Windows
Participants:

 Description   

I am trying to set up Mongo DB as a service under Win XP sp3 (mongod says sp2), version 2.0.6 pdfile version 4.5

To do this I have set up a config file -

  1. mongodb.cfg
  1. data directory
    dbpath = "C:\Documents and Settings\xxx\Ubiquiti UniFi\data\db"
  1. log file directory
    logpath = "C:\logs\server.log"
  1. append to log file
    logappend = true
  1. port mongodb listens on
    port = 27117

My command line is -

"C:\Documents and Settings\Robin StClair\Ubiquiti UniFi\bin\mongod.exe" --config "C:\Documents and Settings\Robin StClair\Ubiquiti UniFi\conf\mongodb.cfg" --install

as I wish to set up Mongo DB as a service.

Mongod.exe executes, finds and opens the config file and then an errno:22 is thrown and mongod.exe shuts down gracefully.

I believe this is a Visual C++ error (doesn't like long command strings, hence my short path to log file (to see if that would get rid of the problem)).

I would be grateful for some guidance

R+C



 Comments   
Comment by Tad Marshall [ 06/Aug/12 ]

I think this is issue https://jira.mongodb.org/browse/SERVER-4410 – Windows Service --install option isn't quoting all file parameters – which is fixed in version 2.1.0.

The bug manifests itself at the time you install the service, so upgrading the one you already have installed won't fix it. But you can fix it yourself by editing the registry. Run RegEdit and navigate to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MongoDB . Edit the ImagePath value and add quotes around the config filespec. Start the MongoDB service and it should work.

Alternatively, you could download version 2.1.0, use either version to "--remove" the old entry for the server and use 2.1.0 to add the service again.

Unfortunately, support for Windows XP was dropped for version 2.2.0 of MongoDB. This was required by some functions we started using in 2.2.0 that did not exist in Windows XP. Windows Server 2003 will be the oldest version of Windows we'll run on in 2.2.0.

Generated at Thu Feb 08 03:11:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.