Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Cron /usr/bin/php /api/cron.php

PHP Warning:  mysqli::query(): MySQL server has gone away in /include/mysqli.php on line 192
PHP Warning:  mysqli::query(): Error reading result set's header in /include/mysqli.php on line 192
PHP Fatal error:  Uncaught exception 'InconsistentModelException' with message 'Unable to prepare query: MySQL server has gone away SELECT A1.* FROM `ost_email` A1 WHERE A1.`email_id` = '0'' in /include/class.orm.php:3134
Stack trace:
#0 /include/class.orm.php(3180): MySqlExecutor->execute()
#1 /include/class.orm.php(1771): MySqlExecutor->getArray()
#2 /include/class.orm.php(1815): ModelInstanceManager->{closure}()
#3 /include/class.orm.php(1794): CallbackSimpleIterator->next()
#4 /include/class.orm.php(1803): CallbackSimpleIterator->rewind()
#5 /include/class.orm.php(1463): CallbackSimpleIterator->valid()
#6 /include/class.orm.php(1480): CachedResultSet->fillTo(9223372036854775807 in /include/class.orm.php on line 31

Just started getting the above emails.  The server has been actively running for several years.  I updated the system to latest 1.10.1 on Centos 7.  Based on my very limited knowledge, I see the above script is looking for the email id 0 in the ost_email table.  I have 3 emails configured with id's 1,2,3 respectively.  I have no email with the id=0 thus the error popping up.  

To solve this, can I just change my main system email which is id=3 to id=0 or is that going to mess something else up??

Any help would be appreciated.  thanks


  • There is no id 0 in any of my installations (2 production and 3 tests).  A quick check by looking at the other tables that have an index and none of them start with a 0 either.

    I think that its getting a zero because of the error that you skipped over... 
    "PHP Warning:  mysqli::query(): MySQL server has gone away in /include/mysqli.php on line 192"
    which then caused the next query to not have a value for id.

    Googling this error lead me to this:

    Where someone recommends "All I had to do was add mysqli.reconnect = "1"to my php.ini."

    If it were me I would try that.
  • I tried it and I still get the same error messages.  

    I found

    It looks like the issue got closed but no resolution listed. 
  • try creating a record 0 and see if it lets you (I dont think that it will).  But even if it does fix this, I think that your bound to continue to have issues since the mysql server should not go away...
Sign In or Register to comment.