What is the current behavior?
Plugins which rely on admin-ajax.php in the admin dashboard (Appearance --> Widgets) are not working.
What is the expected or desired behavior?
Being able to use the admin dashboard for plugins which rely on admin-ajax.php
On development (Vagrant) the admin-ajax.php script seems to be broken or otherwise inaccessible
This is the server response when a plugin tries to access _https://example.dev/wp/wp-admin/admin-ajax.php_:
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
This looks like some sort of issue with nginx.
Please describe your local environment:
Ansible version: 2.1.0.0
OS: Ubuntu 16.04 x64
Vagrant version: 1.7.4
Where did the bug happen? Development or remote servers?
Development
Please provide a repository or your wordpress_sites config (if possible):
wordpress_sites:
example.com:
site_hosts:
- example.dev
- example2.dev
local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
site_name: Example Site
admin_email: [email protected]
multisite:
enabled: true
subdomains: true
ssl:
enabled: true
provider: self-signed
cache:
enabled: false
env:
domain_current_site: example.dev
wp_home: https://example.dev
wp_siteurl: https://example.dev/wp
Awesome! Not a awesome bug but awesome that I am not alone with this bug. 馃槅
Have had this issue for a while (on different sites but with the same environment/version. I have failed for some time to find the cause of the issue. But it seems to be related to some plugins running on development (Vagrant) box.
For me it happens in wp-admin on all pages that has the grid view of the media gallery. I.e. under Media or every edit screen where I attach/upload/edit images.
It happens if both Advanced Custom Fields and Query Monitor plugins are activated. If I deactivated either of these plugins the issue stop. _This bug does not appear on staging/production environment with the same plugin configuration._
Are you using any of these plugins as well or any other plugins that's causing this issue for you?
I hope this information helps someone reproduce this issue and find a solution.
For me it happens with WordPress Meta Data & Taxonomies Filter, when adding their widget.
And indeed the bug does not occur on production & staging environments.
Really strange that it's only happening on development, but I figured out what's going on.
@vercotux thanks for the good bug report but always remember to check logs too :)
In /srv/www/example.com/logs/error.log:
2016/07/08 03:10:58 [error] 7744#7744: *100 upstream sent too big header while reading response header from upstream, client: 192.168.50.1, server: example.dev, request: "POST /wp/wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.dev", referrer: "https://example.dev/wp/wp-admin/widgets.php"
I tried bumping nginx_fastcgi_buffer_size to 8k and it fixed the issue.
It's a bit of a guessing game with these values but we might have to bump that value permanently.
Most helpful comment
Really strange that it's only happening on development, but I figured out what's going on.
@vercotux thanks for the good bug report but always remember to check logs too :)
In
/srv/www/example.com/logs/error.log:I tried bumping nginx_fastcgi_buffer_size to
8kand it fixed the issue.It's a bit of a guessing game with these values but we might have to bump that value permanently.