XF 2.2 Server Error Log "Post Has No Thread"

Ludachris

Well-known member
I was hoping to get some help. One of my forums is running XF 2.2.13, I know I need to update it. I'm getting server errors multiple times per day that say "Post Has No Thread". It looks like most of these are coming from links in the Similar Threads widget for the referring page (I use Enhanced Search with ElasticSearch). When you click the link to view the thread you get the Oops, Something went wrong page. Thing is, I also checked the user's profile for the thread, and I see it in their Posts history. When I click on the the thread from there, I get the same thing. So the thread hasn't been deleted, it's still showing up as part of the user's posting history - I never hard delete threads.

I've tried rebuilding Threads in caches. That didn't fix it. Not sure what else could be causing this. Should I just try upgrading to see if that fixes it?

Here's the error:

  • LogicException: Post has no thread
  • src/XF/ControllerPlugin/Thread.php:14
  • Generated by: Me
  • Jul 25, 2024 at 7:37 AM

Stack trace​

#0 src/XF/Pub/Controller/Thread.php(287): XF\ControllerPlugin\Thread->getPostLink(Object(SV\ElasticSearchEssentials\XF\Entity\Post))
#1 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Thread->actionLatest(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Latest', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#3 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#4 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#6 src/XF.php(524): XF\App->run()
#7 index.php(20): XF::runApp('XF\\Pub\\App')
#8 {main}

Request state​

array(4) {
["url"] => string(39) "/threads/new-member-in-ie.329062/latest"
["referrer"] => string(68) "https://www.website.com/threads/scammed-by-a-proven-member.408306/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
I'm pretty sure I already rebuilt the Search index but I'm going to try that again for Posts and Threads. It's a large forum so that always takes time to rebuild.
 
I'm pretty sure I already rebuilt the Search index but I'm going to try that again for Posts and Threads. It's a large forum so that always takes time to rebuild.
Rebuilding the search index for threads and posts didn't fix it. I can still see the thread in the user's Post history in their profile and when I click on it I get the Oops page. Not sure what else to check.
 
Back
Top Bottom