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

BZ 101359 - Command line parsing failed: Unclosed single-quoted string (with Gradle plugin)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • coverity-plugin
    • Jenkins 1.651.3, Build now with coverity analysis Windows server 2013 R2. Coverity Analysis ver 8.7.1, Coverity-Plugin ver 1.8.1

      This is similar to JenkinsJENKINS-38624
      BZ 94839 - MSBuild Projects no longer work after upgrading to 1.8.0 (https://issues.jenkins-ci.org/browse/JENKINS-38624) which was answered as fixed in version 1.8.1 of the coverity plugin, but this is with gradle instead of MSBuild.

      [Gradle] - Launching build.
      ERROR: Build step failed with exception
      java.lang.RuntimeException: Command line parsing failed: Unclosed single-quoted string.
      at jenkins.plugins.coverity.CoverityUtils.evaluateEnvVars(CoverityUtils.java:146)
      at jenkins.plugins.coverity.CoverityUtils.prepareCmds(CoverityUtils.java:196)
      at jenkins.plugins.coverity.CoverityLauncherDecorator$DecoratedLauncher.launch(CoverityLauncherDecorator.java:356)
      at hudson.Launcher$ProcStarter.start(Launcher.java:381)
      at hudson.Launcher$ProcStarter.join(Launcher.java:388)
      at hudson.plugins.gradle.Gradle.performTask(Gradle.java:294)
      at hudson.plugins.gradle.Gradle.perform(Gradle.java:152)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Build step 'Invoke Gradle script' marked build as failure

          [JENKINS-42308] BZ 101359 - Command line parsing failed: Unclosed single-quoted string (with Gradle plugin)

          John Flynn added a comment -

          It appears that the 'useAdvancedParser' - "Use advanced parsing mechanism" is always true.

          John Flynn added a comment - It appears that the 'useAdvancedParser' - "Use advanced parsing mechanism" is always true.

          Joel Briggs added a comment -

          John, could you elaborate on the 'useAdvancedParser' setting? are you saying regardless of the job configuration it is true?

          If it's possible for you to share the job config with a sample build build step whcih can reproduce that would help.

          Thanks,
          Joel

          Joel Briggs added a comment - John, could you elaborate on the 'useAdvancedParser' setting? are you saying regardless of the job configuration it is true? If it's possible for you to share the job config with a sample build build step whcih can reproduce that would help. Thanks, Joel

          John Flynn added a comment -

          Hi Joel,

          The "Use advanced parsing mechanism" option is not checked. Looking at the plugin code, it appears that if that is false, the code where the error is occurring should not have been called.

          Here is the coverity section of the config.xml

          <jenkins.plugins.coverity.CoverityPublisher plugin="coverity@1.8.1">
          <cimStreams>
          <jenkins.plugins.coverity.CIMStream>
          <instance>Coverity</instance>
          <project>CDCL_master_analysis</project>
          <stream>CDCL_master_analysis</stream>
          <id>1815448175</id>
          <language>ALL</language>
          <streamName/>
          <defectFilters>...</defectFilters>
          </jenkins.plugins.coverity.CIMStream>
          </cimStreams>
          <invocationAssistance>
          <javaWarFilesNames/>
          <csharpAutomaticAssemblies>false</csharpAutomaticAssemblies>
          <csharpMsvsca>false</csharpMsvsca>
          <isUsingMisra>false</isUsingMisra>
          <isCompiledSrc>false</isCompiledSrc>
          <isScriptSrc>false</isScriptSrc>
          <isUsingPostCovBuildCmd>false</isUsingPostCovBuildCmd>
          <isUsingPostCovAnalyzeCmd>false</isUsingPostCovAnalyzeCmd>
          <useAdvancedParser>false</useAdvancedParser>
          </invocationAssistance>
          <failBuild>false</failBuild>
          <unstable>false</unstable>
          <keepIntDir>false</keepIntDir>
          <skipFetchingDefects>false</skipFetchingDefects>
          <hideChart>false</hideChart>
          <unstableBuild>false</unstableBuild>
          </jenkins.plugins.coverity.CoverityPublisher>

          Thanks,
          John

          John Flynn added a comment - Hi Joel, The "Use advanced parsing mechanism" option is not checked. Looking at the plugin code, it appears that if that is false, the code where the error is occurring should not have been called. Here is the coverity section of the config.xml <jenkins.plugins.coverity.CoverityPublisher plugin="coverity@1.8.1"> <cimStreams> <jenkins.plugins.coverity.CIMStream> <instance>Coverity</instance> <project>CDCL_master_analysis</project> <stream>CDCL_master_analysis</stream> <id>1815448175</id> <language>ALL</language> <streamName/> <defectFilters>...</defectFilters> </jenkins.plugins.coverity.CIMStream> </cimStreams> <invocationAssistance> <javaWarFilesNames/> <csharpAutomaticAssemblies>false</csharpAutomaticAssemblies> <csharpMsvsca>false</csharpMsvsca> <isUsingMisra>false</isUsingMisra> <isCompiledSrc>false</isCompiledSrc> <isScriptSrc>false</isScriptSrc> <isUsingPostCovBuildCmd>false</isUsingPostCovBuildCmd> <isUsingPostCovAnalyzeCmd>false</isUsingPostCovAnalyzeCmd> <useAdvancedParser>false</useAdvancedParser> </invocationAssistance> <failBuild>false</failBuild> <unstable>false</unstable> <keepIntDir>false</keepIntDir> <skipFetchingDefects>false</skipFetchingDefects> <hideChart>false</hideChart> <unstableBuild>false</unstableBuild> </jenkins.plugins.coverity.CoverityPublisher> Thanks, John

          Joel Briggs added a comment -

          I found the issue was when logging the build command (to console output), the CoverityLauncher was always using the "advanced parsing" flag as true. Additionally, I realized JENKINS-38624 was incorrectly closed (we asumed the existing windows env. var issues were causing that issue.

          Both should be addressed in the upcoming release.

          Joel Briggs added a comment - I found the issue was when logging the build command (to console output), the CoverityLauncher was always using the "advanced parsing" flag as true. Additionally, I realized JENKINS-38624 was incorrectly closed (we asumed the existing windows env. var issues were causing that issue. Both should be addressed in the upcoming release.

          Joel Briggs added a comment -

          Fixed in 1.9.0

          Joel Briggs added a comment - Fixed in 1.9.0

            jbriggs Joel Briggs
            jflynn John Flynn
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: