Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14703

PTC Integrity Plugin throws/catches SQL Exception in Combination with Locale Plugin

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • integrity-plugin
    • Windows 7 64 bit, MKS Integrity Client 2009 (Build: 4.10.0.9049), Jenkins 1.476, integrity-plugin 1.14

      Company language is English so we want to use the locale plugin to force Jenkins frontend to English. But if we do so, we get the following error message during SCM polling with integrity plugin:

      Started by an SCM change
      Building in workspace d:\Jenkins\jobs\xxx\workspace
      Change Log: http://xxxjenkinsxxx/job/xxx/38/changes
      Build Log: http://xxxjenkinsxxx/job/xxx/38/console
      Preparing to execute si projectinfo for #p=d:/mks/archives/src/xxx.pj#d=xxxBAL
      Preparing to execute si viewproject for #p=d:/mks/archives/src/xxx.pj#d=xxxBAL
      A SQL Exception was caught!
      Failed to create database 'd:/Jenkins/jobs/xxx/builds/2012-08-06_11-02-18/IntegritySCM', see the next exception for details.
      Archiving artifacts
      Skipping Cobertura coverage report as build was not UNSTABLE or better ...
      Recording test results
      Finished: FAILURE

      Here the requested debug output:

      Aug 13, 2012 3:56:09 PM [DEBUG] IntegritySCM - Start execution of checkout() routine...!
      Aug 13, 2012 3:56:09 PM [DEBUG] IntegritySCM - Creating Integrity API Session...
      Aug 13, 2012 3:56:09 PM [DEBUG] IntegritySCM - api ping --user=xxx --port=xxx --hostname=xxx – returned exit code 0
      Aug 13, 2012 3:56:09 PM [DEBUG] IntegritySCM - Successfully established connection xxx@xxx:xxx
      Aug 13, 2012 3:56:09 PM [DEBUG] IntegritySCM - Preparing to execute si projectinfo for #p=d:/mks/archives/src/xxx.pj#d=xxxxxx
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - si projectinfo --user=xxx --port=xxx --hostname=xxx --project=#p=d:/mks/archives/src/xxx.pj#d=xxx – returned exit code 0

      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - si projectinfo --user=xxx --port=xxx --hostname=xxx --project=#p=d:/mks/archives/src/xxx.pj#d=xxxxxx – returned 0
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - Preparing to execute si viewproject for #p=d:/mks/archives/src/xxx.pj#d=xxxxxx
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - Executed si viewproject --user=xxx --port=7001 --hostname=xxx --recurse --project=#p=d:/mks/archives/src/xxx.pj#d=xxxxxx --fi
      elds=name,context,cpid,memberrev,membertimestamp,memberdescription – with interim
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - Attempting to open connection to database: d:\Jenkins\jobs\xxx\builds\2012-08-13_15-56-09\IntegritySCM
      Aug 13, 2012 3:56:10 PM [INFO] IntegritySCM - SQL Exception caught...
      Aug 13, 2012 3:56:10 PM [INFO] IntegritySCM - java.sql.SQLException: Failed to create database 'd:/Jenkins/jobs/xxx/builds/2012-08-13_15-56-09/IntegritySCM', see the next exception for
      details.
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - Attempting to shut down database: d:\Jenkins\jobs\xxx\builds\2012-08-13_15-56-09\IntegritySCM
      Aug 13, 2012 3:56:10 PM [INFO] IntegritySCM - Failed to shutdown database connection!
      Aug 13, 2012 3:56:10 PM [INFO] IntegritySCM - Database 'd:/Jenkins/jobs/xxx/builds/2012-08-13_15-56-09/IntegritySCM' not found.
      Aug 13, 2012 3:56:10 PM [INFO] IntegritySCM - java.sql.SQLException: Database 'd:/Jenkins/jobs/xxx/builds/2012-08-13_15-56-09/IntegritySCM' not found.
      ?[33mAug 13, 2012 3:56:10 PM org.apache.commons.httpclient.HttpMethodBase readResponseBody
      WARNING: Unsupported transfer encoding:
      ?[0mAug 13, 2012 3:56:10 PM org.apache.commons.httpclient.HttpMethodBase readResponseBody
      INFO: Response content is not chunk-encoded
      Aug 13, 2012 3:56:10 PM [DEBUG] IntegritySCM - Successfully disconnected connection xxx@xxx:7001

          [JENKINS-14703] PTC Integrity Plugin throws/catches SQL Exception in Combination with Locale Plugin

          Please submit the stacktrace from jenkins.err.log. Also turn up debug logging (see wiki for details) and provide more information to better diagnose the problem.

          Cletus D'Souza added a comment - Please submit the stacktrace from jenkins.err.log. Also turn up debug logging (see wiki for details) and provide more information to better diagnose the problem.

          First: Thanks for your fast responses!
          Second: I updated the description with Integrity debug output. It is copied from command line as Jenkins is not creating log files anymore. Don't know why, maybe because I start it manually as a logged in user (I had some problems with Windows service in the past). Can someone tell me how to create the log files? Piping in the command line? Thanks, Karsten

          Karsten Günther added a comment - First: Thanks for your fast responses! Second: I updated the description with Integrity debug output. It is copied from command line as Jenkins is not creating log files anymore. Don't know why, maybe because I start it manually as a logged in user (I had some problems with Windows service in the past). Can someone tell me how to create the log files? Piping in the command line? Thanks, Karsten

          This Issue reapears on Jenkins 1.549 and PTC Plugin 1.22. After Rolling back to 1.20 erverything works fine again.

          Thorsten Liepert added a comment - This Issue reapears on Jenkins 1.549 and PTC Plugin 1.22. After Rolling back to 1.20 erverything works fine again.

          Martin Hohl added a comment -

          Also occurs with Jenkins ver. 1.546 and integrity-plugin 1.22, downgrading to integrity-plugin 1.20 or integrity-plugin 1.16 doesn't help.
          If I remove the "Default Language" setting from the Locale plugin (leave field empty) and remove the checkmark from "Ignore browser preference and force this language to all users", then the SQL Exception disappears (the mere presence of the Locale plugin as an installed plugin apparently isn't harmful, it seems that the observed behavior is connected to the field "Default Language" in the Locale plugin).

          Martin Hohl added a comment - Also occurs with Jenkins ver. 1.546 and integrity-plugin 1.22, downgrading to integrity-plugin 1.20 or integrity-plugin 1.16 doesn't help. If I remove the "Default Language" setting from the Locale plugin (leave field empty) and remove the checkmark from "Ignore browser preference and force this language to all users", then the SQL Exception disappears (the mere presence of the Locale plugin as an installed plugin apparently isn't harmful, it seems that the observed behavior is connected to the field "Default Language" in the Locale plugin).

          Hi, the plugin doesn't do anything to be locale specific, so I'm not surprised it doesn't work. I guess it never has worked. Feel free to submit code changes and I'll be happy to review them for the next release.

          Thanks!
          Cletus

          Cletus D'Souza added a comment - Hi, the plugin doesn't do anything to be locale specific, so I'm not surprised it doesn't work. I guess it never has worked. Feel free to submit code changes and I'll be happy to review them for the next release. Thanks! Cletus

          Martin Hohl added a comment -

          If I change the value of "Default Language" to "en" instead of "en-US" then the SQL exception disappears. It seems that, although the description for this field mentions "Internally, this uses Locale.setDefault()...", one should not think that this accepts the same input as Locale.setDefault(), but only an ISO 639 two-letter language code as documented e.g. in http://www.loc.gov/standards/iso639-2/englangn.html.
          Verified that it also works with "de" and "ro" as "Default Language" (the workaround using an ISO639 code solves the problem for me at least).

          Martin Hohl added a comment - If I change the value of "Default Language" to "en" instead of "en-US" then the SQL exception disappears. It seems that, although the description for this field mentions "Internally, this uses Locale.setDefault()...", one should not think that this accepts the same input as Locale.setDefault(), but only an ISO 639 two-letter language code as documented e.g. in http://www.loc.gov/standards/iso639-2/englangn.html . Verified that it also works with "de" and "ro" as "Default Language" (the workaround using an ISO639 code solves the problem for me at least).

          Martin Hohl added a comment -

          The real problem seems to be that the help for the Locale plugin is insufficent for users, who are not so familiar with the Java API and used to IETF BCP 47 language tags - because they are commonly used in the Windows environment. See http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#toString() for a list of allowed input for Locale.setDefault().

          See also Jenkins issue 21782.

          Martin Hohl added a comment - The real problem seems to be that the help for the Locale plugin is insufficent for users, who are not so familiar with the Java API and used to IETF BCP 47 language tags - because they are commonly used in the Windows environment. See http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#toString( ) for a list of allowed input for Locale.setDefault(). See also Jenkins issue 21782.

          Martin, is the resolution to this problem in the Locale Plugin or did you do something in the Integrity plugin that makes it work for you?

          Thanks!
          Cletus

          Cletus D'Souza added a comment - Martin, is the resolution to this problem in the Locale Plugin or did you do something in the Integrity plugin that makes it work for you? Thanks! Cletus

          Martin Hohl added a comment -

          To avoid use of IETF BCP 47 language tags as language setting for the locale plugin is a sufficient workaround for this problem.

          The real problem IMHO is that a totally misleading SQL exception appears, maybe it could be fixed by introducing a more specific exception handling (e.g. catching the exception for the invalid language setting before the SQL exception can occur).

          Martin Hohl added a comment - To avoid use of IETF BCP 47 language tags as language setting for the locale plugin is a sufficient workaround for this problem. The real problem IMHO is that a totally misleading SQL exception appears, maybe it could be fixed by introducing a more specific exception handling (e.g. catching the exception for the invalid language setting before the SQL exception can occur).

          Thanks for the update Martin! While I agree the SQL exception could be better parsed, as you can see there is not much in the exception itself.

          Unless someone has a code they can contribute to better diagnosing the exception, I'm going to close this issue as I don't have a way to reproduce this problem.

          Cletus D'Souza added a comment - Thanks for the update Martin! While I agree the SQL exception could be better parsed, as you can see there is not much in the exception itself. Unless someone has a code they can contribute to better diagnosing the exception, I'm going to close this issue as I don't have a way to reproduce this problem.

            cdsouza Cletus D'Souza
            xxthunder Karsten Günther
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: