1

I have deployed mongodb using Helm chart with following values:

mongodb:
  mongodbUsername: mongo_user
  mongodbPassword: verylongpassword
  mongodbDatabase: mongo_read_db
  replicaCount: 1

But when I exec into the pod by:

kubectl exec -it pod sh

And give $mongo command, I get the following error

$ mongo
MongoDB shell version v4.2.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("5d2a9b35d-4ef1-4eeeb0-8fee2-ac9974e7ee66a") }
MongoDB server version: 4.2.2
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
2020-02-03T13:29:07.716+0000 I  STORAGE  [main] In File::open(), ::open for '//.mongorc.js' failed with Permission denied

I tried this after I am unable to connect from rails app.

Tek Nath Acharya
  • 1,676
  • 2
  • 20
  • 35
  • 1
    Can you run `whoami && ls -l mongorc.js` ? – mario Feb 03 '20 at 17:16
  • I meant of course `.mongorc.js` mentioned in the error message. – mario Feb 03 '20 at 18:12
  • 1
    After `kubectl exec -it pod sh` type `cd` and then `mongo` and see if you are getting the same error. (I am changing the current working directory to home of the user will have access) – Tummala Dhanvi Feb 06 '20 at 09:31
  • @Tek Nath, did you manage to solve your issue ? Did you change permissions of `.mongorc.js` file ? – mario Feb 10 '20 at 17:54
  • @mario The above error keeps on coming but was able to connect and create databases after changing the mongodb uri. – Tek Nath Acharya Feb 11 '20 at 05:58
  • 1
    You can try to use [this](https://stackoverflow.com/a/36784197/11714114) workaround to get rid of this error. – mario Feb 17 '20 at 12:26

0 Answers0