Update Failed: Could not create directory

:warning: IMPORTANT, please fill the questions

We assume you are using Bitnami to deploy your application.

  • Which version of the application are you using?:

Latest version

  • Please choose how you got the application: Installer (Windows, Linux, macOS), cloud image (AWS, GCE, Azure, …) or VM (VMDK, VBOX):

Lightsail with Bitnami Wordpress

  • Have you installed any plugin or modified any configuration file?:

Many plugins are installed.

  • Describe here your question/suggestion/issue (expected and actual results):

When trying to update a plugin, I get the error “Update Failed: Could not create directory.”

Is this a known issue? How can I fix this?

  • Steps to reproduce the issue (if relevant):

Update a Wordpress plugin.

  • Copy the apache log (if relevant):
PASTE HERE

Hello @clixer

This seems to be a permissions issue. Please take a look to the TroubleShooting Guide below:

Troubleshoot Permission Issues

Please also connect via SSH to your server as descibed here and run the commands below:

ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/
ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/ 

Share with us the output so we cant take a look to the permissions configuration.

Best Regards,

Juan Ariza


Was my answer helpful? Click on :heart:

Hi jariza,

Apologies for the late response.

I believe the issue was related to user ownership of directories and files. I solved the problem by running the following commands:

cd /opt/bitnami/apps/wordpress/htdocs
sudo chown daemon:daemon -R *

sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;

The out for command ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/ is:

drwxr-xr-x 10 daemon  daemon 4096 Oct 14 03:53 .
drwxr-xr-x  5 bitnami daemon 4096 Oct 13 00:38 ..
drwxr-xr-x  2 daemon  daemon 4096 Oct  8 03:20 ai1wm-backups
drwxr-xr-x  2 daemon  daemon 4096 Oct 14 04:12 aiowps_backups
drwxr-xr-x  4 daemon  daemon 4096 Nov 30 12:10 cache
-rw-rw-r--  1 daemon  daemon   28 Oct 10 00:55 index.php
drwxr-xr-x  4 daemon  daemon 4096 Oct  7 11:23 languages
drwxr-xr-x 14 daemon  daemon 4096 Nov 30 12:07 plugins
drwxr-xr-x  8 daemon  daemon 4096 Oct 10 00:55 themes
drwxr-xr-x  2 daemon  daemon 4096 Nov 30 12:07 upgrade
drwxr-xr-x 10 daemon  daemon 4096 Oct 10 00:57 uploads

and the output for command ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/ is:

drwxr-xr-x 14 daemon daemon 4096 Nov 30 12:07 .
drwxr-xr-x 10 daemon daemon 4096 Oct 14 03:53 ..
drwxr-xr-x  4 daemon daemon 4096 Oct  7 11:21 akismet
drwxr-xr-x  4 daemon daemon 4096 Oct  8 03:20 all-in-one-wp-migration
drwxr-xr-x 12 daemon daemon 4096 Oct 14 03:53 all-in-one-wp-security-and-firewall
drwxr-xr-x  3 daemon daemon 4096 Oct 10 00:55 bad-behavior
-rw-rw-r--  1 daemon daemon  342 Oct  6  2015 error_log
drwxr-xr-x  9 daemon daemon 4096 Oct 10 00:55 fusion-core
-rw-rw-r--  1 daemon daemon 2255 Oct 10 00:55 hello.php
-rw-rw-r--  1 daemon daemon   28 Oct 10 00:55 index.php
drwxr-xr-x 13 daemon daemon 4096 Oct 10 00:55 LayerSlider
drwxr-xr-x  9 daemon daemon 4096 Nov 30 12:07 redirection
drwxr-xr-x 12 daemon daemon 4096 Oct 10 00:55 revslider
drwxr-xr-x  6 daemon daemon 4096 Aug  4 12:06 simple-tags
drwxr-xr-x 11 daemon daemon 4096 Oct 12 04:54 wordpress-seo
drwxr-xr-x  8 daemon daemon 4096 Oct 13 10:52 wp-fastest-cache
drwxr-xr-x  3 daemon daemon 4096 Aug  4 12:06 wp-mail-smtp

Please let me know if you see any issues.

Thanks.

2 Likes

Hello @clixer

Instead of “daemon:deamon”, I would use bitnami:daemon and **664/775 **so you can edit the files when using SFTP or SSH but it’s up to you, the app would work fine with you current configuration.

cd /opt/bitnami/apps/wordpress/htdocs
sudo chown bitnami:daemon -R *
sudo find . -type d -exec chmod 775 {} \;
sudo find . -type f -exec chmod 664 {} \; 

Best Regards,

Juan Ariza


Was my answer helpful? Click on :heart:

1 Like

Hi jariza,

With the “bitnami:daemon” option and chmod 775 and 664, some plugins were complaining about not having the write access hence I made the change based on a recomendation from a community member.

Once the app is set-up and running, there would be no need to manually edit any files.

Cheers.

Hi @clixer

That’s weird… You should not find issues with that configuration but… it depends on how the Plugin is designed. Some plugins check whether the directory is own by the user running the web server (daemon) and they don not check whether they can write in the directory or not, therefore, the conflict.

Anyway, I am glad that you were able to fix the issue using daemon:daemon. I proceed to close this ticket as solved. If you have any other questions, please do not hesitate to open a new thread.

Best Regards,

Juan Ariza