Formit error 500

Good day,

I initially migrated a website from one domain to the other, kept the same provider (godaddy). I’ve got the website up and displaying correctly, but anytime I try to use the contact form (Formit) I get an error 500.

I’ve seen people say that there have been PHP errors and thats been helpful, I believe my PHP version is good to go but it must be something else. I can’t find any errors in the error log so I’m running out of ideas. My PHP is up to date I believe (7.2).

I’m not so familiar with databases, and I know the code works correctly as it was working before the migration, so… any ideas, or trouble shooting methods I should look into? Thank you

Is there an update available for the FormIt package in Extras->Installer?

What version of MODX are you running?

Good morning Bob,

Modx is currently at v. 2.7.2, and the formit package is up to date as much as possible.

Yesterday on the original domain I moved away from I completely deleted everything, did a fresh modx install directly from cpanel, and reinstalled everything and it still gave me a 500 error. I’m using the exact same code from the website that was previously working

I suspect this may be a database issue, possibly DNS?

I’m not sure, thank you for following up

Try turning on Dev. Tools in your browser (Ctrl-shift-i).

See if there are any JS errors in the console.

Also, look at the Network tab when submitting the form. You may be able to catch a PHP error in the return to the FormIt controller or elsewhere in FormIt.

Good morning Bob,

Thanks for your input, I’m following your advice and cleaning up all errors to try and whittle down what exactly is the issue. I’ve cleaned up all errors that were in the console, and saw no errors in the network.

After fixing my errors, I checked the Error Report in the back end of modx and this is the only error left.

ERROR: cpanelusername/public_html/core/model/modx/modcachemanager.class.php : 349) Error caching lexicon topic lexicon/en/core/default

I’ve tried using different browsers, purged the old packages, and am still receiving the errors unfortunately. My devtools aren’t able to parse more than a few less files but I think thats unrelated and harmless

edit: now all errors are gone in php and devTools, except the error that pops up when I submit the contact form. A generic ‘error 500’ shows up in DevTools, I opened it and it now says “TypeError: Cannot read property ‘requestContent’ of undefined”

I’m writing this for your benefit as well as mine. I’m very ready to get this solved and will treat myself to crawfish if I do.

As you probably know, the error caching lexicon topic is unrelated.

The TypeError may or may not be. It suggests that some required JavaScript isn’t being loaded. If you can look at the line containing the error you should be able to see what comes immediately before .requestContent. That might give us a clue.

Another thing to try is to disable any plugins that might be executing for the page by right-clicking on them in the tree, then manually deleting all files in the core/cache directory before testing. If that solves the problem, you can bring them back one at a time to see which one is the culprit.

I should also mention that a lot of 500 errors are caused by a problem with the .htaccess file, so if you’ve changed anything there, that could be the issue.

1 Like

Thank you again Bob, I’ll look into this more in the morning when my brain is more refreshed.

Good afternoon all,

to those who read this in the future please consider all the troubleshooting methods we’ve been discussing.

As for what my issue ended up being it was that the Secret Key for RecaptchaV2 was missing/incorrect and gave me a default 500 error for formit.

I reached out to the developrs of Modx and they were able to very quickly sort out this issue that I spent a painful amount of time on. Thank you to Bob as always for bouncing ideas with me and offering suggestions and follow up questions.

RecaptchaV2 info

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.