Support » Fixing WordPress » 502 Bad Gateway, 503 Service Unavailable Errors Galore

  • (BACKGROUND: I launched a website for a client late spring. I went in two days ago to update plugins, WooCommerce to latest version, and to install additional plugins to enhance their WooCommerce reporting capabilities.
    Everything went fine after updating. All pages were clickable, and the shop carried an order all the way through purchase.
    Yesterday, approximately 27 hours after updating, I received a call from my client saying “The site is down.”
    I checked, and when accessing the site’s front or backend, I’d either get 502 Bad Gateway, 503 Service Errors, or the browser would hang waiting for a response.
    I called GoDaddy. It’s not them. They did however deactivate all active plugins (except for WooCommerce). The site then could load again. We then reactivated the deactivated ones, and the site is now back up.)

    So now I’m faced with the task of figuring out which of the few dozen, active plugin(s) the site contains is the offender. I’m told the issue is likely that the offending plugin(s), while creating a connection to another plugin (such as WooCommerce) is not closing the connection when the communication is over with.

    Note: I have deactivated (for now) the new plugins that may or may not have been the cause of this issue. I notified the developer, and they have replied strongly suggesting theirs are not the reason this is happening.

    How do I move forward? Do I wait for the site to bog down and ultimately crash again to find the culprit(s)? And if that’s the case, where do I start? Do I start with the plugins that have to deal with WooCommerce?

    This wasn’t an issue at all before the WooCommerce update. I can’t escape the thought that it’s tied to it in some fashion.

    Advice?!

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Did you check the sites error logs? I’d grep through for 4xx and 5xx errors.

    Thread Starter cantonjester

    (@cantonjester)

    Thank you for your reply!

    There currently isn’t a plugin that is dedicated to tracking errors.

    I guess I need to contact GoDaddy?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Not a plugin — the server’s error logs. Look on your GD control panel for some link to logs. If you can’t find it, contact GD tech support.

    Thread Starter cantonjester

    (@cantonjester)

    Thank you. I’m in a chat window with somebody there now.

    (I’ve looked and don’t see anywhere GoDaddy’s let me view error logs)

    Thread Starter cantonjester

    (@cantonjester)

    GoDaddy is saying:

    I understand, what you can do on your end is to have a plugin for error logs.
    Error log seems not available for this kind of platform.
    We can only provide the FTP logs, which is not related to your concern.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Well, yeah. GoDaddy charges more for a plan that gives you real error logs. Something to think about when your hosting is about to expire.

    You might try enabling WordPress’ own debug logs. Enable WP_DEBUG and WP_DEBUG_LOG, per the codex, and then look in wp-content/debug.log for errors that seem to relate to your nginx 5xx errors.

    https://codex.wordpress.org/WP_DEBUG

    Disable the debug defines when you’re done; that log can get pretty big pretty fast.

    Thread Starter cantonjester

    (@cantonjester)

    Before I do that….

    I downloaded/activated a PHP error log plugin (Error Log Monitor). It’s requiring me to edit the wp-config.php file, and to also create an phperrors.log file.

    Error logging is disabled.

    To enable error logging, create an empty file named “php-errors.log”. Place it in a directory that is not publicly accessible (preferably outside your web root) and ensure it is writable by the web server. Then add the following code to wp-config.php:

    ini_set(‘log_errors’, ‘On’);
    ini_set(‘error_log’, ‘/full/path/to/php-errors.log’);
    For reference, the full path of the WordPress directory is:
    /home/content/p3pnexwpnas01_data01/01/3188601/html/

    Thread Starter cantonjester

    (@cantonjester)

    I configured the PHP error log plugin.

    Basically I now wait and see as to what this collects.

    I’ll now look into enabling the WordPress debug logs as well.

    As for GoDaddy. Yeah, apparently their cPanel offering is better at this stuff. Which tells me a WooCommerce-enabled site probably needs to be on that one, if on GoDaddy at all.

    Thread Starter cantonjester

    (@cantonjester)

    OK, so I set up the PHP error log plugin, and verified that it does work. However, the site began to behave unexpectedly overnight, and there are NO errors being collected by the plugin.

    So…I just modified the wp-config file to include the following (I set the debug mode to true)

    // Enable Debug logging to the /wp-content/debug.log file
    define( ‘WP_DEBUG_LOG’, true );

    // Disable display of errors and warnings
    define( ‘WP_DEBUG_DISPLAY’, false );
    @ini_set( ‘display_errors’, 0 );

    Do I need to manually create a “debug.log” file? I couldn’t see anything in the Codex that addresses this.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘502 Bad Gateway, 503 Service Unavailable Errors Galore’ is closed to new replies.