[SERVER-4047] make error message for missing dbpath clearer Created: 10/Oct/11  Updated: 11/Jul/16  Resolved: 02/Nov/11

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Improvement Priority: Minor - P4
Reporter: Karl Seguin Assignee: Tony Hannan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The only thing stopping MongoDB from being a download and run process is the need to create a /data/db. I realize that sounds trivial, but it does trip up some people, and it makes writing "how to get started with mongodb" type stuff slightly less streamlined.

Is there any chance that if /data/db doesn't exist, the mongod process tries to create it? And, if it fails, it spits out a very clear and helpful message which isn't just another line in the log...some ascii spacing to help users:

************************************************************************

  • ERROR:
  • Failed to created, /data/db. To fix this, you can:
  • - Manually create /data/db,
  • - Create a different path and launch with the --dbpath PATH option
    *
  • For more information see: http://mongodb.org/help/mongodb-fails-to-start
    *
    *************************************************************************


 Comments   
Comment by auto [ 02/Nov/11 ]

Author:

{u'login': u'TonyGen', u'name': u'Tony Hannan', u'email': u'tony@10gen.com'}

Message: SERVER-4047: make error message for missing dbpath clearer
Branch: master
https://github.com/mongodb/mongo/commit/eb60a604a51719184dc2964b39abfa07857c49fe

Comment by Eliot Horowitz (Inactive) [ 10/Oct/11 ]

We don't want the default path to be relative to package.
Should be in a consistent global place.

Comment by Karl Seguin [ 10/Oct/11 ]

What about adding an empty /data folder to the root of the downloadable package and using that folder by default? To avoid breaking backwards compatibility, you could first check for the existence of /data/db/.

Essentially, the server code wouldn't create anything. The file that they download would have an empty /data folder...on startup, it would first check /data/db and then it would check ../data.

Comment by Eliot Horowitz (Inactive) [ 10/Oct/11 ]

Not sure we should try to create directory, but can certainly make error message better

Comment by Karl Seguin [ 10/Oct/11 ]

the markup engine screwed up my beautiful error box /sadface

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