Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

DB errors new install Debian 0, syntax errors,DB Error #1064







P { margin-bottom: 0.21cm; }

Hello, I've been deploying a couple of
OsTicket 1.10 on debian 8. Now with the release of debian 9 I would
like to use this as my primary os but there seems to be some syntax
errors in the MySQL scripts when install on mariaDB that comes with
debian 9.


The errors:


-----
DB Error #1064
------
CREATE TABLE IF NOT EXISTS `ost_ticket__cdata` (PRIMARY KEY (ticket_id)) DEFAULT CHARSET=utf8 AS SELECT entry.`object_id` as `ticket_id`, FROM ost_form_entry entry JOIN ost_form_entry_values ans ON ans.entry_id = entry.id JOIN ost_form_field field ON field.id=ans.field_id WHERE entry.object_type='T' GROUP BY entry.object_id]


You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM ost_form_entry entry JOIN ost_form_entry_values ans ON ans.entr' at line 2
-------

If I remove "," between ...`ticket_id`, FROM os... then the script work. But after this next error occurs.

------------
DB Error #1054
------------

[SELECT A4.`staff_id` AS `lock__staff_id`, A1.`staff_id` AS `staff_id`, A1.`isoverdue` AS `isoverdue`, A1.`team_id` AS `team_id`, A1.`ticket_id` AS `ticket_id`, A1.`number` AS `number`, A2.`subject` AS `cdata__subject`, A6.`address` AS `user__default_email__address`, A1.`source` AS `source`, A3.`priority_color` AS `cdata__:priority__priority_color`, A3.`priority_desc` AS `cdata__:priority__priority_desc`, A1.`status_id` AS `status_id`, A7.`name` AS `status__name`, A7.`state` AS `status__state`, A1.`dept_id` AS `dept_id`, A8.`name` AS `dept__name`, A5.`name` AS `user__name`, A1.`lastupdate` AS `lastupdate`, A1.`isanswered` AS `isanswered`, B0.`firstname` AS `staff__firstname`, B0.`lastname` AS `staff__lastname`, B1.`name` AS `team__name`, (SELECT COUNT(R0.`id`) AS `count` FROM `ost_thread` Q7 JOIN `ost_ticket` Q8 ON (Q7.`object_type` = 'T' AND Q7.`object_id` = Q8.`ticket_id`) LEFT JOIN `ost_thread_collaborator` R0 ON (Q7.`id` = R0.`thread_id`) WHERE Q8.`ticket_id` = A1.`ticket_id`) AS collab_count, (SELECT COUNT(R1.`id`) AS `count` FROM `ost_thread` Q7 JOIN `ost_ticket` Q8 ON (Q7.`object_type` = 'T' AND Q7.`object_id` = Q8.`ticket_id`) LEFT JOIN `ost_thread_entry` R0 ON (Q7.`id` = R0.`thread_id`) LEFT JOIN `ost_attachment` R1 ON (R1.`type` = 'H' AND R0.`id` = R1.`object_id`) WHERE Q8.`ticket_id` = A1.`ticket_id` AND R1.`inline` = 0) AS attachment_count, (SELECT COUNT(R0.`id`) AS `count` FROM `ost_thread` Q7 JOIN `ost_ticket` Q8 ON (Q7.`object_type` = 'T' AND Q7.`object_id` = Q8.`ticket_id`) LEFT JOIN `ost_thread_entry` R0 ON (Q7.`id` = R0.`thread_id`) WHERE Q8.`ticket_id` = A1.`ticket_id` AND NOT R0.`flags` & 4 != 0) AS thread_count FROM `ost_ticket` A1 LEFT JOIN `ost_ticket__cdata` A2 ON (A1.`ticket_id` = A2.`ticket_id`) LEFT JOIN `ost_ticket_priority` A3 ON (A2.`priority` = A3.`priority_id`) LEFT JOIN `ost_lock` A4 ON (A1.`lock_id` = A4.`lock_id` AND A4.`expire` > NOW()) JOIN `ost_user` A5 ON (A1.`user_id` = A5.`id`) LEFT JOIN `ost_user_email` A6 ON (A5.`default_email_id` = A6.`id`) JOIN `ost_ticket_status` A7 ON (A1.`status_id` = A7.`id`) JOIN `ost_department` A8 ON (A1.`dept_id` = A8.`id`) LEFT JOIN `ost_staff` B0 ON (A1.`staff_id` = B0.`staff_id`) LEFT JOIN `ost_team` B1 ON (A1.`team_id` = B1.`team_id`) WHERE A1.`ticket_id` IN (SELECT A1.`ticket_id` FROM `ost_ticket` A1 JOIN `ost_ticket_status` A2 ON (A1.`status_id` = A2.`id`) WHERE A1.`isanswered` = 0 AND A2.`state` = 'open' AND ((A2.`state` = 'open' AND A1.`staff_id` = 1) OR A1.`dept_id` IN ('1'))) GROUP BY A4.`staff_id`, A1.`staff_id`, A1.`isoverdue`, A1.`team_id`, A1.`ticket_id`, A1.`number`, A2.`subject`, A6.`address`, A1.`source`, A3.`priority_color`, A3.`priority_desc`, A1.`status_id`, A7.`name`, A7.`state`, A1.`dept_id`, A8.`name`, A5.`name`, A1.`lastupdate`, A1.`isanswered`, B0.`firstname`, B0.`lastname`, B1.`name` ORDER BY A3.`priority_urgency` ASC, A1.`lastupdate` DESC] Unknown column 'A2.subject' in 'field list'
-------

Any help to get this installation working?

Comments

  • There appears to be an errant comma here:

    as `ticket_id`, FROM

    I would hazard a guess that MySQL doesn't care, but MariaDB does.
  • So, your suggestion is to drop MariaDB and install MySQL?
  • I installed mysql-5.7 but I get exactly the same error.

     DB Error #1064
    [CREATE TABLE IF NOT EXISTS `ost_ticket__cdata` (PRIMARY KEY (ticket_id)) DEFAULT CHARSET=utf8 AS SELECT entry.`object_id` as `ticket_id`, FROM ost_form_entry entry JOIN ost_form_entry_values ans ON ans.entry_id = entry.id JOIN ost_form_field field ON field.id=ans.field_id WHERE entry.object_type='T' GROUP BY entry.object_id] 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 'FROM ost_form_entry entry JOIN ost_form_entry_values ans ON ans.entr' at line 2
  • edited August 14
    Have the same problem with Debian9 and MariaDB 10.1. 

    Any fix??
  • edited August 25
    The problem seamed to be related to vhost conf apache. So, I took the default vhost and then I got It almost working...

    Managed to make a clean install. Could be without additional language pack. I see that some have hade problem with this.

    But still have som issues with create-new-user

    http://osticket.com/forum/discussion/90993/create-new-user-ajax-problem-debian-9-php7

    and DB error

    http://osticket.com/forum/discussion/90994/db-error-1062-debian-9-fresh-install
  • I've asked the devs to take a look at this thread.
Sign In or Register to comment.