|
/ Documentation /SureRank AI Guide/ AI Generation Fails or Shows “Not a Valid JSON Response”

AI Generation Fails or Shows “Not a Valid JSON Response”

AI generation (content, meta descriptions, or image alt-text) can occasionally fail with a timeout message or a “not a valid JSON response” error. In most cases this is a temporary timing or transport issue, not a problem with your site’s configuration, and not related to AI credits or your license.

Why This Happens

1. A timing mismatch between your browser and the server

AI requests (content generation and image alt-text) run through a shared process that gives the AI service up to 30 seconds to respond. Your browser, however, only waits about 15 seconds for a response from SureRank before giving up. If the AI takes between 15 and 30 seconds, which is common for content or image generation, your browser times out and shows an error before the actual result comes back from the server.

2. A non-JSON response triggers a misleading error

If anything other than valid JSON is returned, for example a security plugin or firewall blocking the request and returning its own warning page, or a PHP notice printed on the page before the JSON, SureRank shows:

“A security plugin or firewall is blocking SureRank’s request.”

This message appears any time the response isn’t valid JSON, not only when a firewall is actually the cause, so it can be misleading.

3. This is different from a credit or license limit error

If the message instead mentions upgrading, running out of credits, or a usage limit, that’s a licensing issue, not this timeout or JSON issue. See the AI licensing troubleshooting article instead.

Steps to Resolve

  1. Note the exact error message. Was it a timeout, “not a valid JSON response,” or an upgrade/limit message? This determines which fix applies.
  2. Retry the generation. Since this is usually a timing race, a second attempt often succeeds right away.
  3. Temporarily disable security or firewall plugins (or allowlist the site’s own REST API path), then retry.
  4. Check for plugins printing extra output on admin pages, such as stray warnings or notices, often from a caching or debug plugin conflict. Disable other plugins one at a time to isolate the culprit.
  5. If the error mentions credits or a license limit, this is a separate issue. Refer to the licensing troubleshooting guide instead of the steps above.

If That Doesn’t Work

If retries consistently fail with the same non-JSON or timeout error after ruling out security plugins and output conflicts, contact the support team with the exact error text and steps to reproduce.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top