How-To

Mautic 500 "Uh oh! I think I broke it." on form submit: fix

The Mautic message `500 Internal Server Error ("Uh oh! I think I broke it.")` is a generic page hiding a PHP or database exception. Read the Mautic log and your web server's error log to find the real cause; then clear the cache, fix permissions, run migrations, or repair the failing form action.

Sohail HussainSohail Hussain9 min read

Short answer

  • The 500 page says only that Mautic threw an exception; the cause is in the log entry written when you submitted the form, so read that first.
  • The usual culprits are stale cache or permissions, a database schema that lags the code, a form action (often email) that fails, or a firewall rule blocking the POST.
  • Clear the cache as the web user, run pending migrations, then disable the form's email action to see whether it is the trigger.

You submit a Mautic web form and the browser lands on this instead of a thank-you message:

500 Internal Server Error ("Uh oh! I think I broke it.")

People on the Mautic community forum report this exact symptom after creating a form and trying to send it. The threads I checked describe the problem but do not show one confirmed resolution, so this page is a diagnostic path, not a single magic setting. I can't promise one cause fits every install.

Why it happens

"Uh oh! I think I broke it." is Mautic's production-mode error page. It appears for any unhandled server-side error, so the text is identical whether the cause is a database problem, a PHP fatal error, a bad plugin or a mail failure. The 500 status tells you the server failed, not why.

Causes, roughly from most to least common:

  1. Stale cache or a cache and log directory the web user can't write to, usually after an upgrade, a restore or a change of server user.
  2. A database schema that does not match the code, typically right after an upgrade, or a missing results table for one specific form.
  3. A form action that throws, such as an email action when the mail transport rejects the connection or credentials.
  4. PHP limits, a missing extension or an unsupported PHP version.
  5. A WAF, ModSecurity rule or proxy that returns the 500 before Mautic ever sees the request.

One quick split helps. If the 500 happens only on form submit and the rest of the admin works, suspect something form-specific: the results table, an action, or a rule in front of Mautic. If the whole site returns 500, suspect cache, permissions, PHP version or a failed upgrade.

Find the real error first

Change nothing yet. Submit the form once, note the exact time, then check these in order.

  1. Open Mautic's own log. On a standard install, look in var/logs/ under your Mautic root for the latest mautic_prod file, and search for CRITICAL or ERROR near your timestamp.
  2. Open the web server error log and the PHP-FPM log (Apache or Nginx). Fatal errors such as memory exhaustion or a missing PHP extension often land there and not in Mautic's log.
  3. If neither log has an entry at your timestamp, the request probably never reached Mautic. Something in front of it is returning the 500.

Hosts and Docker images sometimes move these paths. If you can't find them, ask your host where PHP errors are written.

Test from the preview page

Submit the same form from Mautic's own preview page and from your embedded copy. If only the embedded copy fails, you are looking at a firewall, cross-origin or embedding problem, not a Mautic bug.

Step-by-step fixes

Fix 1: clear the cache and repair permissions

The log usually shows a failure to write a file or create a directory under var/cache or var/logs.

  1. Find which user runs PHP (often www-data). Run the commands below as that user, not root, so new cache files aren't owned by root.
  2. From your Mautic root, clear the cache:
sudo -u www-data php bin/console cache:clear
  1. Make sure that user owns the cache and log directories:
sudo chown -R www-data:www-data var/cache var/logs
  1. Adjust the user and group to match your server, then submit the form again.

Fix 2: run pending database migrations

If the log shows a Doctrine or SQL error such as a missing table or unknown column, the database doesn't match the code.

  1. Back up the database first.
  2. From the Mautic root, run the migrations as the web user:
sudo -u www-data php bin/console doctrine:migrations:migrate --no-interaction
  1. Clear the cache again (Fix 1, step 2).

There is a form-specific variant. Mautic stores each form's submissions in its own results table. If the log names a table starting with form_results_ that doesn't exist, the form may have been imported, cloned or restored without it. Re-saving the form in the builder is the first thing to try. If the table is still missing, restoring from a backup is safer than creating it by hand.

Back up before migrating

Migrations change your database structure and can't be undone with a click. Take a database backup before you run them, especially on a production install.

Fix 3: isolate a failing form action

Forms can run actions after submission, such as sending an email. If an action throws, for example because the mail transport refuses the connection or credentials, the exception can surface as a 500 even though the submission itself was valid.

  1. Open the form in Mautic and note the actions listed in the form builder.
  2. Temporarily disable the action that sends email, save the form and submit again.
  3. If the 500 disappears, the mail setup is the problem. In Mautic's Configuration, review the email settings, then confirm your SMTP host, port, encryption and credentials with your mail provider.

Our explanation of SSL/TLS for SMTP covers the port and encryption pairs behind most connection failures. Re-enable the action once mail works, and test again.

Fix 4: check PHP limits, extensions and version

Look in the log for "Allowed memory size exhausted", "Call to undefined function" or a missing-extension message. Supported PHP versions depend on the Mautic release, so compare your server's version with the requirements in the documentation for your exact Mautic version. Raise memory_limit only if the log actually shows memory exhaustion; raising it blindly hides nothing and fixes nothing.

Fix 5: rule out a firewall or security rule

If Mautic's log is silent, test the submission from a different network, or temporarily disable ModSecurity or your CDN's WAF rules for the form path. Forms embedded on other sites send a cross-origin POST, and some rule sets treat those as attacks. If the 500 vanishes, ask your host which rule fired and write a narrow exception for it rather than leaving the firewall off.

Match the log to the cause

What the log showsLikely causeFix
Permission denied, cache directoryStale cache or ownershipFix 1
Table or column not foundSchema out of dateFix 2
form_results_ table missingForm restored without its tableFix 2, re-save form
SMTP, transport or mailer exceptionFailing email actionFix 3
Memory, undefined function, extensionPHP limits or versionFix 4
Nothing in Mautic's logFirewall or proxyFix 5

Checklist before you try again

  • You read the log entry from the exact time of the failed submit.
  • Cache was cleared as the web user, not root.
  • var/cache and var/logs are writable by the PHP user.
  • Migrations ran with no errors, after a backup.
  • The form works with its email action disabled, or the mail settings are confirmed.
  • The preview page and the embedded form behave the same.

If nothing works

Ask the Mautic community forum or your host, and include:

  • Your Mautic and PHP versions, and how it is hosted (shared host, VPS, Docker).
  • The exact log lines around the submit time, with passwords and tokens removed.
  • Whether it happens for every form or just one, and whether it also fails from the preview page.
  • What you already tried from this page.
Subject: 500 error on Mautic form submit ("Uh oh! I think I broke it.")

Mautic version: {version}
PHP version: {version}
Hosting: {shared host / VPS / Docker}

Submitting a web form returns:
500 Internal Server Error ("Uh oh! I think I broke it.")

Time of the failed submit (with timezone): {timestamp}
Log lines at that time (secrets removed):
{paste lines}

Happens on: {all forms / one form}; preview page: {fails / works}
Already tried: cache:clear as the web user, permissions on var/cache and var/logs,
migrations, disabling the form's email action.

Common questions

Why does the page say "I think I broke it" instead of the real error?

It is the generic production error page, designed not to expose internals to visitors. The details go to the log, which is why reading the log comes first.

Does the 500 mean my submission was lost?

Not necessarily. If the failure happens in a form action after the data is saved, the submission may exist in the form's results. Check the form's results in Mautic before asking people to resubmit.

Should I turn on debug mode to see the error?

Only on a staging copy or briefly, because debug output can expose paths and configuration to visitors. The production log normally holds the same exception without that risk.

Can I prevent this after upgrades?

Back up the database and files first, run migrations and clear the cache as the web user right after, and submit a test form on a staging copy before touching production.

strategymauticerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free