Intermittent error Prepared statement needs to be re-prepared

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
oorzaak
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Tue Feb 17, 2009 2:19 pm

Intermittent error Prepared statement needs to be re-prepared

Post by oorzaak » Fri Oct 08, 2021 12:46 pm

Hi,

We are developing a new site using Joomla 4. Unfortunately we have an intermittent error going on, which says:
Prepared statement needs to be re-prepared
See also attached screenshot.

Reloading the page does not solve it immediately. After a few minutes the site will be running fine again, without any actions from us.

We cannot find out any pattern behind this. I may happen when just visiting a page as a frontend user, or when working in the back end.

We've tried many things, like switching off extensions, but we didn't find a solution yet.

In the error reporting, we also see that this line is highlighted:

Code: Select all

 $template = $db->loadObject();
For your information: we cloned the Cassiopeia and made some template overrides on this clone (we like to keep our overrides outside the original core template, just in case any core updates might result in a conflict). Still, we cannot find any flaws in our clone or overrides that could explain this error. Also, the site may be running fine for an hour or more while we are working on it, and then suddenly display this error again. I would expect an error in our overrides to give a more consistent error pattern.

Hope that anyone recognizes this issue?

[edit: forgot to upload the screenshot]
Prepared_statement_needs_to_be_re-prepared__500_Whoops__looks_like_something_went_wrong__.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by imanickam on Tue Aug 16, 2022 1:31 pm, edited 2 times in total.
Reason: Moved topic » from Performance - Joomla! 4.x to Templates for Joomla! 4.x | Moved topic » from Templates for Joomla! 4.x to General Questions/New to Joomla! 4.x

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 41886
Joined: Sat Apr 05, 2008 9:58 pm

Re: Intermittent error Prepared statement needs to be re-prepared

Post by Webdongle » Tue Apr 05, 2022 2:05 pm

Does it only happen with your copy?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

oorzaak
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Tue Feb 17, 2009 2:19 pm

Re: Intermittent error Prepared statement needs to be re-prepared

Post by oorzaak » Thu Jun 30, 2022 7:48 am

For us, this issue seems to be hosting dependent. We developed the site on one hosting, then transfered it to another hosting environment for production. We do not have this issue at all on the production hosting.

However we dit not yet solve it on the develop hosting.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23883
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Intermittent error Prepared statement needs to be re-prepared

Post by pe7er » Thu Jun 30, 2022 7:56 am

oorzaak wrote:
Thu Jun 30, 2022 7:48 am
For us, this issue seems to be hosting dependent.
Are you using the same SQL database & version on the working and non-working websites? so both MySQL or both Mariadb, and both the same version?
Could compare the MySQL configuration settings?
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl (Renewed!) - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4791
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Intermittent error Prepared statement needs to be re-prepared

Post by gws » Tue Aug 16, 2022 1:04 pm

I suggest you both address @Pe7er question. There are reports of some maria DBs not playing well with mysqli.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 29278
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Intermittent error Prepared statement needs to be re-prepared

Post by Per Yngve Berg » Tue Aug 16, 2022 4:24 pm

Does it work with other connectors like pdo_mysql?


Post Reply

Return to “General Questions/New to Joomla! 4.x”