[SERVER-22072] Unable to start service with error " ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: Success" Created: 06/Jan/16 Updated: 30/Jan/16 Resolved: 30/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dharshan Rangegowda | Assignee: | Ramon Fernandez Marina |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Platforms F (01/29/16) | ||||||||
| Participants: | |||||||||
| Description |
|
CentOS 6.x I started my service manually using "mongod -f /etc/mongod.conf". I think this messed up permissions. However I reset permissions using "chown -R mongod:mongod /mongodb_data" However after this I am unable to start the service anymore. It fails with error message The pid file and director are present and are writeable by mongod |
| Comments |
| Comment by Support support [ 30/Jan/16 ] | ||||||||||||||||||||||||||
|
Hi Ramon, Unfortunately both these solutions dont fix the issue - so there might be some other root cause here. | ||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 30/Jan/16 ] | ||||||||||||||||||||||||||
|
One of our engineers was able to trigger this error message with a full filesystem, so in addition to checking permissions please make sure that there's sufficient space in the filesystem to start mongod. We've opened If you need additional assistance troubleshooting this node please post on the mongodb-user group. Regards, | ||||||||||||||||||||||||||
| Comment by Support support [ 27/Jan/16 ] | ||||||||||||||||||||||||||
|
Thanks. The file is owned by the mongod user - so its surprising there are permission issues. Are there some commands I can run on the command line to verify this? | ||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 27/Jan/16 ] | ||||||||||||||||||||||||||
|
dharshanr@scalegrid.net, the odd error message may be happening because of an incorrect use of the errno value in the code that writes the pid file. We're investigating how to fix this – but while confusing, the error message does point to a permissions issue whereas the user running the mongod process can't write to to /var/run/mongodb/mongod.pid. | ||||||||||||||||||||||||||
| Comment by Dharshan Rangegowda [ 16/Jan/16 ] | ||||||||||||||||||||||||||
|
Folks - any thoughts on how to debug further? | ||||||||||||||||||||||||||
| Comment by Dharshan Rangegowda [ 07/Jan/16 ] | ||||||||||||||||||||||||||
|
Here you go
| ||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 07/Jan/16 ] | ||||||||||||||||||||||||||
|
Can you please post your mongod.conf file? As pointed out by Amanpreet this looks like running mongod manually messed up permissions, but I agree the error message you're getting is confusing. | ||||||||||||||||||||||||||
| Comment by Dharshan Rangegowda [ 07/Jan/16 ] | ||||||||||||||||||||||||||
|
I am using the default init scripts. I am starting the service using "service mongod start" | ||||||||||||||||||||||||||
| Comment by Amanpreet Singh [ 07/Jan/16 ] | ||||||||||||||||||||||||||
|
That is the case if you use the default init scripts and run mongod as a service. In your case, use runuser or su to start the process as mongod user. | ||||||||||||||||||||||||||
| Comment by Dharshan Rangegowda [ 06/Jan/16 ] | ||||||||||||||||||||||||||
|
I am just using the default setup by the mongo rpm file. I think it configures the mongo process to run as mongod user. | ||||||||||||||||||||||||||
| Comment by Amanpreet Singh [ 06/Jan/16 ] | ||||||||||||||||||||||||||
|
Okay. mongod is the owner of pid file. But are you starting the process as mongod user? If not, try doing that. | ||||||||||||||||||||||||||
| Comment by Dharshan Rangegowda [ 06/Jan/16 ] | ||||||||||||||||||||||||||
|
Hi, That was the first thing I checked. Both /var/run/mongodb and the .pid file are owned by mongod.
I also deleted the folder and tried to restart but it did not work. Tried to restart the machine - that didn't make a difference. If it was a permissions issue wouldn't the error code say "permissions" instead of "success" ? | ||||||||||||||||||||||||||
| Comment by Amanpreet Singh [ 06/Jan/16 ] | ||||||||||||||||||||||||||
|
My guess is only root user has write access to /var/run/mongodb/mongod.pid and you're not running mongod as root user. |