1

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
2

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
2

I had this issue too and the solution was a twist on Jenni Simonis's answer so I'll elaborate in case anyone else runs into it.

The specific thing that fixed it for me was granting user & group execute permissions on the wordpress file wp-admin/admin.php.

I was getting a 403 forbidden error in the JS console on this file any time CiviCRM tried to take some kind of ajax action because it was trying to post to /civicrm/ajax/rest through admin.php but didn't have the right permissions.

  • Welcome to CiviCRM.SE. The number next to a question or answer does not indicate its sequence, but the number of votes it has received; I have altered the reference in your post as a result. This is not a discussion forum, but a Q&A site, and if you are new to Stack Exchange, I would strongly recommend you take the site tour and review the help center. – choster Mar 29 at 12:18
  • thanks @choster :) – TraceElements Mar 30 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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