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

Cron, maybe, error?

Discussion in 'Troubleshooting and Problems' started by AndreaMarucci, Jun 13, 2011.

  1. AndreaMarucci

    AndreaMarucci Well-Known Member

    I've seen in the log error that every day between 2AM and 3 AM it's always recorded this error in file

    library/Zend/Db/Statement/Mysqli.php:77

    Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2 - library/Zend/Db/Statement/Mysqli.php:77

    Stack Trace

    Code:
    #0 /home/kogit/forum/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('????DELETE FROM...')
    #1 /home/kogit/forum/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '????DELETE FROM...')
    #2 /home/kogit/forum/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('????DELETE FROM...')
    #3 /home/kogit/forum/library/XfRu/BoardNotices/Model/Notice.php(254): Zend_Db_Adapter_Abstract->query('????DELETE FROM...')
    #4 /home/kogit/forum/library/XfRu/BoardNotices/Model/Notice.php(229): XfRu_BoardNotices_Model_Notice->deleteDismissionsByNoticeIds(Array)
    #5 /home/kogit/forum/library/XfRu/BoardNotices/CronEntry/Archive.php(19): XfRu_BoardNotices_Model_Notice->archiveExpiredNotices()
    #6 [internal function]: XfRu_BoardNotices_CronEntry_Archive::archiveNotices()
    #7 /home/kogit/forum/library/XenForo/Model/Cron.php(353): call_user_func(Array)
    #8 /home/kogit/forum/library/XenForo/Cron.php(29): XenForo_Model_Cron->runEntry(Array)
    #9 /home/kogit/forum/library/XenForo/Cron.php(64): XenForo_Cron->run()
    #10 /home/kogit/forum/cron.php(12): XenForo_Cron::runAndOutput()
    #11 {main}
    Request Status

    Code:
    array(3) {
      ["url"] => string(39) "http://forum.kog.it/cron.php?1307923784"
      ["_GET"] => array(1) {
        [1307923784] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
    }
    What can I do?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It seems to be related to the XfRu board notices add-on.
     
  3. AndreaMarucci

    AndreaMarucci Well-Known Member

    I can try to disable it. This addon worked without problems before, I think, the upgrade to 1.0.2. Maybe is related to this one.
     
  4. ragtek

    ragtek Guest

    I can confirm this.
    It's because of the add-on.
    It tries to run this query:
    Code:
    DELETE FROM `xfr_bn_dismission` WHERE notice_id IN ()
     
  5. ragtek

    ragtek Guest

    Fix
    PHP:

    public function archiveExpiredNotices()
        {
            
    $now XenForo_Application::$time;
            
    $db $this->_getDb();
            
    $db->query('
                UPDATE xfr_bn_notice
                SET archive = 1
                WHERE archive = 0 AND end_date < ' 
    $db->quote($now) . '
            '
    );

            
    $stmt $db->query('
                SELECT notice_id
                FROM xfr_bn_notice
                WHERE archive = 1
            '
    );

            
    $archivedNotices = array();

            while (
    $row $stmt->fetch())
            {
                
    $archivedNotices[] = $row['notice_id'];
            }
            if (
    count($archivedNotices) > 0) {
                
    $this->deleteDismissionsByNoticeIds($archivedNotices);
            }
        }
    instead of
    PHP:
    public function archiveExpiredNotices()
        {
            
    $now XenForo_Application::$time;
            
    $db $this->_getDb();
            
    $db->query('
                UPDATE xfr_bn_notice
                SET archive = 1
                WHERE archive = 0 AND end_date < ' 
    $db->quote($now) . '
            '
    );

            
    $stmt $db->query('
                SELECT notice_id
                FROM xfr_bn_notice
                WHERE archive = 1
            '
    );

            
    $archivedNotices = array();

            while (
    $row $stmt->fetch())
            {
                
    $archivedNotices[] = $row['notice_id'];
            }

                
    $this->deleteDismissionsByNoticeIds($archivedNotices);
            
        }
     
    CyberAP likes this.
  6. AndreaMarucci

    AndreaMarucci Well-Known Member

    In what file exactly?
     
  7. ragtek

    ragtek Guest

    XfRu_BoardNotices_Model_Notice
     
  8. AndreaMarucci

    AndreaMarucci Well-Known Member

    Sorry, not able to find it. In the templates list does not appear. It's a file, a template or what?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    It's a .php file in the file system.
     
  10. AndreaMarucci

    AndreaMarucci Well-Known Member

    It's in library/XfRu/BoardNotices/Model/Notice.php
     

Share This Page