• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Cannot insert a message in the middle of a discussion.

#1
Hi all,
We upgraded from 1.1 to 1.3 and now are server error logs are flooded with the following error:

"Cannot insert a message in the middle of a discussion."
"library/XenForo/DataWriter/DiscussionMessage.php:449"

We aren't sure what's going on. From the code that is throwing the exception:

PHP:
 if ($this->get('post_date') < $discussionDw->get('last_post_date'))                         
{                                                                                           
         // TODO: this doesn't deal with inserting a message in the middle of a discussion   
         throw new XenForo_Exception('Cannot insert a message in the middle of a discussion.');
}
We aren't sure why we are getting this error. Something must be a little off as it doesn't happen on every post, in fact not on most posts. But it is happening often enough to annoy our users. We just set up a new database master/slave and all new servers so anything could be the culprit. Any ideas?
 

Brogan

XenForo moderator
Staff member
#2
Check the server time is correct.
Typically this is due to when the server time is earlier than the actual time.
 
#3
Check the server time is correct.
Typically this is due to when the server time is earlier than the actual time.
Theoretically if you had one server this wouldn't be an issue, right? If all the times were off by the same amount it shouldn't throw errors (correct me if I'm wrong there). But we have 12 servers in an ASG in AWS so if one or two of them are off then it could be causing the issues.
 

Mike

XenForo developer
Staff member
#5
If your server times are not synchronized, then yes that would cause the problem. Syncing via NTP should be sufficient.
 
#6
If your server times are not synchronized, then yes that would cause the problem. Syncing via NTP should be sufficient.
Just confirmed with techops that we don't currently have the NTP client installed for our ASG. They are working on it now and I added IP logging in the mean time to see if I can nail down which servers are off. Thanks guys.