WordPress gives 502 errors when trying to update plugins

Hey all! I’m running into 502 errors when I try to automatically update components of my WordPress installation through the WordPress dashboard.

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 3.6.5.3
I have access to my server : Through SSH and webadmin. I also have direct access to the server if needed.
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I have installed WordPress on my YunoHost server. I use Cloudflare for DDNS.

When I try to update WordPress components, such as plugins, through the WordPress admin dashboard, I get error messages like this:

Update Failed: <!DOCTYPE html> <!--[if lt IE 7]> <![endif]--> <!--[if IE 7]> <![endif]--> <!--[if IE 8]> <![endif]--> <!--[if gt IE 8]><!--> <!--<![endif]--> blog.spencerdub.me | 502: Bad gateway <!--[if lt IE 9]><![endif]--> body{margin:0;padding:0} Error 502 Ray ID: 57cbb2415bbefdb1 &bull; 2020-03-31 17:12:40 UTC Bad gateway <!-- /.error-overview --> You Browser Working Hillsboro Cloudflare Working blog.spencerdub.me Host Error <!-- /.status-display --> What happened? The web server reported a bad gateway error. What can I do? Please try again in a few minutes. <!-- /.section --> Cloudflare Ray ID: 57cbb2415bbefdb1 &bull; Your IP: [IP address] &bull; Performance &amp; security by Cloudflare <!-- /.error-footer --> <!-- /#cf-error-details --> <!-- /#cf-wrapper --> 

This appears to be Cloudflare’s 502 Bad Gateway error response.

I don’t understand enough of what’s going on under the hood to figure out why updating my plugins would trigger a 502. Could anyone please help me troubleshoot this so that I can successfully update installed components via the WordPress admin dashboard?

Thank you in advance.

Wordpress does usually update without issues.
And having a 502 with wordpress means that the php-fpm service is down. Which hardly happens with plugins.

Are you able to identify which plugin does trig that 502 ?

There’s nothing specific under the hood when you upgrade wordpress from its admin panel. That’s just wordpress working there.

Are you able to identify which plugin does trig that 502 ?

I’ve seen the error with:

  • Akismet
  • Child Theme Generator
  • WP-Optimize

The error looks like this:

As it turns out, many other plugins and themes are failing to update for a different reason: they’re giving me errors like this: “The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.”

I expect the permissions error is a different error, and related to the fact that I copy-pasted a lot of content from my old host to my YunoHost server without changing ownership or permissions. I’ll create a separate issue for that, because I’m also unsure what the right way to fix it is–but it seems unrelated to the 502.

I am still perplexed by the 502.

That’s probably what you should fix in the first place. Wordpress can’t upgrade anything without the permission to write into its own directory.

The easy way to do it is simply to force an upgrade of the package. It will fix the permissions.
If you do not have a pending upgrade, you can force an upgrade with the following command:

sudo yunohost app upgrade wordpress -u https://github.com/YunoHost-Apps/wordpress_ynh
1 Like

That makes sense. I’m trying to force an upgrade now and I’ll see if that resolves the issues.

Thank you!

It’s all shiny over here–forcing the upgrade worked, and now all my updates are properly going through. Green checks as far as the eye can see. :white_check_mark:

Thank you again!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.