ErrorException: Undefined index: thread_read_date - library/XenForo/ControllerPublic/Thread.php:676

After running for a long time without any error. Recently, I got many errors likes that:

ErrorException: Undefined index: thread_read_date - library/XenForo/ControllerPublic/Thread.php:676

Stack Trace
#0 /home/ XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/mydomain....', 676, Array)
#1 /home/ XenForo_ControllerPublic_Thread->_getNewPosts(Array, Array, 1413561309, 3)
#2 /home/ XenForo_ControllerPublic_Thread->actionAddReply()
#3 /home/ sonnbUpThread_ControllerPublic_Thread->actionAddReply()
#4 /home/ EWRporta2_ControllerPublic_Thread->actionAddReply()
#5 /home/ XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/ XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
  ["url"] => string(129) ""
  ["_GET"] => array(1) {
    ["/threads/nhan-mua-hang-tu-my-gia-re-free-cong-mua-amazon-phi-ship-9-99-kg-bao-hai-quan_339456/add-reply"] => string(0) ""
  ["_POST"] => array(9) {
    ["message_html"] => string(145) "<p>cho m xin gia e nay ve ha noi nhe&nbsp;;</p>"
    ["_xfRelativeResolver"] => string(120) ""
    ["attachment_hash"] => string(32) "f725b2f0f5f71282b175689daf505235"
    ["last_date"] => string(10) "1413561309"
    ["last_known_date"] => string(10) "1427685867"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(94) "/threads/nhan-mua-hang-tu-my-gia-re-free-cong-mua-amazon-phi-ship-9-99-kg-bao-hai-quan.339456/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"

Chris D

XenForo developer
Staff member
This is likely down to an add-on. Several are mentioned in the stack trace.

First step is to try and reproduce the issue with all add-ins disabled.


XenForo developer
Staff member
It may also be opcode cache corruption as we've seen before. Restarting the web server may help.

Tracy Perry

Well-known member
That's not the only add-on that was listed. EWRporta2 was also in that stack trace. Try disabling it and see if the error resolves itself.


Well-known member
XenPorta2 does nothing with this variable either; nor does it replace any existing variables in the Add-Reply function.


Well-known member
Do you have defined any caching in config.php? If so, you might want to restart your webserver and see if that solves your problem. If it doesn't, disable all add-ons and try again. If the problem still happens, it might be a database corruption issue.
I run caching
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
        'caching'                       => true,
        'cache_id_prefix'               => 'xf1_',
        'automatic_serialization'       => true,
        'lifetime'                      => 1800

$config['cache']['backend'] = 'Libmemcached';
$config['cache']['backendOptions'] = array(
        'compression'   => false,
        'servers'       => array(
                        'host'          => 'localhost',
                        'port'          => 11211,
                        'persistent'    => true,
                        'weight'        => 1
And I tried to restart my server, but it does not help!

I tried to disable UpThread addon and verything runs smooth. Thanks so much for your helps!