osticket log files are filled with "PHP Fatal error: Uncaught InconsistentModelException" and Tickets are not listing for the agents.
==> osticket_error.log <==
[Tue Aug 22 16:25:54.245326 2023] [php:error] [pid 12156] [client 192.168.1.15:42380] PHP Fatal error: Uncaught InconsistentModelException: Unable to prepare query: SELECT A1.
numberAS
number, A1.
ticket_idAS
ticket_id, A1.
sourceAS
source, A1.
lastupdateAS
lastupdate, B2.
subjectAS
cdatasubject, A1.
isoverdueAS
isoverdue, B3.
nameAS
username, B2.
priorityAS
cdatapriority, B4.
firstnameAS
stafffirstname, B4.
lastnameAS
stafflastname, B5.
nameAS
teamname, A1.
team_idAS
team_id, A1.
isanswered= '0' AS
2GkBZxz, (SELECT COUNT(R0.
id) AS
countFROM
ost_threadQ7 JOIN
ost_ticketQ8 ON (Q7.
object_type= 'T' AND Q7.
object_id= Q8.
ticket_id) LEFT JOIN
ost_thread_entryR0 ON (Q7.
id= R0.
thread_id) WHERE Q8.
ticket_id= A1.
ticket_idAND NOT R0.
flags& 4 != 0) AS _thread_count, (SELECT COUNT(R1.
id) AS
countFROM
ost_threadQ7 JOIN
ost_ticketQ8 ON (Q7.
object_type= 'T' AND Q7.
object_id= Q8.
ticket_id) LEFT JOIN
ost_thread_entryR0 ON (Q7.
id= R0.
thread_id) LEFT JOIN
ost_attachmentR1 ON (R1.
type= 'H' AND R0.
id= R1.
object_id) WHERE Q8.
ticket_id= A1.
ticket_idAND R1.
inline= 0) AS _att_count, B6.
expire> NOW() AND NOT B6.
staff_id= 1 AS
_locked, (SELECT COUNT(R0.
id) AS
countFROM
ost_threadQ7 JOIN
ost_ticketQ8 ON (Q7.
object_type= 'T' AND Q7.
object_id= Q8.
ticket_id) LEFT JOIN
ost_thread_collaboratorR0 ON (Q7.
id= R0.
thread_id) WHERE Q8.
ticket_id= A1.
ticket_id) AS _collabs, COALESCE(B4.
firstname, B4.
lastname, B5.
name, 'zzz') AS
assigneeFROM
ost_ticketA1 JOIN
ost_ticket_statusA2 ON (A1.
status_id= A2.
id) LEFT JOIN
ost_threadA3 ON (A3.
object_type= 'T' AND A1.
ticket_id= A3.
object_id) LEFT JOIN
ost_thread_referralA4 ON (A3.
id= A4.
thread_id) LEFT JOIN
ost_staffA5 ON (A4.
object_type= 'S' AND A4.
object_id= A5.
staff_id) LEFT JOIN
ost_threadA6 ON (A1.
ticket_id= A6.
object_idAND A6.
object_type= 'C') LEFT JOIN
ost_thread_referralA7 ON (A6.
id= A7.
thread_id) LEFT JOIN
ost_staffA8 ON (A7.
object_type= 'S' AND A7.
object_id= A8.
staff_id) LEFT JOIN
ost_departmentB0 ON (A4.
object_type= 'D' AND A4.
object_id= B0.
id) LEFT JOIN
ost_departmentB1 ON (A7.
object_type= 'D' AND A7.
object_id= B1.
id) LEFT JOIN
ost_ticket__cdataB2 ON (A1.
ticket_id= B2.
ticket_id) LEFT JOIN
ost_userB3 ON (A1.
user_id= B3.
id) LEFT JOIN
ost_staffB4 ON (A1.
staff_id= B4.
staff_id) LEFT JOIN
ost_teamB5 ON (A1.
team_id= B5.
team_id) LEFT JOIN
ost_lockB6 ON (A1.
lock_id= B6.
lock_id) WHERE A2.
state= 'open' AND A2.
state= 'open' AND A1.
isanswered= '0' AND ((A2.
state= 'open' AND (A1.
staff_id= 1 OR A5.
staff_id= 1 OR A6.
object_type= 'C' AND A8.
staff_id= 1)) OR A1.
dept_idIN (1, 2, 3, 5) OR B0.
idIN (1, 2, 3, 5) OR A6.
object_type= 'C' AND B1.
idIN (1, 2, 3, 5)) AND (A1.
ticket_pidIS NULL OR A1.
flags& 8 != 0) GROUP BY A1.
ticket_idORDER BY A1.
est_duedate` DESC LIMIT 25 in /var/www/html/osticket/upload/include/class.orm.php:3483\nStack trace:\n#0 /var/www/html/osticket/upload/include/class.orm.php(3529): MySqlExecutor->execute()\n#1 /var/www/html/osticket/upload/include/class.orm.php(2104): MySqlExecutor->getArray()\n#2 /var/www/html/osticket/upload/include/class.orm.php(2054): HashArrayIterator->{closure}()\n#3 /var/www/html/osticket/upload/include/class.orm.php(2033): CallbackSimpleIterator->next()\n#4 /var/www/html/osticket/upload/include/class.orm.php(2042): CallbackSimpleIterator->rewind()\n#5 /var/www/html/osticket/upload/include/class.orm.php(1713): CallbackSimpleIterator->valid()\n#6 /var/www/html/osticket/upload/include/class.orm.php(1723): CachedResultSet->fillTo()\n#7 /var/www/html/osticket/upload/include/class.orm.php(1739): CachedResultSet->asArray()\n#8 /var/www/html/osticket/upload/include/staff/templates/queue-tickets.tmpl.php(258): CachedResultSet->getIterator()\n#9 /var/www/html/osticket/upload/scp/tickets.php(569): require_once('...')\n#10 {main}\n thrown in /var/www/html/osticket/upload/include/class.orm.php on line 3483, referer: https://ticket.test.com/scp/profile.php
`
Server details are as follows
- osTicket Version v1.18 (724de45) — Up to date
- Web Server Software Apache/2.4.52 (Ubuntu)
- MySQL Version 10.6.12 ( 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04)
- PHP Version 8.1.2-1ubuntu2.13
When executing above query on mariadb terminal, it shows
ERROR 1054 (42S22): Unknown column 'B0.subject' in 'field list'
I assumes, this issue started after enabling the plugin to store the attachments in file system (not sure). we disabled and deleted the plugin, still issue persists. Others changes are
- added new list in the form ( now reverted the changes)
- Disabled Avathar.
The osticket instance is new and there no much tickets on this. Please suggest steps to resolve this issue.