Report this

What is the reason for this report?

Error when installing plugin with this setup: Cloudflare CDN/proxy -> DO Load Balancer -> WordPress app -> GlusterFS/MariaDB

Posted on October 29, 2018

I have this setup

                                                                                      GlusterFS
                                                                                     /
https Cloudflare CDN/proxy -> https DO Load Balancer -> https 2xWordPress app -> 
                                                                                     \
                                                                                      MariaDB

And sometimes when I try to install a plugin I’m getting this error

Installation failed: <!DOCTYPE html> <!--[if lt IE 7]> <![endif]--> <!--[if IE 7]> <![endif]--> <!--[if IE 8]> <![endif]--> <!--[if gt IE 8]><!--> <!--<![endif]--> example.com | 504: Gateway time-out <!--[if lt IE 9]><![endif]--> 
body{margin:0;padding:0} Error 504 Ray ID: xxxxxxxxxxxxxx &bull; 
2018-10-29 01:12:34 UTC Gateway time-out 
<!-- /.error-overview --> 
You Browser Working 
Ashburn Cloudflare Working 
example.com Host Error 
<!-- /.status-display --> 
What happened? The web server reported a gateway time-out error. What can I do? Please try again in a few minutes. 
<!-- /.section --> 
Cloudflare Ray ID: xxxxxxxxxxxxxxx &bull; 
Your IP: xx.xxx.xx.xx &bull; 
Performance &amp; security by Cloudflare 
<!-- /.error-footer --> <!-- /#cf-error-details --> <!-- /#cf-wrapper -->

I’ve checked the apache error logs and they show nothing

Taking a look at the console and network tab I see this

Request URL: https://example.com/wp-admin/admin-ajax.php
Request Method: POST
Status Code: 500 
Remote Address: <cloudflare ip>
Referrer Policy: strict-origin-when-cross-origin
Response Headers
access-control-allow-credentials: true
access-control-allow-origin: https://example.com
cache-control: no-cache, must-revalidate, max-age=0
cf-ray: xxxxxxxxxxxxxxx
content-type: text/html; charset=UTF-8
date: Mon, 29 Oct 2018 16:54:05 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expires: Wed, 11 Jan 1984 05:00:00 GMT
referrer-policy: strict-origin-when-cross-origin
server: cloudflare
set-cookie: DO-LB=node-116903061|W9c7M|W9c6v; path=/
status: 500
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-robots-tag: noindex
Request Headers
:authority: example.com
:method: POST
:path: /wp-admin/admin-ajax.php
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 134
content-type: application/x-www-form-urlencoded; charset=UTF-8
cookie: wordpress_c18fe9c2f38c6b4ae3b42f875a382700=cafevagrant%7C1540937391%7CZglMpSo9ro1x70Vg4UtewAQ9T4i7KchOEdIEvIvOndQ%7C3be346a2eb0390e9168d8068525a79634f383b3bbdf3254dff1eb02882d4d003; wordpress_sec_33c9c4bdbcb5f673bf19a4c42fa20d9a=username%7C1540943095%7CI791z8Lm6mnnd1W0qqJ69j4k6sQlQZAqwdw1hJGPs59%7C79518c472ff478f34d932e9bd0bc4a02896f7488bf3fab327884636ac2d59e4f; __cfduid=d44ad0de93291cf1a58264aff9224ce2a1540716559; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_c18fe9c2f38c6b4ae3b42f875a382700=cafevagrant%7C1540937391%7CZglMpSo9ro1x70Vg4UtewAQ9T4i7KchOEdIEvIvOndQ%7Cd5a6308149d6e080bd755ce2e5ddeaef3fc54d08f17493ccdc1c3111386956be; wordpress_logged_in_33c9c4bdbcb5f673bf19a4c42fa20d9a=cafevagrant%7C1540943095%7CI791z8Lm6mnnd1W0qqJ69j4k6sQlQZAqwdw1hJGPs59%7C5c0ccfa00d7efcee40f353c1c6c672f045d658de9b7518c519e1535475eecafa; wp-settings-time-1=1540832041; DO-LB=node-116903061|W9c7L|W9c6v
origin: https://example.com
referer: https://example.com/wp-admin/plugin-install.php?s=redis&tab=search&type=term
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.20 Safari/537.36
x-requested-with: XMLHttpRequest
Form Data
view source
view URL encoded
slug: redis-cache
action: install-plugin
_ajax_nonce: 8db3cbb6b5
_fs_nonce: 
username: 
password: 
connection_type: 
public_key: 
private_key: 

Any help would be appreciated!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

Just following up on some old unanswered questions on the site in case anyone comes across this in the future.

There are several things that could be going wrong, and it’s hard to identify the exact issue without more information. However, here are a few areas to investigate:

  1. Timeouts: A 504 Gateway Timeout Error typically means that a server that is upstream from the one you are directly connecting to did not respond in time. This could be either the DigitalOcean Load Balancer, WordPress, or even Cloudflare. You can increase the timeout settings in each of these components to see if that solves the issue. For example, in Cloudflare, you can adjust the timeout settings in your dashboard.

  2. WordPress Errors: The error message you’re seeing when trying to install the plugin could indicate a problem with WordPress itself, or with the plugin you’re trying to install. Check the WordPress error logs for more detailed information. You can enable WordPress debug mode by editing your wp-config.php file and adding the following lines:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );
    

    After adding these lines, try installing the plugin again and check the new debug log in wp-content/debug.log.

  3. File Permissions: Ensure that the file permissions for your WordPress installation are correct, and that the WordPress user has permission to install plugins. The WordPress directory should be owned by the user running the web server process, and the correct permissions are typically 755 for directories and 644 for files.

  4. PHP Configuration: Check your PHP configuration to see if there’s a problem there. For example, the max_execution_time and memory_limit settings in your php.ini file could be set too low, causing the plugin installation to time out.

  5. GlusterFS: Make sure that there are no issues with your GlusterFS setup. For example, there could be network latency or other issues causing delays in file operations.

  6. Cloudflare Settings: Check your Cloudflare settings to see if there’s a problem there. For example, Cloudflare could be caching content that it shouldn’t be, causing issues with your WordPress installation.

Remember, when making changes in your settings or configurations, it’s recommended to have backups in case anything goes wrong.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.