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 Error #1064 & DB Error #1146 on Fresh install or update from 1.9.15

Hi Guys:
For a fresh install or update i recieved this two email errors.

For DB Error #1064, email content:
[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





For DB Error #1146, email content:
[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]

Table 'codeline_osticket.ost_ticket__cdata' doesn't exist


I think 2nd error is for first error.


Regards.

Comments

  • Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.
  • Thanks ntozier.

    Centos 6.8 (VPS) with cPanel
    osTicketv1.10 (901e5ea) —  Up to date
    Web Server SoftwareApache
    MySQL version5.6.34
    PHP version5.6.30


     Log TitleLog TypeLog DateIP Address
     DB Error #1146Error jueves 26 de enero de 2017 4:47179.8.117.168



     DB Error #1064Error jueves 26 de enero de 2017 4:47179.8.117.168

    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


    Attached file show next to click "install button"

    Regards
    sshot-1.png
    628 x 277 - 11K
  • This:
    [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

    Indicates that the SQL query is being rejected by the MySQL server.  Specifically because there is a syntax error.  My guess would be that you have a problem with your MySQL (maybe a bug in the 5.6.30 version).  The second error you listed is a cascading error because of the first one.  Ensure that your DB user has the CREATE permission (which it should since you used it to setup the database in the first place and I would think would result in a permission error otherwise).  If it were me I would try a different version of MySQL.  I believe that the Devs are running MariaDB these days so you could also try that.  

    Also since your running CentOS you could try disabling SELinux and see if that changes the errors you are getting.  If the __cdata table is created with that shutoff then we would know that it was blocking the creation some how.  I wouldn't think that it would interfere with this sort of thing but was a thought.
  • Hi.
    SElinux was disablled before installation.
    The mysql user have all permissions.
    I don't think it's a mysql error because I did install 1.9.15 and I had no problem on fresh install.
    I'll try with MariaDB & comment to you next.
    Regards.
  • Hi:
    OS: Centos 6.8 with cPanel 11.60.38
    MariaDB 10.0.29
    PHP: 5.6.30
    SELinux: disabled
    Osticket: 1.10

    Fresh install.
    When click install button i got error http 500.

    Same errors #1064 (create table) & #1146 (select).

    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

    Regards.
  • MySQL and Maria DB are rejecting the query due to syntax 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 'FROM ost_form_entry entry JOIN ost_form_entry_values ans ON ans.entr' at line 2"


  • Sure.
    This command is from osticket 1.10 install, not from me.
    With 1.9.15 all ok.
    Regards.
  • edited January 26
    Correct osTicket is generating the query.  MySQL (or Maria) is rejecting it.
    Over 9000 people are running 1.10 and not having the problem.
    So it seems that its unique to your SQL instance.
  • You recommend to me install 1.9.15 & upgrade to 1.10?
    Regards
  • I never ran 1.9.15 so I dont find it likely that I would recommend such a thing.
    If your new to osTicket I would say install the latest version (always).
    If you have an old server, I would say upgrade it to 1.10 if you meet the requirements.
  • I have the same error. Also a new installation.
    [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<br />
  • MySQL 5.7
    Centos 7 with php 5.4.16
  • Hi Hivset.
    I has to install first 1.9.15 & next upgrade to 1.10
    I'm using MariaDB 10.0.29 & PHP 5.6
    CentOS 6.8
    This an error from osTicket install.
    Regards
  • I dont know about MariaDB but I know that MySQL 5.7 doesn't work with osTicket right now.
  • There is a comma after `ticket_id` and before FROM

    ... entry.`object_id` as `ticket_id`, FROM ...

    The installation doesn't generate the correct SQL query
  • any solution ????
  • edited August 18
    I have only seen this errors when you try to install osticket 1.10 with an additional language pack.
    Adding the language pack after the install would prevent the errors.

    The language files seem to be the reason for the problem. They will be updated to avoid this:
    https://github.com/osTicket/osTicket/issues/3865
  • thanks for your answer @mfelber but i didn't  install osticket 1.10 with  additional language pack.
    but in the installation I selected spanish languague (In the installation have the option to choose the language)
  • edited August 18
    Only with the built-in english language pack this problem doesn't occur. Normally no other language pack is available at the installation unless you add an additional language pack from osticket.com.

    So I guess you don't have installed it from osticket.com (and therefore you didn't know that the other language packs are not built-in)..
Sign In or Register to comment.