Error uploading images to wordpress blog

wordpress

#1

everytime I try to upload an image to my wordpress blog, I get this error: “Http Error”. Extremely unhelpful.
I checked in the error logs and I see this:

[Thu Oct 05 13:10:03 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRm0BaMMAAAAMlTAwAAAAB"]
[Thu Oct 05 13:10:04 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRnEBaMMAAAAvDgMwAAAAJ"]
[Thu Oct 05 13:10:04 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRnEBaMMAAACvOpL0AAAAG"]
[Thu Oct 05 13:10:04 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRnEBaMMAAADXj2WIAAAAI"]
[Thu Oct 05 13:10:04 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRnEBaMMAAAAvEgUAAAAAL"]
[Thu Oct 05 13:10:04 2017] [error] [client 157.7.104.90] ModSecurity: Access denied with code 418 (phase 1). Pattern match "(?i:(sleep\\\\((\\\\s*?)(\\\\d*?)(\\\\s*?)\\\\)|benchmark\\\\((.*?)\\\\,(.*?)\\\\)))" at ARGS:social_controller. [file "/dh/apache2/template/etc/mod_sec2/99_dreamhost_rules.conf"] [line "326"] [id "1990090"] [msg "Detects blind sqli tests using sleep() or benchmark()."] [hostname "blog.kevingoldsmith.com"] [uri "/page/189/"] [unique_id "WdaRnEBaMMAAAHj8Et4AAAAC"]
[Thu Oct 05 13:56:41 2017] [error] [client 4.16.147.234] Premature end of script headers: async-upload.php, referer: http://blog.kevingoldsmith.com/wp-admin/post.php?post=8862&action=edit

Everything is up to date, and this just started happening today. Any ideas?


#2

It looks like DreamHost’s Web Application Firewall (WAF) is detecting something unusual in your WordPress installation. Were you ever able to upload anything or is this error a recent thing? If it’s a recent thing, have you installed new plugins, changed theme or something else that may have affected your site?

If you’re sure you haven’t modified anything and this error started out of the blu for no apparent reasons, I’d suggest you to open a ticket as soon as possible.


#3

I was uploading four images, the first uploaded fine, the other three failed. Then every upload after that failed. I just tried again. I uploaded one file with no issues, then tried to upload two at once, now again nothing will upload without error. I will file a ticket.

thanks!


#4

Note that the regular error logs only show errors from Apache, not PHP. So, those ModSecurity messages are from an Apache security rule that DreamHost setup to protect all web sites. It may just be a coincidence that they appear 40 minutes before the failed upload, although they could indicate that attacks are bogging down WordPress.

The “Premature end of script headers: async-upload.php” means that Apache tried to run WordPress’s upload PHP, but PHP unexpectedly failed. Apache doesn’t know the exact reason PHP failed – could be file size limits, permissions, process overload, etc, etc.

To record PHP errors (if there are any), you’d need to configure PHP logging via the php.ini (php.rc) file. This is the configuration I usually use for production sites (replace user with your user-name):

display_errors = 0
error_reporting = E_ALL | E_STRICT
log_errors = 1
error_log = "/home/user/php.log"

Flipping display_error to 1 will make PHP show errors in the browser, which is useful for live debugging.


#5

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