File permission errors persist when updating plugins

Keywords: WordPress - AWS - Technical issue - Permissions

bndiagnostic ID: ca6b0054-4da1-bbf7-fe31-ad825b5714cb

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/

bndiagnostic failure reason: Not clear whether plugin error was caused due to outdated plugin or file permissions. Plugin is outdated due to file permissions.

Description:
I have connected to my Lightsail Wordpress instance via SSH and changed the file permissions for the entirety of the wp-content folder and files. When trying to update plugins via the Wordpress Admin Dashboard, the update fails due to file permissions. I am able to upload things via FTP, but some files/directories are not allowing any changes.

Hi @andi,

Thanks for using Bitnami. Can you tell us which commands did you use to update the file system permissions? Can you also run the commands below to reset the file system permissions to the original state and try to update your plugins using the WordPress admin panel?

sudo chown -R bitnami:daemon /opt/bitnami/wordpress
sudo find /opt/bitnami/wordpress -type d -exec chmod 775 {} \;
sudo find /opt/bitnami/wordpress -type f -exec chmod 664 {} \;
sudo chmod 640 /opt/bitnami/wordpress/wp-config.php

Apart from that, the bndiagnostic tool found some errors related to your theme. Can you check them with the theme developers?

[Thu Apr 28 18:38:08.106219 2022] [proxy_fcgi:error] [pid 4595:tid 140658425620224] [client **ip_address**:58737] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function pitch_qode_options() in /bitnami/wordpress/wp-content/themes/pitchwp/css/style_dynamic_callback.php:15
Stack trace:
#0 {main}
 thrown in /bitnami/wordpress/wp-content/themes/pitchwp/css/style_dynamic_callback.php on line 15', referer: https://35.182.227.211/
 [Thu Apr 28 18:38:08.108143 2022] [proxy_fcgi:error] [pid 4917:tid 140658215802624] [client **ip_address**:58708] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function pitch_qode_options() in /bitnami/wordpress/wp-content/themes/pitchwp/css/style_dynamic_responsive_callback.php:15
Stack trace:
#0 {main}
 thrown in /bitnami/wordpress/wp-content/themes/pitchwp/css/style_dynamic_responsive_callback.php on line 15', referer: https://35.182.227.211/
 [Thu Apr 28 18:38:08.677650 2022] [proxy_fcgi:error] [pid 4594:tid 140658526332672] [client **ip_address**:58735] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function pitch_qode_options() in /bitnami/wordpress/wp-content/themes/pitchwp/js/default_dynamic_callback.php:29
Stack trace:
#0 {main}
 thrown in /bitnami/wordpress/wp-content/themes/pitchwp/js/default_dynamic_callback.php on line 29', referer: https://35.182.227.211/

I also see your server is running out of resources

-----------------------------------
Display amount of free and used memory in the system
-----------------------------------
Running: free -m
In: /opt/bitnami

Output:

              total        used        free      shared  buff/cache   available
Mem:            482         302          24          38         155         128
Swap:           634         325         309

Can you check if there is any bot running a lot of requests against your website?

https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/deny-connections-bots-apache/

1 Like

Yes those are the exact commands I ran, and I’m still receiving chmod errors when trying to update. I am migrating someone else’s existing website to my server. They no longer have/pay for theme support so I cannot contact the theme developers. I suspect the theme errors are because I am unable to update the theme’s core plugins. Is there any chance that the wordpress process is being attempted by a different user group than bitnami:daemon? Maybe then I’d need to run different permission commands.

Hi @andi,

According to the information you provided with the bndiagnostic tool in the first post, there were many files under the wp-content directory and also under wp-content/plugins folder with ownership for bitnami:bitnami instead of bitnami:daemon.

/bitnami/wordpress/wp-content/plugins:
total 152
drwxrwxr-x 27 bitnami daemon   4096 Apr 28 18:22 .
drwxrwxr-x 13 bitnami daemon   4096 Apr 28 14:50 ..
drwxrwxr-x  4 bitnami daemon   4096 Apr 11 20:54 akismet
drwxrwxr-x  7 bitnami daemon   4096 Apr 11 20:54 all-in-one-seo-pack
drwxrwxr-x  3 bitnami daemon   4096 Apr 11 20:54 all-in-one-wp-migration
drwxrwxr-x  9 bitnami daemon   4096 Apr 11 20:54 amazon-polly
drwxrwxr-x  8 bitnami daemon   4096 Apr 11 20:54 amp
drwxrwxr-x  6 bitnami bitnami  4096 Apr 27 18:51 better-wp-security.old
-rw-rw-r--  1 bitnami daemon      0 Apr 11 20:54 .buildcomplete
drwxrwxr-x  3 bitnami bitnami  4096 Apr 27 18:51 classic-editor
drwxrwxr-x  8 bitnami bitnami  4096 Apr 28 18:26 envato-market
(...)

That’s why I asked you to run the commands again. Can you do it just in case? After that, try to update the plugins from the WordPress admin panel. If you continue having issues, please run the bndiagnostic tool again and share the new code with us so we can check the updated information.

I’ve run those commands a million times now. I’ve tried it for bitnami:daemon, bitnami:bitnami, and even root:root. I still receive the “Update failed: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.” error when attempting to update any plugins. I’ve got two different websites doing this.

01dd24e5-2362-e100-bd63-48aa415109d6

Hi @andi,

It’s not clear why the plugin can’t be updated as the permissions used are the correct ones. Does the same thing happen with a fresh instance of Bitnami WordPress?

Regards,
Michiel

Something about transferring the files from an old wordpress to a bitnami wordpress installation was not working correctly. I installed the migrated website on a LAMP instance instead, and was able to update things normally.

1 Like