Skip Navigation

[Resolved] 500 and 404 Errors from Page with CRED

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 18 replies, has 3 voices.

Last updated by jesseB-4 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#903115
kds-screenshot.jpg

Hello,

We are using CRED to update and display a kitchen display screen (KDS) built using Toolset. We're getting console errors which read POST 500 (Internal Server Error) and POST 404 (Not Found) only on this page. The WP backend sporadically suffers from Internal Errors as well. This started once we migrated Toolset from our production site.

We managed to resolve some other errors coming from outdated plugins, mismatched site registration and conflicting plugins, so perhaps these are related?

Here is the link to the page: hidden link

#903118

Hi, I'll be glad to take a look. First, let's try to narrow down the source of the problem.
- Temporarily deactivate all plugins except Types, Views, Layouts, CRED, and any WooCommerce plugins needed to create these Orders. If you need to activate a Maintenance Mode plugin that's fine.
- Temporarily activate a default theme like Twenty Seventeen. Test again.
- If the problem was resolved, reactivate your parent theme, then child theme, then plugins one by one until the conflict is revealed.
- Turn on server logs to get some more information about what's failing. If you're not familiar with server logs, I can show you how to activate them temporarily. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Reload the page that causes a 500 error. This will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.

Let me know what you find out and we can go from there.

#903878

Hello and thanks Christian! Unfortunately our clients can't afford us temporarily deactivating themes and plugins on their live site at the moment. I went ahead and turned on the server logs and here is what I got.

[25-May-2018 13:21:37 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/pantry2018/public_html/wp-includes/functions.php on line 4147
[25-May-2018 13:21:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/pantry2018/public_html/wp-includes/functions.php:4147) in /home/pantry2018/public_html/wp-content/plugins/ByConsoleWooODTExtended/ByConsoleWooODT.php on line 599
[25-May-2018 13:21:45 UTC] PHP Notice:  Undefined variable: store_close_notice in /home/pantry2018/public_html/wp-content/plugins/ByConsoleWooODTExtended/ByConsoleWooODT.php on line 11891
[25-May-2018 13:21:45 UTC] PHP Notice:  Undefined variable: byconsolewoodt_disable_date_array in /home/pantry2018/public_html/wp-content/plugins/ByConsoleWooODTExtended/inc/exclude/exclude_shipping_holidays.php on line 63
[25-May-2018 13:21:45 UTC] PHP Notice:  Undefined variable: closing_monday in /home/pantry2018/public_html/wp-content/plugins/ByConsoleWooODTExtended/inc/exclude/exclude_shipping_holidays.php on line 102

...and repeating.

What I gathered is there is an incorrect wp_enqueue_script function as well as some undefined variables from the plugin WooODT Extended? Is that correct? Let me know if you need the entire error_log.txt.

#904527

Hmm, I don't see anything in this log that indicates a 500 error. Warnings and notices shouldn't be causing 500s. If you can't run the tests on your live site, I'll need to work on a site clone. I can log in to your wp-admin area and use the Duplicator plugin to create a clone of your site, then install it locally to try to reproduce the errors. If that's okay with you, please provide login credentials in the private reply fields here.

If that's not okay, the other options are:
- You create a Duplicator clone and provide a download link for me
- You create a zip backup of your site's plugins and themes folders, as well as a SQL dump file from your database

#905195

Sure, can you please provide me with an email address to create an account?

#905209

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jesse,

Christian is currently on holiday today but will be here tomorrow to continue here.

Regarding the duplicator package you don't need to create an account as when the duplicator is being restored locally on Christian's server then he is able to create an account there.

Also I've enabled the private fields for you to provide the duplicator package.

Thanks,
Shane

#905688

Oh we were sending messages at the same time - I'll download the package and get to work. Thanks!

#905711

I'm not able to recreate these 404 and 500 error calls to admin-ajax.php on my local clone of the site, so there must be something else going on. Do these errors appear after performing a search in the custom search View, or after submitting the CRED form, or are there other specific steps I should take? After performing a search I see an alert popup that the JS has been reset.

Check out the file error_log (not error_log.txt, which we created) in the root directory of your site. It looks like this error log has been up and running for a while, and I'm able to see quite a few 500 errors in here. Most recently they seem to be related to the X theme's WooCommerce files:

PHP Fatal error:  Uncaught Error: Call to undefined function wc_get_loop_prop() in /path/to/wp-content/themes/x/woocommerce/loop/pagination.php:13

That could certainly cause issues like you're experiencing in calls to admin-ajax.php, but again I'm not able to replicate those on my local environment. Is it possible your new host has calls to admin-ajax.php blocked somehow on the backend? If you open the Network tab in the debug console, are any calls to admin-ajax.php successful? I'm not able to tell from the screenshot you included earlier.

#905868
Screen Shot 2018-05-29 at 5.00.47 PM.png

Hello Christian, thank you for your continuous support and apologies for my delayed response,

The POST 500 errors only occurred on page load on hidden link . Nothing else is causing the errors, not updating the view or searching in the search box.

I have included a screenshot below of the Network tab. As you can see, only four calls succeeded. I think you're right, though, that our hosting server may be misconfigured. I will reach out to Hostgator again.

I've also updated our Toolset plugins today in hope it may be an outdated issue. Alas, they persisted.

#906156

Okay I will stand by for your updates on this. You should be able to find 500 error messages in one of the two error logs that correspond to each 500 failure to the admin_ajax.php file, so that might be useful to your host for troubleshooting. Let me know if there's anything else I can do to assist.

#906252

Hello Christian,

HostGator didn't found anything amiss on the server despite seeing the error logs, which has left me scratching my head thinking why not. I'm starting to seriously consider re-importing all the Toolset views and re-do everything after the migration.

Do you think if I provide you with the original exports from our production site, you can import it to your site clone to see if they cause any issues?

#906354

Sure, I can try that. I will activate private reply fields again here. Another thing I would ask Host Gator is if you can test on a different version of PHP. I have been testing on 7.1.12. It looks like your current server is on 7.1.17. That should be fine, but if it's simple to switch to something else I think it's worth a shot. Anything greater than 5.3 should be okay. I can also see that your server's MaxInputVars setting is 1000. This is a bit low, and I would ask about increasing it to 5000 if possible to prevent wp-admin issues when saving posts with lots of custom fields.

#906381

After the view updates, the "Kitchen Orders All Modal" and its relevant HTML structure disappears for some reason
I see a lot of jQuery document ready event listeners inside the js_event_wpv_parametric_search_results_updated callback. Just a quick note to be aware that this is prone to causing problems, because jQuery's document ready event doesn't get fired after an AJAX update. So you can't be guaranteed these actions will be triggered after each AJAX View update. You can safely assume that jQuery is already ready when inside the js_event_wpv_parametric_search_results_updated callback, so there is no need for any document ready handlers here. If you have more specific questions about this, please do create a separate ticket and we can discuss in more detail.

I will download the older package and take a look, then get back to you shortly.

#906390

Okay I imported these forms and Views but I'm still not able to replicate the problem locally. I am able to see that there are some 65 Views on this custom search page, which is quite heavy. Some other tests you could try:
- Limit each View to only 1 result temporarily
- Turn off AJAX updates on all these Views temporarily
- Test any nested Views independently of each other elsewhere on the site to isolate problems with any one particular View

#906401

Hello Christian,

Your suggestions to change the PHP version and max_input_vars worked! No more failing call errors!

I will see about testing the Views to see why our modal is disappearing. After the latest update from 2 days ago, our Complete Order and Revert Order post forms are also failing to update the WooCommerce order status. Since these were not the original reason for starting this ticket, however, we can close it and I'll start a new one if needed.

Thank you so much for the help! This has lessened my headache considerably!