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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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)

        Attachments

          Activity

          Hide
          adityacs Aditya C S added a comment -

          It was my mistake. I had kept a groovy file by name anchore.groovy. So, Jenkins pipeline script was referring to this groovy. Solved by renaming the file.

          Show
          adityacs Aditya C S added a comment - It was my mistake. I had kept a groovy file by name anchore.groovy. So, Jenkins pipeline script was referring to this groovy. Solved by renaming the file.
          Hide
          nurmi Daniel Nurmi added a comment -

          Thank you Aditya!  We just started investigating, thank you very much for responding and resolving the ticket.

          -D

          Show
          nurmi Daniel Nurmi added a comment - Thank you Aditya!  We just started investigating, thank you very much for responding and resolving the ticket. -D

            People

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

              Dates

              Created:
              Updated:
              Resolved: