I have been getting the Database Error #1054 wherever I am messing with users. I cannot create a ticket because when i go to add a user to the ticket (search for a registered user) I get a database error. I found other threads that mention this error and they say to delete the offending column/table. But I do not want to delete this data as it appears to be phone column. What other options do I have to resolve this?
Windows Server 2016 (IIS 10)
osTicket v1.15.4.
PHP Version is 7.4
MySql 8.0.27
KevinTheJedi posted the solution:
In order to address this issue you can simply drop/delete the ost_user__cdata table and run cron manually OR add a dummy field to the contact information form, save changes, and delete the dummy field.
I use MySql in the command line so I logged in and ran the following:
mysql -u root -p
Use yourdbname;
drop table ost_user__cdata;
exit;
Now you need to run the cron command.
User Ramrajone, posted the cron command:
windows
C:\path\to\php\php.exe -f C:\path\to\osTicket\api\cron.php
*nix
\path\to\php\version\php -f \path\to\osTicket\api\cron.php
Error Message
[SELECT A1.id
, A1.name
, A6.address
FROM ost_user
A1 LEFT JOIN ost_user_email
A2 ON (A1.id
= A2.user_id
) > LEFT JOIN ost_organization
A3 ON (A1.org_id
= A3.id
) LEFT JOIN ost_user_account
A4 ON (A1.id
= A4.user_id
)
LEFT JOIN ost_user__cdata
A5 ON (A1.id
= A5.user_id
) LEFT JOIN ost_user_email
A6 ON (A1.default_email_id
=
A6.id
) WHERE (A2.address
LIKE '%user1@healthorg.com%' OR A1.name
LIKE '%user1@healthorg.com%' OR A3.name
LIKE '%user1@healthorg.com%' OR A4.username
LIKE '%user1@healthorg.com%' OR A5.phone
LIKE '%user1@healthorg.com%') LIMIT 25]
Unknown column 'A5.phone' in 'where clause'<br /> <br />
---- Backtrace ----<br />
#0 C:\inetpub\wwwroot\osticket\include\mysqli.php(201): osTicket->logDBError()<br />
#1 C:\inetpub\wwwroot\osticket\include\class.orm.php(3466): db_query()<br />
#2 C:\inetpub\wwwroot\osticket\include\class.orm.php(3522): MySqlExecutor->execute()<br />
#3 C:\inetpub\wwwroot\osticket\include\class.orm.php(2070): MySqlExecutor->getRow()<br />
#4 C:\inetpub\wwwroot\osticket\include\class.orm.php(2043): FlatArrayIterator->{closure}()<br />
#5 C:\inetpub\wwwroot\osticket\include\class.orm.php(2022): CallbackSimpleIterator->next()<br />
#6 C:\inetpub\wwwroot\osticket\include\class.orm.php(2031): CallbackSimpleIterator->rewind()<br />
#7 C:\inetpub\wwwroot\osticket\include\class.orm.php(1703): CallbackSimpleIterator->valid()<br />
#8 C:\inetpub\wwwroot\osticket\include\class.orm.php(1713): CachedResultSet->fillTo()<br />
#9 C:\inetpub\wwwroot\osticket\include\class.orm.php(1729): CachedResultSet->asArray()<br />
#10 C:\inetpub\wwwroot\osticket\include\ajax.users.php(98): CachedResultSet->getIterator()<br />
#11 C:\inetpub\wwwroot\osticket\include\class.dispatcher.php(145): UsersAjaxAPI->search()<br />
#12 C:\inetpub\wwwroot\osticket\include\class.dispatcher.php(38): UrlMatcher->dispatch()<br />
#13 C:\inetpub\wwwroot\osticket\include\class.dispatcher.php(120): Dispatcher->resolve()<br />
#14 C:\inetpub\wwwroot\osticket\include\class.dispatcher.php(38): UrlMatcher->dispatch()<br />
#15 C:\inetpub\wwwroot\osticket\scp\ajax.php(316): Dispatcher->resolve()<br />
#16 {main}
Thank you for taking a look!
EDIT:
Added System info and then posted my own resolution. Formatting.