.mongorc.js' failed with errno:13 Permission denied

2,698 views
Skip to first unread message

anil....@saama.com

unread,
Mar 22, 2017, 4:30:22 PM3/22/17
to mongodb-user
When I try to connect to mongo shell from pycharm I get the following error 


2017-03-22T12:15:52.874-0700 I STORAGE  In File::open(), ::open for '/Users/anilthorat/.mongorc.js' failed with errno:13 Permission denied
The ".mongorc.js" file located in your home folder could not be executed


Any help appreciated.


This communication is confidential and subject to and governed by Saama’s Electronic Communications Disclaimer.

 

Wan Bachtiar

unread,
Mar 30, 2017, 9:06:50 PM3/30/17
to mongodb-user

When I try to connect to mongo shell from pycharm I get the following error

Hi Anil,

Could you clarify the above:

  • Do you mean connecting to mongod using mongo shell embedded in PyCharm ? Or connecting from PyCharm to a mongo shell to re-direct database operations ?
  • Is the log entry above from mongod log file ? The format looks like so, but could you clarify ?
  • Can you consistently trigger the error, if so how ? i.e. include steps
  • Are you utilising a specific PyCharm MongoDB plugin ?

Try checking the permission of the file /Users/anilthorat/.mongorc.js, to confirm whether you have access to it.

In addition to the above check, you should confirm whether you’re running as the correct user and permission. mongo shell checks the existence of mongorc.js file in the user’s HOME directory on start up. Assuming that PyCharm MongoDB shell is calling mongo , then it’s most likely that the process is invoked as user anilthorat.

See also more information about mongorc.js file.

Regards,

Wan.

anil....@saama.com

unread,
Apr 4, 2017, 3:43:10 PM4/4/17
to mongodb-user
@Wan

thanks for the reply. I deleted that file and I am able to use the mongo shell from pycharm.
but still cannot run programs using pycharm, the same program if I run from terminal it works fine.

This the error : 

/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 /Users/anilthorat/PycharmProjects/mongodb/update.py
Traceback (most recent call last):
  File "/Users/anilthorat/PycharmProjects/mongodb/update.py", line 1, in <module>
    import pymongo
ImportError: No module named pymongo

Process finished with exit code 1

------------------------------------------------

Thanks,
Anil.

Wan Bachtiar

unread,
Apr 19, 2017, 11:04:35 PM4/19/17
to mongodb-user

cannot run programs using pycharm, the same program if I run from terminal it works fine.

Hi Anil,

The problem here is the environment that PyCharm is executing your code differs to how you execute your code. Most likely PyCharm spawns a new environment where pymongo (or other third-party modules) is not available.

You may find this useful PyCharm: Run/Debug Configuration - Python

As this question related more about PyCharm configuration than MongoDB itself, you may want to post a question in StackOverflow to reach wider audience.

Regards,

Wan.

Reply all
Reply to author
Forward
0 new messages