[FIXED] Recurring problem (seems like a CRON job running)

TD Perry

Member
I have gotten this twice now. No new add-ons added.

Code:
Server error log
ErrorException: [E_WARNING] Attempt to read property "TypeHandler" on null src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php:21
Generated by: Unknown account May 9, 2024 at 9:03 AM
Stack trace
#0 src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php(21): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 21)
#1 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Forum.php(92): Truonglv\Groups\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#4 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(20): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(62) "/forums/member-club-discussions.71/post-thread?group_node_id=4"
  ["referrer"] => bool(false)
  ["_GET"] => array(2) {
    ["/forums/member-club-discussions_71/post-thread"] => string(0) ""
    ["group_node_id"] => string(1) "4"
  }
  ["_POST"] => array(0) {
  }
}
 
And now I'm getting this (think it is similar to what was reported over on the XF site on the add-on discussion. I have gotten several of them.

Code:
ErrorException: [E_WARNING] Attempt to read property "TypeHandler" on null src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php:21
Generated by: Unknown account June 1, 2024 at 9:32 PM
Stack trace
#0 src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php(21): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 21)
#1 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Forum.php(92): Truonglv\Groups\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#4 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(20): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(33) "/forums/binoculars.23/post-thread"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/forums/binoculars_23/post-thread"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Code:
Server error log
ErrorException: [E_WARNING] Attempt to read property "TypeHandler" on null src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php:21
Generated by: Unknown account May 30, 2024 at 7:54 PM
Stack trace
#0 src/addons/Truonglv/Groups/XF/Pub/Controller/Forum.php(21): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 21)
#1 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Forum.php(92): Truonglv\Groups\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#4 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\RedisCache\XF\Pub\Controller\Forum), NULL)
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(20): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(38) "/forums/diy-observatory.12/post-thread"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/forums/diy-observatory_12/post-thread"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
tap tap tap..
hello...
is this thing on?

;)

Hoping to get a response here, because apparently others are getting similar errors over on the XenForo site. I try to post my support questions here as usually get a faster response.
 
Looking at the code the stack trace points to, it's called when a thread posted event (XenForo's "actionPostThread" event) was triggered by the forum. But the thread information passed to the handler is null. Doesn't seem like that should be happening, so it might not really be this addon's fault. I notice ElasticSearchEssentials addon referenced in your stack trace, and the guy who posted on the XF forums with the same error also had that addon in his stack trace; it's possible it's that addon passing on a null thread reference for whatever reason. A possibility.

If you just want a workaround so that this addon safely ignores the null thread reference (which it normally shouldn't have been sent, I'd think), you can edit "src\addons\Truonglv\Groups\XF\Pub\Controller\Forum.php", and look to line 20:
Code:
            $thread = $response->getParam('thread');
Add this line right below the line above (don't replace, add it after), so that it does a null/empty check and can safely ignore any such oddball null thread references:
Code:
            if (!$thread) { return $response; }
That SHOULD safely handle your error on the part of this addon, though again I suspect another addon (possibly ElasticSearchEssentials) may be the real source of that error, the one causing null thread references to be sent in the parameters of XenForo's "actionPostThread" event.

Of course, if you make manual changes to an addon's file like my workaround above, the file hash will no longer match and XF will warn you of this in the admin panel. A way to bypass this if you feel comfortable with having the addon's files no longer monitored for correct contents is to delete the addon's "hashes.json" file.
 
If I remember correct, Xon indicated that it was not an issue with ES Essentials add-on.
Already having to use a few other hacks for this add-on so one more in the list isn't going to kill anything.
Thanks.

But the developer really needs to get this issue resolved, either by making sure the code is fixed or getting with Xon to work with him.
 
Back
Top