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

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: anchore.call()

XMLWordPrintable

      Plugin works fine when directly used in pipeline script  as below

       

       

      node('some node') {
      stage('Scan Docker Image') {
          imageLine = imageId
          writeFile file: 'anchore_images', text: imageLine
          anchore name: 'anchore_images', inputQueries: [[query: 'list-packages all'], [query: 'list-files        all'], [query: 'cve-scan all'], [query: 'show-pkg-diffs base']]
        }
       }

       

       

      However, when used with shared library script it throws the error

      import groovy.json.JsonSlurper
      def call(body) {
      // evaluate the body block, and collect configuration into the object
      def config = [:]
      body.resolveStrategy = Closure.DELEGATE_FIRST
      body.delegate = config
      body()
      node('some node') {
      stage('Scan Docker Image') {
          imageLine = imageId
          writeFile file: 'anchore_images', text: imageLine
          anchore name: 'anchore_images', inputQueries: [[query: 'list-packages all'], [query: 'list-files        all'], [query: 'cve-scan all'], [query: 'show-pkg-diffs base']]
        }
       }
      }

       

      hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of 
       method: anchore.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:anchore_images, inputQueries:[[query:list-packages all], ...]]]
       Possible solutions: wait(), any(), wait(long), main([Ljava.lang.String, any(groovy.lang.Closure), each(groovy.lang.Closure)

            nurmi Daniel Nurmi
            adityacs Aditya C S
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: