x

Main chapters

  1. Get started
  2. Workspace
  3. Editor
  4. Question types
  5. Share
  6. Results
  7. Configuration
  8. Installation and updates
  9. Profile and personal settings
  10. Account and billing
  11. FAQs
  12. Development
 Actions

Hit a 400 or 500 error? What to do

From LimeSurvey Manual

About these errors

Sometimes your survey site shows an error such as 400 Bad Request, 500 Internal Server Error or a message about a CSRF token, for example while you save a question, open the editor or add participants.

On LimeSurvey Cloud the cause is usually on the platform, not something you did, and there is no setting that fixes it. Your part is to tell support.

On a self-hosted installation the cause is usually in the server configuration, in a plugin or theme, or in a bug. The error message and the server logs tell you which.

Try this first

  1. Reload the page.
  2. Try another browser, or a private window.
  3. Wait a few minutes and try again.
  4. Log out and log in again. A CSRF error often means that your session has expired.

If the error comes back, go on with the next section.

Contact support

Many incidents are fixed quickly for all survey sites. If the error comes back, contact support as described in Get support and include:

  • the exact error text, or a screenshot,
  • what you did, step by step, when the error appeared, for example "I opened survey 123456, clicked question 3 and the error showed",
  • the survey ID,
  • your browser, for example Chrome, Firefox or Safari.

What happens next

  • Support may ask for your written consent to access your survey site. A reply such as "I agree" is enough. You never share your password.
  • The engineers usually fix the problem on the server.
  • When it is fixed, support asks you to try the same action again and confirm.

An error caused by a custom theme may need an engineer to repair your survey site.

Find the cause

See the full error message

By default LimeSurvey shows only a short error page. To see the full message, open application/config/config.php and set 'debug' => 1 in the 'config' array (2 shows even more detail). Repeat the action that caused the error. Set the value back to 0 when you are done, because the messages can show details of your server to everybody. See Development and debugging.

Check the server logs

If the page stays empty or shows no details, look at the error log of your web server and PHP. Where it is depends on your server; on shared hosting you usually find it in the control panel of your hosting provider.

Common causes

Message Cause and fix
The CSRF token could not be verified. Your session has expired, or your browser blocks the cookies of the site. Log in again and allow cookies for the site. If the survey runs in an iframe on another website, see Allow usage of session and CSRF validation in iFrame.
The data received seems incomplete. This usually happens due to server limitations (PHP setting max_input_vars). The form you saved has more fields than PHP accepts. Raise max_input_vars in your php.ini, for example to 5000, and restart the web server.
The requested hostname is invalid. The address you used is not in application/config/allowed_hosts.php. Add the host name there, or check the publicurl setting.
500 Internal Server Error after an upgrade or after you activated a plugin A plugin or theme isn't compatible with your LimeSurvey version. Deactivate the plugin, or switch the survey to a core theme, and ask its developer for an update. See Upgrade from version 6 to 7.
500 Internal Server Error with "Allowed memory size exhausted" in the log PHP ran out of memory, for example on a large export or statistics. Raise the memory limit, see Resources.

Report a bug

If you think the error is a bug in LimeSurvey, report it in the bug tracker, or ask in the forum. Include the full error message, the steps that cause it, and your LimeSurvey, PHP and database versions. As a superadministrator, click the version number in the footer of the administration to see them.

FAQ

Did I break something?

Almost never. These errors usually come from the platform, not from what you did.

Should I try again and again?

Try the steps in Try this first once. If the error comes back, don't repeat the action: contact supportlook for the cause instead.

See also