Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-933

java.sql.SQLException: Incorrect syntax near '-'. When adding an existent user as agent.

      Environment:

      JIRA 6.2.7
      Service desk 2.0.2
      MS SQL Server 2008 R2/2012 with the database collation type = SQL_Latin1_General_CP1_CI_AS or SQL_Latin1_General_CP437_CI_AI

      When trying to add an existent user as an agent, JIRA throws the following error:

      Error
      There was a SQL exception thrown by the Active Objects library: 
      Database: 
      - name:Microsoft SQL Server 
      - version:10.50.2500 
      - minor version:50 
      - major version:10 
      Driver: 
      - name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase 
      - version:1.2.4 
      
      java.sql.SQLException: Incorrect syntax near '-'.
      Please contact the system administrator.
      

      Although if the page is refreshed the user was successfully added as an agent.

      Tested this on PostgreSQL and that does not occurs.

      Workaround:

        1. collation.PNG
          collation.PNG
          10 kB
        2. misleading.PNG
          misleading.PNG
          34 kB
        3. Screen Shot 2014-10-09 at 4.43.54 PM.png
          Screen Shot 2014-10-09 at 4.43.54 PM.png
          39 kB

          Form Name

            [JSDSERVER-933] java.sql.SQLException: Incorrect syntax near '-'. When adding an existent user as agent.

            Hi,

            This bug still occurs on:

            SQL server version : 11.00.3412
            Jira version 6.3.15
            Service desk version : 2.3.2

            /Mikael

            Mikal Martinsson added a comment - Hi, This bug still occurs on: SQL server version : 11.00.3412 Jira version 6.3.15 Service desk version : 2.3.2 /Mikael

            Julian (Inactive) added a comment - - edited

            Hi ezhang,

            I just tested this behaviour on JIRA 6.3.11, JSD 2.1.1 with the right collation which is SQL_Latin1_General_CP437_CI_AI, but the same issue still happening. As mentioned in the ticket, after refreshing it, the Users would actually be included as an Agent and there seems to be any problem using that new Agent on ServiceDesk project.

            Is this issue still related to this bug ticket? Attachment below for more details:

            Cheers,
            Julian.

            Julian (Inactive) added a comment - - edited Hi ezhang , I just tested this behaviour on JIRA 6.3.11, JSD 2.1.1 with the right collation which is SQL_Latin1_General_CP437_CI_AI, but the same issue still happening. As mentioned in the ticket, after refreshing it, the Users would actually be included as an Agent and there seems to be any problem using that new Agent on ServiceDesk project. Is this issue still related to this bug ticket? Attachment below for more details: Cheers, Julian.

            Please see https://confluence.atlassian.com/display/JIRAKB/What+Database+Collation+X+Encoding+Should+be+Used+in+JIRA which explains why the encoding recommended by JIRA is what it is.

            The workaround for this is to use the encoding recommended when connecting JIRA to a MSSQL.

            Ed Zhang (Automation) added a comment - Please see https://confluence.atlassian.com/display/JIRAKB/What+Database+Collation+X+Encoding+Should+be+Used+in+JIRA which explains why the encoding recommended by JIRA is what it is. The workaround for this is to use the encoding recommended when connecting JIRA to a MSSQL.

            ckimloong: We changed the database collation, but the error still occurs when we add an agent.

            Andrew Culver added a comment - ckimloong : We changed the database collation, but the error still occurs when we add an agent.

              tbuiquang Thong Bui Quang (Inactive)
              dzarpelon Diego Zarpelon (Inactive)
              Affected customers:
              7 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: