Plugin update not working

Hello,

I am trying to update plugins using wp-cli update, to do so I executed following commands:
docker exec -u www-data -it devkinsta_fpm bash
cd /www/kinsta/public/mywebsite
wp update myplugin

I get a permission denied error:
Failed to create directory ‘/var/www/.wp-cli/cache/’: mkdir(): Permission denied.

So I tried to sudo chmod the .wp-cli folder:
sudo chown -R www-data:www-data /var/www/.wp-cli

What is the default sudo password? Is it the right way to solve this issue?

Thank you

UPDATE:
I managed to update another plugin, it seems the problem is with connects-woocommerce specifically

Hello @clembcn and welcome to our community! :wave:

In case you would like to set permission of that /var/www/ sub-folder (and its folders/subfolders) with www-data user, you could execute the following command first to access the docker as root instead of as www-data user:

docker exec -it devkinsta_fpm bash

then you can perform the following command:

chown -R www-data:www-data /var/www/

Once done, you can exit from that docker and re-access with the www-data user:

docker exec -u www-data -it devkinsta_fpm bash

and try to perform that wp plugin update thepluginname , and it should be able to create directories and/or files under that /var/www/.wp-cli/cache/ sub-folder(s).

Hope that helps! :bowing_man:

Best regards,
Agus Utomo

Thank you for the feedback, I have worked around the problem but will take good not for next time :slight_smile:

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