[SERVER-3623] [journal] User Assertion: 13646:stat() failed for file: /data/db/ errno:2 The system cannot find the file specified. Created: 17/Aug/11  Updated: 15/Aug/12  Resolved: 04/Mar/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.0.0-rc0
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Travis Paxton Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: journal
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 Enterprise 64-bit, VMware Fusion


Attachments: Text File mongodb.log     Text File mongodb_1.log     Text File mongodb_2.log     Text File mongodb_3.log    
Issue Links:
Related
is related to SERVER-3632 dbpath should use windows syntax on w... Closed
Participants:

 Description   

I'm getting this when I start mongod with the --journal option. Not sure if it's a bug, thanks!

[journal] User Assertion: 13646:stat() failed for file: /data/db/ errno:2 The system cannot find the file specified.



 Comments   
Comment by Tad Marshall [ 20/Jan/12 ]

For whatever reason (I haven't looked at the code), the mongod.lock file is never deleted on Windows on a clean exit, but it is reduced to zero bytes and this functions the same way that deleted the file works on Linux – it marks the directory as available for a new instance of mongod.exe. So, this isn't a problem and seems to be "by design".

Comment by Travis Paxton [ 08/Dec/11 ]

I've attached mongodb_3.log. The assertion error no longer appears, but as Chris pointed out, the mongod.lock file does not get removed.

Comment by Tad Marshall [ 08/Dec/11 ]

Most (or maybe even all) Win32 APIs accept the Unix-style path, but the Windows command prompt CMD.EXE doesn't at all. This is because of the legacy of using forward slash as a command line switch, which dates back to TOPS-10, TOPS-20 and CP/M. You may get mixed results with C and C++ APIs.

Comment by Mathias Stearn [ 17/Oct/11 ]

have you tried 2.0.0-final

Comment by Chris Westin [ 23/Aug/11 ]

Seems to work fine:

$ ./mongod
C:\cygwin\home\cwestin\mongo\mongod.exe --help for help and startup options
Tue Aug 23 14:26:45 [initandlisten] MongoDB starting : pid=9360 port=27017 dbpat
h=/data/db/ 64-bit host=tellus
Tue Aug 23 14:26:45 [initandlisten] _DEBUG build (which is slower)
Tue Aug 23 14:26:45 [initandlisten] db version v2.0.0-rc0-pre-, pdfile version 4
.5
Tue Aug 23 14:26:45 [initandlisten] git version: 6d5188ea67f5487b74e755333f5467e
1be1abb32
Tue Aug 23 14:26:45 [initandlisten] build info: windows (6, 1, 7601, 2, 'Service
Pack 1') BOOST_LIB_VERSION=1_42
Tue Aug 23 14:26:45 [initandlisten] options: {}
Tue Aug 23 14:26:45 [initandlisten] journal dir=/data/db/journal
Tue Aug 23 14:26:45 [initandlisten] recover : no journal files present, no recov
ery needed
Tue Aug 23 14:26:45 [initandlisten] waiting for connections on port 27017
Tue Aug 23 14:26:45 [websvr] admin web console waiting for connections on port 2
8017
Tue Aug 23 14:27:01 Ctrl-C signal
Tue Aug 23 14:27:01 got kill or ctrl-c signal, will terminate after current cmd
ends
Tue Aug 23 14:27:01 [ctrlCTerminate] now exiting
Tue Aug 23 14:27:01 dbexit:
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: going to close listening sockets.
..
Tue Aug 23 14:27:01 [ctrlCTerminate] closing listening socket: 468
Tue Aug 23 14:27:01 [ctrlCTerminate] closing listening socket: 484
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: going to flush diaglog...
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: going to close sockets...
Tue Aug 23 14:27:01 [websvr] thread websvr stack usage was 20928 bytes
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: waiting for fs preallocator...
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: lock for final commit...
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: final commit...
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: closing all files...
Tue Aug 23 14:27:01 [ctrlCTerminate] closeAllFiles() finished
Tue Aug 23 14:27:01 [ctrlCTerminate] journalCleanup...
Tue Aug 23 14:27:01 [ctrlCTerminate] removeJournalFiles
Tue Aug 23 14:27:01 [ctrlCTerminate] shutdown: removing fs lock...
Tue Aug 23 14:27:01 dbexit: really exiting now

It created the lock file and journal directory. It did not remove mongod.lock when I stopped mongod, as it should.

Comment by Mathias Stearn [ 23/Aug/11 ]

what if you have an existing but empty C:\data\db?

Comment by Chris Westin [ 19/Aug/11 ]

Same as the above on 2.0.0-rc0-pre.

Comment by Chris Westin [ 19/Aug/11 ]

I made sure I didn't have a c:\data\db. I commented out dbpath from my config file and started up current 1.9.2 head. I get
...
Fri Aug 19 14:37:44 [initandlisten] db version v1.9.2-pre-, pdfile version 4.5
Fri Aug 19 14:37:44 [initandlisten] git version: b74c9b8fd811c0ebde47705c1f09074b60261d18
Fri Aug 19 14:37:44 [initandlisten] build info: windows (6, 1, 7601, 2, 'Service Pack 1') BOOST_LIB_VERSION=1_42
Fri Aug 19 14:37:44 [initandlisten] options:

{ config: "../sandbox/mongodb.conf", directoryperdb: "true", journal: "true", logappend: "true", logpath: "c:/cygwin/home/cwestin/sandbox/mongodb.log", rest: "true" }

Fri Aug 19 14:37:44 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
Fri Aug 19 14:37:44 dbexit:
Fri Aug 19 14:37:44 [initandlisten] shutdown: going to close listening sockets..
...

Comment by Mathias Stearn [ 19/Aug/11 ]

@Chris Are you able to repro this on your Win7 box? Feel free to assign back to me.

Comment by Travis Paxton [ 19/Aug/11 ]

Commands executed from c:\mongodb:

bin\mongod.exe -vvvvv --journal --logpath mongodb.log --dbpath c:\data\db

bin\mongod.exe -vvvvv --journal --logpath mongodb.log

Comment by Mathias Stearn [ 18/Aug/11 ]

Could you include the full command line you use to launch mongod both with and without --dbpath?

Comment by Travis Paxton [ 18/Aug/11 ]

I have only one drive. I'm launching mongod.exe from c:\mongodb\bin\mongod.exe

Comment by Mathias Stearn [ 18/Aug/11 ]

Do you have more than one drive? Which drive is \data\db on? Which drive are you launching mongod from?

Comment by Travis Paxton [ 18/Aug/11 ]

I tried the new nightly, but it looks like it's still throwing the assertion error (see mongodb_2.log). The error isn't thrown when I manually set the path.

Comment by Travis Paxton [ 17/Aug/11 ]

I'll wait for a new nightly and test it tomorrow, thanks!

Comment by Mathias Stearn [ 17/Aug/11 ]

Could you try either rebuilding mongodb with the patch mentioned above or try again with tomorrow's nightlies?

Comment by auto [ 17/Aug/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: localized fix for SERVER-3623. Broader fix is SERVER-3632
Branch: master
https://github.com/mongodb/mongo/commit/e9759a516c6ecd82a991f2150cbc7767f0eccb0e

Comment by Travis Paxton [ 17/Aug/11 ]

It looks like setting the dbpath does fix it. I've uploaded an updated log. I'll go ahead and manually set the dbpath for now. Thanks!

Comment by Mathias Stearn [ 17/Aug/11 ]

Hmm, this could be a Windows thing. Could you try using windows-style syntax for --dbpath (c:\data\db)? If that fixes it that will confirm where the bug is and it should be easy to fix. Luckily that assertion is thrown in a block of code that ignores errors because it is an optional optimization. Everything should still work, but you could be missing out on some performance

Comment by Travis Paxton [ 17/Aug/11 ]

Eliot: MongoDB does continue to load and it even creates the journaling file under /data/db/journal so it should have read/write access to that location.

Mathias: I've uploaded the log with full verbose output.

Thanks!

Comment by Mathias Stearn [ 17/Aug/11 ]

could you upload the full log file?

Comment by Eliot Horowitz (Inactive) [ 17/Aug/11 ]

Do you have a /data/db directory that is readable by the user you're starting mongod with?

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