Media Library not loading/chmod(): Operation not permitted

Keywords: WordPress + NGINX + SSL - AWS - Technical issue - Permissions

bnsupport ID: 904b648c-75c6-050a-8925-5e0cc55ea016

bndiagnostic output:

? Nginx: Found possible issues
? Wordpress: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/installer/infrastructure/nginx/troubleshooting/

bndiagnostic failure reason: The documentation did not make any significant change

Description:
Hi,

I’m trying to migrate a Wordpress site into a new stack.

I appear to be having some issue with file permissions, but I’m a bit stucked as to what is causing it.

I’ve uploaded the content folder, and imported the database, however, no images are showing in the media library.

I am also getting “Warning: chmod(): Operation not permitted in /opt/bitnami/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 173” when I go to update a plugin.

I have ran updates on my permissions
bitnami@ip-172-31-30-124:~$ sudo chown -R bitnami:daemon /opt/bitnami/wordpress
bitnami@ip-172-31-30-124:~$ sudo find /opt/bitnami/wordpress -type d -exec chmod 775 {} ;
bitnami@ip-172-31-30-124:~$ sudo find /opt/bitnami/wordpress -type f -exec chmod 664 {} ;
bitnami@ip-172-31-30-124:~$ sudo chmod 640 /opt/bitnami/wordpress/wp-config.php
bitnami@ip-172-31-30-124:~$ sudo /opt/bitnami/ctlscript.sh restart
Restarting services…

I’m a bit stumped as to how to proceed.

Hi @frostie,

Please take a look at this post to configure the permissions of the /opt/bitnami/wordpress and /bitnami/wordpress folders

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Thanks @jota, that solved one problem (i assumed they are related).

I can update my plugins now, however, I’m still not seeing files in the media library.

I assume those changes will impact when you see in the support tool, so I ran it again , the output is da9b86f1-439d-b943-e6a9-181fef20aa1f

Hi @frostie,

Which full path are you having issues with? Following the previous case should set the right permissions (and in fact, they seem to be ok). You could clean your nginx/logs/error.log file and run the tool again to check the more recent errors.

Regards

Thanks @davidg,

That’s why i am a bit confused. The file are in /bitnami/wordpress/wp-content/uploads, I can see them when I log into the FTP, but in Wordpress, the media library is empty.

I think I cleared the logs, and restarted Apache - I ran the support tool again, it’s showing this:

Found recent error or warning messages in the Nginx error log.

2021/11/12 19:07:10 [error] 12280#12280: *694 access forbidden by rule, client: 
**ip_address**, server: _, request: "POST /mifs/.;/services/LogService 
HTTP/1.1", host: "34.254.252.253:443", referrer: "https://34.254.252.253:443"
 2021/11/12 19:21:03 [error] 12280#12280: *702 access forbidden by rule, client: 
**ip_address**, server: _, request: "GET /.git/config HTTP/1.1", host: 
Press [Enter] to continue:
"34.254.252.253"
 2021/11/12 20:08:17 [error] 12280#12280: *705 access forbidden by rule, client: 
**ip_address**, server: _, request: "GET /.env HTTP/1.1", host: "34.254.252.253"

Code is: 93b5862e-1c30-ab27-4e51-d1755cec4076

Just to follow up, did the obvious Wordpress debugging suggestions - deactivated all plugins and set the theme to the default, neither of those helped either. I’ve also checked, permalinks look correct.

If I enter the full URL to an image, it displays in my browser, it’s just the WP library they are missing from.

Hi @frostie,

It may be cases in which the plugin doesn’t work properly due to the symlink. Could you please remove the symlink as explained here?

Hi all,

Figured this one out. The Database export was missing any reference to image attachments, so the media library was empty as a result.

Trying to pull a fresh export from my old stack.

Kieran