title: hudson.remoting.ProxyException: groovy.lang.MissingPropertyException: No such property: any for class:
body: <p>I have jenkins Declarative pipeline, where I load sub_mudule with Declarative pipeline too.</p>
  <pre><code>#!groovy
  
  def jenkins_ci_examples = [String:Object]
  def secrets_vault = &quot;secrets_vault.groovy&quot;
  def vars=[String:Object];
  
  pipeline {
      agent any
  
      stages{
          stage(&quot;Begin&quot;){
              steps {
                  script {
                      stage(&quot;Checkout&quot;){
                          deleteDir()
                          checkout scm
                          sh &quot;git submodule foreach --recursive git pull origin master&quot;
                      }
                      stage(&quot;import common_vars&quot;) {
                          vars = load &quot;jenkins-ci-examples/vars/common_vars.groovy&quot;
                          jenkins_ci_examples.common_vars = vars.UpdateVars();
                      }
                      stage(&quot;merge common and project_vars&quot;){
                          vars = load &quot;vars/project_vars.groovy&quot;
                          jenkins_ci_examples.project_vars = vars.UpdateVars(&quot;ssh://git@git.com:8080/some/repo.git&quot;, &quot;master&quot;)
                          jenkins_ci_examples.vars = jenkins_ci_examples.common_vars.GetVars()+ jenkins_ci_examples.project_vars.GetVars()
                      }
                      stage(&quot;import template ${secrets_vault}&quot;) {
                          println(&quot;${env.STAGE_NAME}&quot;)
                          currentBuild.displayName = &quot;import template ${secrets_vault}&quot;
                          currentBuild.description = &quot;import template ${secrets_vault}&quot;
                          sh &quot;ls -las; cd jenkins-ci-examples; ls -las&quot;;
                          jenkins_ci_examples.sub_module = load &quot;jenkins-ci-examples/${secrets_vault}&quot;
                      }
                      stage(&quot;run template ${secrets_vault}&quot;) {
                          println(&quot;${env.STAGE_NAME}&quot;)
                          sh &quot;ls -las; cd jenkins-ci-examples; ls -las&quot;;
                jenkins_ci_examples.sub_module.ansible_secrets(jenkins_ci_examples.vars);
                      }
                  }
              }
          }
  
      }
  
  
  }
   
  </code></pre>
  <p>context load secrets_vault.groovy</p>
  <pre><code>def ansibledevops_secrets(HashMap &lt;String,Object&gt; vars)
  {
      def template1 =&quot;spread_sshkeys&quot;
      pipeline {
          agent any
  
          stages {
              stage('Dynamic Stages') {
  
                  steps {
                      script {
                          stage(&quot;import template ${template1}&quot;){
                              println(&quot;${env.STAGE_NAME}&quot;)
                          }
                          stage(&quot;run template ${template1}&quot;){
                              println(&quot;${env.STAGE_NAME}&quot;)
                          }
                      }
                  }
              }
  
          }
      }
  
  
  }
  
  return this
  </code></pre>
  <p>Try run returned error</p>
  <pre><code>hudson.remoting.ProxyException: groovy.lang.MissingPropertyException: No such property: any for class: Script3
  </code></pre>
  <p>But if use scripted pipeline</p>
  <pre><code>node {
                      stage(&quot;Checkout&quot;) {
                          deleteDir()
                          checkout scm
                          sh &quot;git submodule foreach --recursive git pull origin master&quot;
                          print &quot;Result &quot; + vars;
                      }
  }
  </code></pre>
  <p>errors absent.</p>
  <p>Help to solve problem with Declarative pipeline variant.</p>