We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
WordPress is usually good except sometimes when you encounter an error due to something else.
This is how it looked seem.
As usual, I went through the following troubleshooting steps.
If you are running onshared hostingthen mostly it would be alright.
I am using Nginx onGoogle Cloud, and it was running withwww-datauser.
Permission looked ok, but I changed it again to ensure if there was any file had wrong.
Note: you got to find the user and change www-data with yours.
it’s possible for you to usepscommand to see it.
Once changed, make a run at update the files to see it works.
It didnt work for me.
Check Security Plugins
Are you using any security plugins?
Do you have the option to check their logs to see how exactly your request is being treated?
Alternatively, you’re able to quickly suspend the security plugin and verify if that works.
It didnt to me.
Check Cloud-based Security (WAF)
Are you usingcloud-based security provider WAF?
Check the firewall logs to see if its getting challenged or blocked by them?
Guess what, I am using Cloudflare and that was causing an issue.
After spending some good time, I found that Cloudflare WAF was challenging Update files requests.
It was getting challenged by multiple security rules (SQL injection, XSS, etc).
I whitelisted my IP in the WAF event details and then it was all ok.
If you are using Cloudflare, you could check the firewall logs by logging into the dashboard.
I was able to fix my issue and hope this helps you.