Jump to content

Cron error: General error: 1615 Prepared statement needs to be re-prepared


Recommended Posts

Hi,

Has anyone been getting these errors? I can't seem to figure out how to get them to go away.  I've looked online and none of the fixes I've tried have worked so far.  Here is the cron error email I receive when Cron runs:

I already increased the table_definition_cache, which (just like the forums users said) only decreased its prevalence, but didn't make it go away entirely. 

I can try adding in the other parameters, but it won't make it fully go away. There's a laravel (what WHMCS is written in, I guess) PDO command that supposedly is the answer, but there's no way to add it since WHMCS has everything encrypted in ioncube. 

[Illuminate\Database\QueryException]
  SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: select * from `tbltask_status` where `tbltask_status`.`task_id` = 1 and `tbltask_status`.`task_id` is not null limit 1)



  [PDOException]
  SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared


all [-F|--force] [--email-report [EMAIL-REPORT]]

Thank you for your insight on this!

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi,

It would be helpful to know at which part of the cron.php script this error is occurring.

 

Please open your servers terminal window and run the following command 

php -q /home/username/crons/cron.php -F all -vvv

Replacing /home/username/crons/ with the path to your cron

Please provide the output for us to review.

Link to comment
Share on other sites

I also have the exact same issue. Similar to @azuregirl, increasing table_definition_cache has only reduced the occurrence of this issue, but doesn't eliminate it entirely. 

I tried running the command @WHMCS John gave via terminal, but there is no output. I must reiterate that this error occurs sporadically, not all the time so it's hard to catch the error when executing manually.

I tried modifying the cron to include the same flags hoping to catch the output the next time it occurred, but I got the same message as before, with no additional info.

 [Illuminate\Database\QueryException]
  SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: select * from `tbltask_status` where `tbltask_status`.`task_id` = 1 and `tbltask_status`.`task_id` is not null limit 1)



  [PDOException]
  SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared


all [-F|--force] [--email-report [EMAIL-REPORT]]

One of the suggested fixes I've seen others post having success with is to use the following to enable the ATTR_EMULATE_PREPARES of PDO: 

'options'   => [
                \PDO::ATTR_EMULATE_PREPARES => true
            ]

Is this something that would work for this issue with WHMCS? If so, where would we add the above code?

Link to comment
Share on other sites

Perhaps someone from WHMCS would be so kind as to respond to this post to help us further troubleshoot this issue? We are having a known issue occur, and the recommended "fix" is merely a work-around that makes the problem occur less frequently and does not resolve the error. We would like to help troubleshoot what is going on, so those of us who experience this issue have a solution. Please let us know how we can help on that front.

It would be really disheartening to see WHMCS ignore this topic and let it die without offering any resolution, as I've seen has happened with previous posts in the forum regarding this same issue. 

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi,

The modification you have suggested would require a change to a non user-modifiable part of the product.

Are you able to reproduce an error running the query directly on your MySQL server?

select * from `tbltask_status` where `tbltask_status`.`task_id` = 1 and `tbltask_status`.`task_id` is not null limit 1
Link to comment
Share on other sites

  • 2 weeks later...

So:

  1. The error occurs sporadically. Increasing table_definition_cache only reduces the frequency of the error's occurrence, but does not make it go away.
  2. This error cannot be reproduced "on the fly" either by running the cron in command line or by running the SQL query that is shown in the error.
  3. Your message suggested there would be additional output in CLI if the error occurred when running the cron in CLI.

That said, is there a way to force the verbose output (that we would potentially see in CLI) to be included with the email that is sent when the error occurs?

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated