"Update failed: The update cannot be installed because some files could not be copied"

Got this error on WP-Discourse latest update:

Update failed: The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.

I updated 3 other plugins without issue. Only this plugin gave the error:

Have not made any permission changes, period. (other plugins updated without issue) Any ideas?

Navigating to /wp-content/plugins/ and /wp-content/plugins/wp-discourse/, all the file and dir permissions/ownership are identical to all other plugins.

Edit: Just deleting the plugin and reinstalling it via wp-admin fixed the issue. Hopefully nothing is screwed up. Not been smooth sailing with this plugin yet.

Hey @haydenjames,

While I understand you didn’t experience the issue in other updates, this error is not to do with the plugin. It’s concerned with your server setup. You can read more about it here

1 Like

Thanks. I didn’t have to make any changes to the server setup. Just deactivated, deleted, and reinstalled via wp-admin UI. So probably a glitch. thanks!

That happens quite often because owner of directories under Wordpress has been changed to root. If that’s true then chown -R www-data:www-data /var/www/public_html or similar depending of distro and paths helps.

Yup, checked that before posting. chown was correct and recursively correct. both ownership and permissions.

thanks

Yeah, in the most of cases poor admin sees that issue every time when month has changed and tries upload media.

I’ve got same error with other plugins, but not recently. But I can’t remember what was the issue then — but I have very weak memory image of badly behaving origin of plugin. Or I did some funny things with geo-ip and/or blocking IPs.

Do you use any security plugins? Or Fail2ban?

WP-CLI could give a bit more informative error. Or not.

ls -lR wp-discourse/
…came back correctly.