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

          adityacs Aditya C S created issue -
          adityacs Aditya C S made changes -
          Field Original Value New Value
          Description Plugin works fine when directly used in pipeline script  as below

           

           
          {code:java}
          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']]
            }
           }{code}
           

           

          However, when used with shared library script it throws the error
          {code:java}
          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']]
            }
           }
          }{code}
           
          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)
          Plugin works fine when directly used in pipeline script  as below

           

           
          {code:java}
          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']]
            }
           }{code}
           

           

          However, when used with shared library script it throws the error
          {code:java}
          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']]
            }
           }
          }{code}
           
          {code:java}
          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){code}
          adityacs Aditya C S made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          reardonm Mike Reardon made changes -
          Assignee Daniel Nurmi [ nurmi ] Mike Reardon [ reardonm ]
          reardonm Mike Reardon made changes -
          Assignee Mike Reardon [ reardonm ]
          reardonm Mike Reardon made changes -
          Assignee Daniel Nurmi [ nurmi ]

            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: