• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • marathon-plugin
    • None

      I get the below strange error when trying to deploy to MESOS.

      The snippet of code looks as follow

      marathon(
      url: 'http://marathon-instance',
      forceUpdate: false,
      appid: 'someid',
      docker: 'mesosphere/jenkins-dev')

      Unfortunalety it fails with below error

      java.lang.NoSuchMethodError: No such DSL method '$' found among steps [acceptGitLabMR, addGitLabMRComment, archive, artifactoryDownload, artifactoryPromoteBuild, artifactoryUpload, bat, build, catchError, checkout, collectEnv, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, envVarsForTool, error, fileExists, getArtifactoryServer, git, gitlabBuilds, gitlabCommitStatus, input, isUnix, load, mail, marathon, milestone, newArtifactoryServer, newBuildInfo, node, parallel, properties, publishBuildInfo, pwd, readFile, readTrusted, retry, script, sh, sleep, sshagent, stage, stash, step, svn, timeout, timestamps, tool, unarchive, unstash, updateGitlabCommitStatus, waitUntil, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, wrap, writeFile, ws] or symbols [all, always, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, cron, crumb, defaultView, demand, disableConcurrentBuilds, downloadSettings, downstream, dumb, envVars, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hyperlink, hyperlinkToModels, installSource, jdk, jdkInstaller, jgit, jnlp, jobDsl, jobName, junit, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nodeProperties, nonStoredPasswordParam, none, paneStatus, parameters, password, pattern, pipelineTriggers, plainText, plugin, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scm, scmRetryCount, search, security, shell, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, viewsTabBar, weather, zfs, zip]
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:145)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:117)
      forceUpdate: false,
      appid: 'someid',
      docker: 'mesosphere/jenkins-dev')

      I can see I have the marathon 1.3.2 plugin installed. However, something appears to be wrong.

      Antoine

          [JENKINS-39653] MARATHON PLUGIN ISSUE

          Colin added a comment -

          The stack trace mentions a dollar sign ($), but I do not see it in your marathon config block. Can you paste more of your pipeline code to help debug?

          Colin added a comment - The stack trace mentions a dollar sign ( $ ), but I do not see it in your marathon config block. Can you paste more of your pipeline code to help debug?

          antoine voiry added a comment - - edited

          Yes that's exactly my issue, if I remove the marathon plugin, I get no issue, as soon as I have it, it fail.
          example 1 will work
          stage 'Docker deploy to MESOS'
          echo 'Docker deploy to MESOS'
          echo "Build number $env.BUILD_NUMBER"
          echo "Changed By $modifiedBy"
          echo "Container Name $dockerContainerName"
          example 2 will not work
          stage 'Docker deploy to MESOS'
          echo 'Docker deploy to MESOS'
          echo "Build number $env.BUILD_NUMBER"
          echo "Changed By $modifiedBy"
          echo "Container Name $dockerContainerName"
          marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'

          Example 3 will also not work
          stage 'Docker deploy to MESOS'
          marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance'
          Here is the full JenkinsFile

          #!groovy

          def gitCommit() {
          sh "git rev-parse HEAD > GIT_COMMIT-${env.BUILD_NUMBER}"
          def gitCommit = readFile("GIT_COMMIT-${env.BUILD_NUMBER}").trim()
          sh "rm f GIT_COMMIT${env.BUILD_NUMBER}"
          return gitCommit
          }

          def gitEmail() {
          sh "git -no-pager show -s --format='%ae' ${gitCommit()} > GIT_EMAIL${env.BUILD_NUMBER}"
          def gitEmail = readFile("GIT_EMAIL-${env.BUILD_NUMBER}").trim()
          sh "rm f GIT_EMAIL${env.BUILD_NUMBER}"
          return gitEmail
          }

          node {

          try {
          stage 'Clean workspace'
          deleteDir()
          stage 'Checkout'
          checkout scm
          docker.withRegistry('https://hub.docker.xxxx/', 'docker_dc_creds') {
          stage 'Build'
          def dockerContainerName = "test:${env.BUILD_NUMBER}"
          def modifiedBy =gitEmail()

          def app = docker.build "${dockerContainerName}"
          if(! env.BRANCH_NAME.startsWith('PR-'))

          { echo "This is branch $env.BRANCH_NAME" stage 'Docker publish' echo 'docker publish' app.push(); stage 'Docker deploy to MESOS' echo 'Docker deploy to MESOS' marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://xxx:8080' }

          // end if(! env.BRANCH_NAME.startsWith('PR-')) {
          }// end docker.withRegistry

          } catch (err) {
          echo 'error, see below error message, Job will be marked as failed'
          echo ${err.message}
          throw err
          }

          }

          antoine voiry added a comment - - edited Yes that's exactly my issue, if I remove the marathon plugin, I get no issue, as soon as I have it, it fail. example 1 will work stage 'Docker deploy to MESOS' echo 'Docker deploy to MESOS' echo "Build number $env.BUILD_NUMBER" echo "Changed By $modifiedBy" echo "Container Name $dockerContainerName" example 2 will not work stage 'Docker deploy to MESOS' echo 'Docker deploy to MESOS' echo "Build number $env.BUILD_NUMBER" echo "Changed By $modifiedBy" echo "Container Name $dockerContainerName" marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance' Example 3 will also not work stage 'Docker deploy to MESOS' marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://marathon-instance' Here is the full JenkinsFile #!groovy def gitCommit() { sh "git rev-parse HEAD > GIT_COMMIT-${env.BUILD_NUMBER}" def gitCommit = readFile("GIT_COMMIT-${env.BUILD_NUMBER}").trim() sh "rm f GIT_COMMIT ${env.BUILD_NUMBER}" return gitCommit } def gitEmail() { sh "git - no-pager show -s --format='%ae' ${gitCommit()} > GIT_EMAIL ${env.BUILD_NUMBER}" def gitEmail = readFile("GIT_EMAIL-${env.BUILD_NUMBER}").trim() sh "rm f GIT_EMAIL ${env.BUILD_NUMBER}" return gitEmail } node { try { stage 'Clean workspace' deleteDir() stage 'Checkout' checkout scm docker.withRegistry('https://hub.docker.xxxx/', 'docker_dc_creds') { stage 'Build' def dockerContainerName = "test:${env.BUILD_NUMBER}" def modifiedBy =gitEmail() def app = docker.build "${dockerContainerName}" if(! env.BRANCH_NAME.startsWith('PR-')) { echo "This is branch $env.BRANCH_NAME" stage 'Docker publish' echo 'docker publish' app.push(); stage 'Docker deploy to MESOS' echo 'Docker deploy to MESOS' marathon appid: 'test', docker: 'test', forceUpdate: true, url: 'http://xxx:8080' } // end if(! env.BRANCH_NAME.startsWith('PR-')) { }// end docker.withRegistry } catch (err) { echo 'error, see below error message, Job will be marked as failed' echo ${err.message} throw err } }

          antoine voiry added a comment -

          It is like if marathon was a variable or command that wasn't existing.

          antoine voiry added a comment - It is like if marathon was a variable or command that wasn't existing.

          Sunil Shah added a comment -

          Sunil Shah added a comment - nimco123 : you can see another example here: https://github.com/mesosphere/cd-demo/blob/master/Jenkinsfile#L58-L66

            colinmsphere Colin
            nimco123 antoine voiry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: