CiviCRM 5.6.1, WordPress 4.9.8, PHP 7.1.22, MySQL 5.7.23, WordFence 7.1.16

I just started getting this error when trying to create a mailing. It happens with Mosaico and traditional mailings. I previously saw this issue when first using the WordFence security plugin and found a discussion here suggesting to disable WordFence's XSS check, which I did with success until now. That was months ago. The option is still disabled and I even tried disabling WordFence entirely, but no luck. I haven't made any significant changes recently that I can think of. I had no problems with my last weekly mailing.

I also checked with my hosting provider to see if they had made any mod_security rules changes. They hadn't. I don't see anything interesting in the logs. Any ideas?

  • I am also seeing this error on my personal dev box. It's just a linux box in my closet, not hosted. It has basically the same configuration, minus the WordFence plugin. – Mark Westergaard Nov 6 '18 at 1:38

I've run into this error for three reasons:

1: I copied and pasted in text and there was a special character in there that CiviCRM did not like. I figured out which one it was by pasting in only pieces of the text and watching to see when it quit saving and instead gave me the error.

2: I'd upgraded CiviCRM and the permissions weren't correct on some files (I'm logged in as root and therefore have to change owner/group when I upload).

3: A modsecurity issue. My host was able to look at the logs and whitelist the URI that was causing the issue. Last time it was: /civicrm/ajax/rest

  • 2
    Aha! This definitely helped.... I was failing with new, blank (no template) mailings, so I didn't think it could be #1. I hadn't upgraded since my most recent successful mailing, so I didn't think it could be #2. My dev box doesn't use mod_security, so I didn't think it was #3, but your mention of "/civicrm/ajax/rest" reminded me that I had applied a small patch for REST.php that was provided by the developers of CiviMobileAPI as a proposed fix for a login issue on WordPress. I offered to test it a few days ago and I apparently forgot to revert! That was it. Thanks! – Mark Westergaard Nov 6 '18 at 6:42
  • Yay! Glad to hear that I at least got your mind thinking in the right direction. Sometimes that's all it takes. :D – Jenni Simonis Nov 7 '18 at 0:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.