Repository: osTicket/osTicket

Issue #246: Error in system log
Created: 2013-11-29T09:38:37Z
Is this a bug in the program?
DB Error #1582
[SELECT T1.dept_name, FORMAT(AVG(DATEDIFF(B2.created, B1.created)), 1) AS ResponseTime FROM ost_department T1 LEFT JOIN ost_ticket T2 ON (T2.dept_id=T1.dept_id) LEFT JOIN ost_ticket_thread B2 ON (B2.ticket_id = T2.ticket_id AND B2.thread_type="R") LEFT JOIN ost_ticket_thread B1 ON (B2.pid = B1.id) LEFT JOIN ost_staff S1 ON (S1.staff_id=B2.staff_id) WHERE T1.dept_id IN (1, 6, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42) AND B1.created BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1385462136) GROUP BY T1.dept_id ORDER BY T1.dept_name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(125): osTicket->logDBError('DB Error #1582', '[SELECT T1.dept...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT T1.dept_...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(90): Dispatcher->resolve('/report/overvie...')
#9 {main}

Duplicate issue #404: multiple errors after osticket upgrade 1.8 > 1.8.0.1
Created: 2014-01-13T10:34:35Z
Error 1 :
DB Error #1582
[SELECT T1.dept_name, COUNT()-COUNT(NULLIF(A1.state, "created")) AS Opened, COUNT()-COUNT(NULLIF(A1.state, "assigned")) AS Assigned, COUNT()-COUNT(NULLIF(A1.state, "overdue")) AS Overdue, COUNT()-COUNT(NULLIF(A1.state, "closed")) AS Closed, COUNT(*)-COUNT(NULLIF(A1.state, "reopened")) AS Reopened FROM ost_department T1 LEFT JOIN ost_ticket_event A1 ON (A1.dept_id=T1.dept_id AND NOT annulled AND (A1.timestamp BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1389609013))) LEFT JOIN ost_staff S1 ON (S1.staff_id=A1.staff_id) WHERE T1.dept_id IN (1, 3, 4) GROUP BY T1.dept_id ORDER BY T1.dept_name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(126): osTicket->logDBError('DB Error #1582', '[SELECT T1.dept...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT T1.dept_...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(99): Dispatcher->resolve('/report/overvie...')
#9 {main}
DB Error #1582
[SELECT T1.dept_name, FORMAT(AVG(DATEDIFF(T2.closed, T2.created)), 1) AS ServiceTime FROM ost_department T1 LEFT JOIN ost_ticket T2 ON (T2.dept_id=T1.dept_id) LEFT JOIN ost_staff S1 ON (S1.staff_id=T2.staff_id) WHERE T1.dept_id IN (1, 3, 4) AND T2.closed BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1389609013) GROUP BY T1.dept_id ORDER BY T1.dept_name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(126): osTicket->logDBError('DB Error #1582', '[SELECT T1.dept...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT T1.dept_...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(99): Dispatcher->resolve('/report/overvie...')
#9 {main}
DB Error #1582
[SELECT CONCAT_WS(' / ', (SELECT P.topic FROM ost_help_topic P WHERE P.topic_id = T1.topic_pid), T1.topic) as name , COUNT()-COUNT(NULLIF(A1.state, "created")) AS Opened, COUNT()-COUNT(NULLIF(A1.state, "assigned")) AS Assigned, COUNT()-COUNT(NULLIF(A1.state, "overdue")) AS Overdue, COUNT()-COUNT(NULLIF(A1.state, "closed")) AS Closed, COUNT(*)-COUNT(NULLIF(A1.state, "reopened")) AS Reopened FROM ost_help_topic T1 LEFT JOIN ost_ticket_event A1 ON (A1.topic_id=T1.topic_id AND NOT annulled AND (A1.timestamp BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1389609030))) LEFT JOIN ost_staff S1 ON (S1.staff_id=A1.staff_id) WHERE 1 GROUP BY T1.topic_id ORDER BY name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(126): osTicket->logDBError('DB Error #1582', '[SELECT CONCAT_...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT CONCAT_W...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(99): Dispatcher->resolve('/report/overvie...')
#9 {main}
DB Error #1582
[SELECT CONCAT_WS(' / ', (SELECT P.topic FROM ost_help_topic P WHERE P.topic_id = T1.topic_pid), T1.topic) as name , FORMAT(AVG(DATEDIFF(B2.created, B1.created)), 1) AS ResponseTime FROM ost_help_topic T1 LEFT JOIN ost_ticket T2 ON (T2.topic_id=T1.topic_id) LEFT JOIN ost_ticket_thread B2 ON (B2.ticket_id = T2.ticket_id AND B2.thread_type="R") LEFT JOIN ost_ticket_thread B1 ON (B2.pid = B1.id) LEFT JOIN ost_staff S1 ON (S1.staff_id=B2.staff_id) WHERE 1 AND B1.created BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1389609030) GROUP BY T1.topic_id ORDER BY name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(126): osTicket->logDBError('DB Error #1582', '[SELECT CONCAT_...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT CONCAT_W...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(99): Dispatcher->resolve('/report/overvie...')
#9 {main}
DB Error #1582
[SELECT T1.dept_name, FORMAT(AVG(DATEDIFF(T2.closed, T2.created)), 1) AS ServiceTime FROM ost_department T1 LEFT JOIN ost_ticket T2 ON (T2.dept_id=T1.dept_id) LEFT JOIN ost_staff S1 ON (S1.staff_id=T2.staff_id) WHERE T1.dept_id IN (1, 3, 4) AND T2.closed BETWEEN FROM_UNIXTIME() AND FROM_UNIXTIME(1389609035) GROUP BY T1.dept_id ORDER BY T1.dept_name] Incorrect parameter count in the call to native function 'FROM_UNIXTIME'
---- Backtrace ----
#0 (root)/include/mysqli.php(126): osTicket->logDBError('DB Error #1582', '[SELECT T1.dept...')
#1 (root)/include/ajax.reports.php(136): db_query('SELECT T1.dept_...')
#2 (root)/include/ajax.reports.php(162): OverviewReportAjaxAPI->getData()
#3 [internal function]: OverviewReportAjaxAPI->getTabularData()
#4 (root)/include/class.dispatcher.php(140): call_user_func_array(Array, Array)
#5 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('table', Array)
#6 (root)/include/class.dispatcher.php(118): Dispatcher->resolve('table', Array)
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/report/overvie...', NULL)
#8 (root)/scp/ajax.php(99): Dispatcher->resolve('/report/overvie...')
#9 {main}
And some others. By the way, it would be practical to be able to export system log to a file, so that we can get errors out and send you back.

Closing comment (2014-01-13T14:37:57Z): Thanks for your post. This is a duplicate of #246