Moodle Update from Bitnami, permissions screwed

Keywords: Moodle - Linux - Technical issue - Permissions
bnsupport ID: 2aa9fd7a-55ca-10f0-8cd2-9567c47d698c
Description:
Hello, first post at a forum/website so my apologies in advance for any mistakes.
I installed a while ago a moodle package using Bitnami in a Linux (CentOS). It worked flawlessly, but a couple days ago I updated my Moodle Package (using the Bitnami guide), and the platform works but I can not install plugins since I get the message “Invalid data root permissions” and will not let me install my plugins. This is a major inconvenience since some of the questions on my courses do not work without those plugins. I have the code generated by the support tool, but I’m unsure wether I should upload it in here or not.
I thank you all in advance for your help, and I’m sorry for the mistakes I may commit.

Hi @r3dalk

Thanks for using Bitnami Moodle and welcome to the community!

We will try to restore the default permissions for the directories and see if that works. We have this covered as part of our upgrade guide, under the section that’s called “Configure file permissions as follows:

Could you please take a look at this guide and follow the excerpt I mentioned (using Approach A or B depending on your installation).

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Hello, thank you so much for your quick response @jcarmona . I don´t have the bitnami user, I installed the package with Moodle 3.9.1 and I think that Bitnami installer didn’t create the bitnami user. It is an issue given that I used a self-contained installation from Bitnami but there is no bitnami user, so I think maybe bitnami updated their user policy last year. Also, how can I check if the stack was originally installed as sudo?
Thanks again for your help.

Update: I did those steps, using root as the user instead of bitnami (I think it could be installed as root) and obtained this when trying to install a zip plugin:

I attach the permissions for the folders and my cron (as root):

[root@moodle moodle-3.9.2-1]# crontab -l

*/1 * * * * su daemon -s /bin/sh -c “/opt/moodle-3.9.2-1/php/bin/php /opt/moodle-3.9.2-1/apps/moodle/htdocs/admin/cli/cron.php” > /dev/null 2>&1>>/opt/moodle-3.9.2-1/apps/moodle/moodledata/moodle-cron-test.log #moodle-cron

Hi @r3dalk

Thanks for the details!

…used a self-contained installation…
I did those steps, using root as the user instead of bitnami (I think it could be installed as root)

In that case, you should perform the commands using your regular user name and daemon as group. If your regular username were bitnami, the commands you should perform would be (I think you used root:daemon instead :slightly_smiling_face:):

$ sudo chown bitnami:daemon -R installdir/apps/moodle/htdocs/
$ sudo find installdir/apps/moodle/htdocs/ -type f -exec chmod 664 {} \;
$ sudo find installdir/apps/moodle/htdocs/ -type d -exec chmod 775 {} \;

where installdir is the path on which Bitnami Moodle was installed

obtained this when trying to install a zip plugin:

I have tried to reproduce your problem but I could not find any issues installing a plugin by myself. However, taking a look at the output the application is producing, I think you might want to try the following to see if it fixes the issue:

  1. Check the permissions for the folder Moodle tells it nos writable:
$ ls -la /tmp/requestdir
$ ls -la /tmp/requestdir/j8uS
  1. Permissions and ownership should look something like this (notice the daemon user and group):
$ ls -la /tmp/requestdir
drwxrwxr-x  3 daemon  daemon    4096 Apr  6 09:47 requestdir
  1. If they don’t, assign the correct permissions by executing the following:
$ sudo chown -R daemon:daemon /tmp/requestdir
$ sudo find /tmp/requestdir -type f -exec chmod 664 {} \;
$ sudo find /tmp/requestdir -type d -exec chmod 775 {} \;

Could you please try that and report back?

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.