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

XF 1.5 Wrong Server Time Messed Up Forum

Discussion in 'Troubleshooting and Problems' started by Recep Baltaş, Sep 20, 2015.

  1. Recep Baltaş

    Recep Baltaş Well-Known Member


    my stupid hosting provider ****ed up again as always and the server time went 1 day ahead. Told them, fixed the problem but this is now casuing some issues on the forum like:

    Hata Bilgisi
    XenForo_Exception: Cannot insert a message in the middle of a discussion. - library/XenForo/DataWriter/DiscussionMessage.php:449
    Oluşturan: furkannaci34, 14 dakika önce
    Yığın Takibi
    #0 /home/technopa/public_html/sosyal/library/XenForo/DataWriter/DiscussionMessage.php(354): XenForo_DataWriter_DiscussionMessage->_setPosition()
    #1 /home/technopa/public_html/sosyal/library/XenForo/DataWriter.php(1446): XenForo_DataWriter_DiscussionMessage->_preSave()
    #2 /home/technopa/public_html/sosyal/library/XenForo/ControllerPublic/Thread.php(550): XenForo_DataWriter->preSave()
    #3 /home/technopa/public_html/sosyal/library/WMTech/DoublePost/ControllerPublic/Thread.php(48): XenForo_ControllerPublic_Thread->actionAddReply()
    #4 /home/technopa/public_html/sosyal/library/XenForo/FrontController.php(347): WMTech_DoublePost_ControllerPublic_Thread->actionAddReply()
    #5 /home/technopa/public_html/sosyal/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #6 /home/technopa/public_html/sosyal/index.php(13): XenForo_FrontController->run()
    #7 {main}
    Talep Yeri
    array(3) {
      ["url"] => string(79) "https://www.technopat.net/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/add-reply"
      ["_GET"] => array(0) {
      ["_POST"] => array(9) {
        ["message_html"] => string(295) "<p>Bilgisayarı aldıktan sonra 1 tane daha fazladan ram takmayacaksan Ram olarak 2x4 alırsan daha iyi performans alırsın.&nbsp;Tek modülde sıkıntı yaşamazsın ama daha sonradan bir tane daha takarım dersen yine aynı model (CL, MHz, GB değerleri aynı) olan bellekten alabilirsin.</p>"
        ["_xfRelativeResolver"] => string(76) "https://www.technopat.net/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/page-3"
        ["attachment_hash"] => string(32) "a0bdbff0917389c01210599f3292829b"
        ["last_date"] => string(10) "1442792326"
        ["last_known_date"] => string(10) "1442792326"
        ["_xfToken"] => string(8) "********"
        ["_xfRequestUri"] => string(51) "/sosyal/konu/1500-tl-sistem-tavsiyesi.247313/page-3"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfResponseType"] => string(4) "json"
    Any help ? Which counter should I refresh ?
    Last edited: Sep 20, 2015
  2. AndyB

    AndyB Well-Known Member

  3. Recep Baltaş

    Recep Baltaş Well-Known Member

    Cool but it is a big board. I really don't have that much time to manually edit so many threads.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to wait for the server time to catch up to the time stamps on the posts.
  5. Recep Baltaş

    Recep Baltaş Well-Known Member

    Great. Users can't post on those threads...
    Last edited: Sep 20, 2015
  6. imthebest

    imthebest Formerly Super120

    Isn't there a query he can run to solve the problem now and avoid waiting until the time catch up?
  7. Chris D

    Chris D XenForo Developer Staff Member

    There possibly is, but it's possibly a bit dodgy.

    UPDATE xf_post SET post_date = (post_date - 86400) WHERE post_date > UNIX_TIMESTAMP()
    UPDATE xf_thread SET post_date = (post_date - 86400) WHERE post_date > UNIX_TIMESTAMP()
    If there are any threads or posts that were created after the current time stamp, it will set them to be 24 hours earlier.

    There's some issues with this. It only deals with threads and posts - it doesn't deal with conversations. It also doesn't deal with things like the last_post_date caches and that kind of thing, so at the very least you'll need to do a full rebuild of posts and discussion counters.

    Aside from that, I'm not 100% sure that running it won't cause any adverse effects.

    At the very least you should run some detailed tests, first, before running the queries and ensure you have done a full back up and be prepared to roll back to that back up if anything goes wrong or anything else unexpected happens.
  8. HWS

    HWS Well-Known Member

    Just move your server time ahead 1 day again and slowly go back to normal over the next several days.

    I would do 30 minutes each 2nd hour or 15 minutes each hoer. You will run into problems again with some threads, but those problem will be solved max 30 or 15 minutes later.

Share This Page