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

Avoid duplicate project scans in queue throws error

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • checkmarx-plugin
    • None
    • Jenkins 2.319.1 LTS
      Checkmarx plugin 2022.1.2

      Has something changed with checkmarx plugin newer versions in terms of error handling related to duplicate scans ?

      We are passing avoidDuplicateProjectScans: true through pipeline to avoid flooding checkmarx server with too many requests and expecting that Checkmarx plugin will simply not send a new request to server if same project scan is already in progress. However, this does not appear to work anymore with latest version. The moment plugin detects a duplicate scan, it throws and error, and fails the build.

      Wrapping the execution around catchError does not help either.

      On the pipeline syntax page, description says - "If there is a scan of this project in the queue in status working or queued do not send a new scan request to Checkmarx" . It does not say that this will cause build failure.

          [JENKINS-67599] Avoid duplicate project scans in queue throws error

          richmond  This behavior has not changed in long time.  It is correct that the behavior and the documentation of the parameter are not matching. We will fix this behavior to allow job to complete gracefully if it finds duplicate scan when this flag is set to true. 

          Meantime,  Under global section , 'Continue when timed out' can be enabled to achieve same outcome.

          Checkmarx Administrator added a comment - richmond   This behavior has not changed in long time.  It is correct that the behavior and the documentation of the parameter are not matching. We will fix this behavior to allow job to complete gracefully if it finds duplicate scan when this flag is set to true.  Meantime,  Under global section , 'Continue when timed out' can be enabled to achieve same outcome.

          Rich added a comment - - edited

          cxadmin I believe the global 'Continue when timed out' applies to freestyle jobs. We are using a pipeline script, what parameter/value should be used ? Note that the pipeline syntax generator for checkmarx plugin does not display any such option.

          Rich added a comment - - edited cxadmin  I believe the global 'Continue when timed out' applies to freestyle jobs. We are using a pipeline script, what parameter/value should be used ? Note that the pipeline syntax generator for checkmarx plugin does not display any such option.

          Yes, its a global parameter and will be honored even for pipeline jobs. 

          Checkmarx Administrator added a comment - Yes, its a global parameter and will be honored even for pipeline jobs. 

          Rich added a comment -

          Thanks for the workaround. It worked.

          Rich added a comment - Thanks for the workaround. It worked.

            sergeyk Sergey Kadaner
            richmond Rich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: