Could not parse the buffer (and dissable Streaming)
-
Today, I had a lot of issues with my WordPress. Deactivating the ai-engine-pro plugin got it working again.
However, the chatbots are not functioning.I get the error: “Could not parse the buffer.”I disabled the “Streaming” mode as suggested in other threads, but it didn’t make a difference…I have no PHP error logs… It’s empty.
Can you help me?
-
For info, the plugin seems to be causing issues with my WordPress site (Neve theme). Sometimes I get this message: Error establishing a database connection. my website : http://www.yiaho.com
Last message to get all the information:
I deactivated the plugin from my cPanel (otherwise my site crashes).
I reactivated the plugin, reset a chatbot, and got this error message:”data is not defined”-
This reply was modified 10 months, 2 weeks ago by
pasqua200.
Sorry to insist, but my issue has been ongoing since 11 AM… no one is responding on Discord…
To add some details: I’m getting a “database connection error.” In PhpMyAdmin, I noticed that there are over 2,000,000 discussions in wpf3_mwai_chats.Could that be the problem?Hi @pasqua200,
Hmm, this doesn’t sound like it has anything to do with AI Engine, to be honest. I’ve never seen this kind of issue before, and I doubt the Discord folks can help either, since it seems totally off-topic. The best thing is to disable all your plugins, then try turning them back on one at a time. Don’t just turn off AI Engine, or you won’t really know what’s causing the trouble. Also, check your PHP Error Logs (I didn’t see anything in there myself, but maybe you will!). And don’t forget to share your PHP version and other setup info. I think you’re dealing with a bunch of different problems all tangled up together, so it’s best to tackle them step by step. Start with the PHP Error Logs 😉
Hello,
Thank you for your response. However, I believe the issue is directly related to AI Engine Pro, and I’d like to clarify with specific details. Here’s the context and errors encountered:- Errors observed:
- JavaScript error: “Uncaught ReferenceError: data is not defined” in /wp-content/plugins/ai-engine-pro/assets/js/chatbot.js:2.
- HTTP error: POST https://www.yiaho.com/wp-json/mwai-ui/v1/chats/submit 500 (Internal Server Error).
- MySQL error: #2006 – MySQL server has gone away when attempting TRUNCATE wpf3_mwai_chats via phpMyAdmin.
- Current error: “Unable to select database mhkx7964_wp637”, making my site inaccessible.
- Context:
- The errors occur when testing the chatbot in AI Engine > Chatbots or Discussions, with approximately 300,000 chats in the wpf3_mwai_chats table. My host (o2switch) reported SQL saturation due to slow queries like SELECT COUNT(*) FROM wpf3_mwai_chats WHERE userId = 0, running in parallel (up to 15 queries, lasting 34–42 seconds).
- The wpf3_mwai_chats table is managed by AI Engine Pro, and the /wp-json/mwai-ui/v1/chats/submit endpoint is part of your plugin. The table’s overload likely causes the HTTP 500 error, which leads to the JavaScript error (the script expects a data variable that isn’t returned).
- Configuration:
- WordPress: 6.8.2
- PHP: 8.1.32
- Theme: Neve 4.1.2
- Host: o2switch
- Plugin: AI Engine Pro (recently reinstalled)
- Database: mhkx7964_wp637, table wpf3_mwai_chats (~300,000 entries)
- Actions taken:
- Reinstalled WordPress and AI Engine Pro.
- Verified permissions (644 for files, 755 for directories).
- Attempted TRUNCATE wpf3_mwai_chats, which failed with error #2006. Now trying to delete chats in batches (DELETE … LIMIT 5000).
- Contacted o2switch to restore database access and adjust MySQL settings (wait_timeout, innodb_buffer_pool_size).
- Enabled debug mode, but cannot access the site to check /wp-content/debug.log yet.
- Observations:
- The SQL saturation is tied to wpf3_mwai_chats, suggesting AI Engine Pro struggles with large chat volumes.
- The HTTP 500 on /wp-json/mwai-ui/v1/chats/submit and JavaScript error in chatbot.js directly point to your plugin.
- The #2006 error and database inaccessibility are likely consequences of the SQL overload caused by slow queries.
Questions:
- Is there a known bug in AI Engine Pro for handling large tables like wpf3_mwai_chats (~300,000 entries)?
- Can the /wp-json/mwai-ui/v1/chats/submit endpoint fail (HTTP 500) due to high chat volumes? If so, what optimizations do you recommend?
- Is there a fixed version or settings to limit the impact of archived chats (e.g., pagination or automatic cleanup)?
- Can you suggest a method to clean wpf3_mwai_chats without triggering error #2006?
I’m working with o2switch to restore database access and reduce SQL load. Can you confirm if AI Engine Pro is involved and provide specific recommendations? I’ve attached the console details and o2switch SQL logs for reference.Thank you for your help!
Hi,
TRUNCATE only happens when you manually delete discussions. If you’re trying to remove a large number at once, it’s better to delete them gradually or use the dedicated button that clears everything in a single query. You can also do it manually by clearing the related entries directly in the database. To be honest, your MySQL server might be running slowly. A query like “SELECT COUNT(*) FROM wpf3_mwai_chats WHERE userId = 0” should be very quick, even with 300,000 entries. Nine has similar numbers and works instantly.
If needed, you can create some custom code to regularly clean up old data (ChatGPT can help with that).
If you’re getting 500 errors, the PHP Error Logs are your best (and in this case, only) friend. They’re essential to understanding what’s going wrong. Also, if you’re still using PHP 7.4, that might be part of the issue. I try to keep things compatible, but most hosting providers now run PHP 8.x, which is what I use too.
No, I’m using PHP: 8.1.32.
For your information, the site is working again, and the only action I took was deleting the 2 million chats from my database. Could that have been the issue?Everything’s possible, yeah! 🙂 But maybe adding an index on
userIdin thediscussionstable could be a good idea. It might speed things up a lot when the table gets big, and honestly, it could help avoid this issue for a long time… maybe even for good!Thank you for your feedback 🙂 Can we add it from the plugin? Thanks again for your help and patience.
Hi @pasqua200,
Just released version 2.9.3! Based on our chat, I added a new feature: a button to optimize the database with indexing and cleanup! Make sure Dev Tools are enabled (Settings > Others > Advanced). Once that’s on, you’ll see a new tab with an Optimization section. Just hit the Optimize Database button there 🙂 Hope it helps!
-
This reply was modified 10 months, 2 weeks ago by
The topic ‘Could not parse the buffer (and dissable Streaming)’ is closed to new replies.