Mongodb Permission denied error

Hi, 

I installed Countly Community Edition on a freshly installed Linux. It is installed in /root folder by default. And it works as expected after installation. But after restarting my server, mongodb doesn't run so, i can not use Countly. it says 'Forbidden Token' on webpage. When i try to run mongodb service by myself i encounter this error down below,

 

~$ sudo service mongod status
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-06-18 23:30:03 +03; 5min ago
Docs: https://docs.mongodb.org/manual
Process: 4908 ExecStart=/bin/bash /root/countly/bin/commands/systemd/mongodb.sh (code=exited, status=126)
Main PID: 4908 (code=exited, status=126)

Haz 18 23:30:03  systemd[1]: Started High-performance, schema-free document-oriented database.
Haz 18 23:30:03 bash[4908]: /bin/bash: /root/countly/bin/commands/systemd/mongodb.sh: Permission denied
Haz 18 23:30:03 systemd[1]: mongod.service: Main process exited, code=exited, status=126/n/a
Haz 18 23:30:03 systemd[1]: mongod.service: Failed with result 'exit-code'.

 

It seems mongodb.sh file can not start up because it is in root folder so, access is getting denied. How can i solve this problem, can you help me?

0

Comments

9 comments
  • Alright, i read the documentation again and there is written that for github installation, do not use /root folder. I believe this is due to the problem with root permissions. So, now i am going to delete Countly folder in root and will try github installation. I hope this'll work

    0
    Comment actions Permalink
  • Okay, i have managed to make it work. I deleted Countly, Mongodb and all of its files. Then downloaded it again. Then i configured supervisord.conf and config,js to create a debug environment. But it seems i am not able to debug the server (--inpect api.js) i fire a user_details request from Android SDK but it doesn't stop at my breakpoint in 'api.js' of logger plugin:

    if (params.qstring.user_details) { 
         types.user_details = params.qstring.user_details;     <= breakpoint is here
     
    What did i do wrong?
    0
    Comment actions Permalink
  • Hi Niko,

    Thanks for reaching out. I saw that you are discussing this issue with our team on the Community Slack. Please let me know if you need help with anything else. Thank you.

    0
    Comment actions Permalink
  • Hi Subodh,

     

    Yes, thanks to Arturs, i managed to debug server. But it would be nice if you can explain me about this first problem i've encountered. 

    sudo su -

    wget -qO- http://c.ly/install | bash

     

    I used these command lines and Countly downloaded in /root folder. Is it the expected behaviour? If so, what can i do to run Countly after restart? If not, is there something i need to do before?

    0
    Comment actions Permalink
  • Hi Niko,

     

    Path /root is not a good option, because of OS restrictions, installing in any other path would be better and would not require additional modifications.

    0
    Comment actions Permalink
  • Well, it was /root by default when i installed Countly with that bash command. I'm a kinda newbie on Linux (Ubuntu) so, any suggestion to install Countly to a desired path would be appreciated since it will be help for further installing problems

    0
    Comment actions Permalink
  • Hi Niko,

    when you run sudo su - you will be root and root's home directory is /root so countly will be installed to where you are. You need to change your directory after sudo su - to preferred location if you don't want to install it on /root

    0
    Comment actions Permalink
  • Thank you Subodh, i understand.

    One more question. I have Ubuntu 18.10 Cosmic installed and Countly runs on it. Is it possible to use Countly server on latest version of Ubuntu (Currently 20.04, i think) ? I'm having some hardware problems with my version and i want to try the latest version.

    0
    Comment actions Permalink
  • Hi Niko,

    Right now the only Ubuntu versions supported by Countly are v16.04, v18.04, and v18.10.

    0
    Comment actions Permalink

Please sign in to leave a comment.