fabric8io / jenkins-pipeline-library

a collection of reusable jenkins pipelines and pipeline functions
Apache License 2.0
276 stars 180 forks source link

deployment nodejs failed #192

Open opotmans opened 7 years ago

opotmans commented 7 years ago

Hello,

I'm testing all the versions of your wonderful tool :-) and I'm blocked in the deployment of an app based on nodejs microservices. I work with openshift 1.3 and the last version of fabric8 (0.4.121) and the associated containers. The deployment process works and failed just after the push of the images on the docker registry The error message is : Java.lang.NoSuchMethodError: No such DSL method 'getDeploymentResources' found among steps I checked on your web site/google for this issue and don't find anything about the problem except that this method has replaced the method "getKubernetesJson.groovy " which is deprecated. Maybe a plugin of Jenkins is not present in the docker image provided for fabric8 : fabric8/jenkins-docker:2.2.311? Just to be sure I also updated the plugins of Jenkins but didn't install the last version 2.32.2. Is it required? I also made the same test with a go microservice app and I have the same problem.

Could you please support me in the troubleshooting of this issue

Thanks for your support

Olivier


Here is the extract of the logs generated by Jenkins during the process. As you see the container is built and just after we have error message. Started by user anonymous

/usr/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 4baa2184874d4ab84732f74ddfb1a887077234bc (refs/remotes/origin/master) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f 4baa2184874d4ab84732f74ddfb1a887077234bc /usr/bin/git rev-list 4baa2184874d4ab84732f74ddfb1a887077234bc # timeout=10 Loading library github.com/fabric8io/fabric8-pipeline-library@v2.2.311 Creating git repository in /var/jenkins_home/caches/git-a328a55fee5293c8cf80d5616db2c459 /usr/bin/git init /var/jenkins_home/caches/git-a328a55fee5293c8cf80d5616db2c459 # timeout=10 Setting origin to https://github.com/fabric8io/fabric8-pipeline-library.git /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10 Fetching origin... Fetching upstream changes from origin /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress origin +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse v2.2.311^{commit} # timeout=10 /usr/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10 Fetching upstream changes from https://github.com/fabric8io/fabric8-pipeline-library.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress https://github.com/fabric8io/fabric8-pipeline-library.git +refs/heads/:refs/remotes/origin/ Checking out Revision d8af29f8af7a498331a244d245fb321003ef110d (v2.2.311) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f d8af29f8af7a498331a244d245fb321003ef110d /usr/bin/git rev-list d8af29f8af7a498331a244d245fb321003ef110d # timeout=10 [Pipeline] echo Runnning on openshift so using S2I binary source and Docker strategy [Pipeline] podTemplate [Pipeline] { [Pipeline] node Running on kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138 in /home/jenkins/workspace/nodejs123 [Pipeline] { [Pipeline] git Cloning the remote Git repository Cloning repository http://gogs/gogsadmin/nodejs123.git /usr/bin/git init /home/jenkins/workspace/nodejs123 # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git # timeout=10 /usr/bin/git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 4baa2184874d4ab84732f74ddfb1a887077234bc (refs/remotes/origin/master) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f 4baa2184874d4ab84732f74ddfb1a887077234bc /usr/bin/git branch -a -v --no-abbrev # timeout=10 /usr/bin/git checkout -b master 4baa2184874d4ab84732f74ddfb1a887077234bc [Pipeline] stage (Canary release) Using the ‘stage’ step without a block argument is deprecated Entering stage Canary release Proceeding [Pipeline] echo NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node [Pipeline] fileExists [Pipeline] writeFile [Pipeline] container [Pipeline] { [Pipeline] echo NOTE: until we support pushing tags to remote repos with correct secrets lets default to use the short commit sha as the version [Pipeline] sh [nodejs123] Running shell script Executing shell script inside container [clients] of pod [kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138] Executing command: sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' cd /home/jenkins/workspace/nodejs123 sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' exit [?1034hsh-4.2# cd /home/jenkins/workspace/nodejs123 sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/ pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc ' /home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenki ns/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/worksp ace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/wo rkspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' sh-4.2# exit exit

  • git rev-parse --short HEAD [Pipeline] echo using new version 4baa218 [Pipeline] kubernetesApply Adapting resources to use pull images from registry: 172.30.147.67:5000 About to apply resource[ImageStream(apiVersion=v1, kind=ImageStream, metadata=ObjectMeta(annotations=null, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=nodejs123, namespace=default, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=null, status=null, additionalProperties={})] [Pipeline] kubernetesApply Adapting resources to use pull images from registry: 172.30.147.67:5000 About to apply resource[BuildConfig(apiVersion=v1, kind=BuildConfig, metadata=ObjectMeta(annotations=null, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=nodejs123-s2i, namespace=default, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=BuildConfigSpec(completionDeadlineSeconds=null, output=BuildOutput(pushSecret=null, to=ObjectReference(apiVersion=null, fieldPath=null, kind=ImageStreamTag, name=nodejs123:4baa218, namespace=null, resourceVersion=null, uid=null, additionalProperties={}), additionalProperties={}), postCommit=null, resources=null, revision=null, runPolicy=Serial, serviceAccount=null, source=BuildSource(binary=null, contextDir=null, dockerfile=null, git=null, images=[], secrets=[], sourceSecret=null, type=Binary, additionalProperties={}), strategy=BuildStrategy(customStrategy=null, dockerStrategy=null, jenkinsPipelineStrategy=null, sourceStrategy=null, type=Docker, additionalProperties={}), triggers=[], additionalProperties={}), status=null, additionalProperties={})] [Pipeline] sh [nodejs123] Running shell script Executing shell script inside container [clients] of pod [kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138] Executing command: sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt' cd /home/jenkins/workspace/nodejs123 sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt' exit [?1034hsh-4.2# cd /home/jenkins/workspace/nodejs123 sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/ pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc ' /home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenki ns/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/h ome/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt'
  • oc start-build nodejs123-s2i --from-dir ../nodejs123 --follow -n default Uploading "../nodejs123" at commit "HEAD" as binary input for the build ... Uploading directory "../nodejs123" as binary input for the build ... nodejs123-s2i-4 Receiving source from STDIN as archive ... Step 1 : FROM node:5.3-onbuild # Executing 3 build triggers... Step 1 : COPY package.json /usr/src/app/ ---> Using cache Step 1 : RUN npm install ---> Using cache Step 1 : COPY . /usr/src/app ---> 58a103dd029a Removing intermediate container 3ca2b63ee3cf Step 2 : ENV "OPENSHIFT_BUILD_NAME" "nodejs123-s2i-4" "OPENSHIFT_BUILD_NAMESPACE" "default" ---> Running in 92a3c3b9e629 ---> b37b01eba0de Removing intermediate container 92a3c3b9e629 Successfully built b37b01eba0de Pushing image 172.30.147.67:5000/default/nodejs123:4baa218 ... Pushed 2/11 layers, 18% complete Pushed 3/11 layers, 27% complete Pushed 4/11 layers, 36% complete Pushed 5/11 layers, 45% complete Pushed 6/11 layers, 55% complete Pushed 7/11 layers, 64% complete Pushed 8/11 layers, 73% complete Pushed 9/11 layers, 82% complete Pushed 10/11 layers, 91% complete Pushed 11/11 layers, 100% complete Push successful sh-4.2# exit

exit [Pipeline] } [Pipeline] // container [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // podTemplate [Pipeline] End of Pipeline java.lang.NoSuchMethodError: No such DSL method 'getDeploymentResources' found among steps [acceptGitLabMR, addGitLabMRComment, approveReceivedEvent, approveRequestedEvent, archive, bat, build, buildImage, catchError, checkout, container, createEvent, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerLabel, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findFiles, getContext, git, gitlabBuilds, gitlabCommitStatus, hubot, hubotApprove, hubotProject, input, isUnix, kubernetesApply, libraryResource, load, mail, milestone, node, parallel, parameterOrDefault, podTemplate, properties, pushImage, pwd, readFile, readManifest, readMavenPom, readProperties, readTrusted, readYaml, retry, script, sh, sleep, stage, stash, step, svn, tagImage, timeout, timestamps, tool, touch, unarchive, unstash, unzip, updateGitlabCommitStatus, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withPod, wrap, writeFile, writeMavenPom, ws, zip] or symbols [all, always, ant, antFromApache, antOutcome, antTarget, any, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, branch, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, configMapVolume, containerEnvVar, containerTemplate, cron, crumb, defaultView, demand, disableConcurrentBuilds, docker, dockerfile, downloadSettings, downstream, dumb, emptyDirVolume, envVars, environment, expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hostPathVolume, hyperlink, hyperlinkToModels, installSource, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobName, junit, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nfsVolume, nodeProperties, nonStoredPasswordParam, none, overrideIndexTriggers, paneStatus, parameters, password, pattern, persistentVolumeClaim, pipeline-model, pipelineTriggers, plainText, plugin, podEnvVar, pollSCM, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scmRetryCount, search, secretVolume, security, shell, skipDefaultCheckout, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, usernameColonPassword, usernamePassword, viewsTabBar, weather, zfs, zip] or globals [approve, bumpFabric8Versions, clientsNode, clientsTemplate, combineTemplates, currentBuild, deleteGitHubBranch, deployProject, deployRemoteKubernetes, deployRemoteOpenShift, docker, dockerNode, dockerTemplate, dropProject, dropRelease, env, genWebsiteDocs, getKubernetesJson, getNewVersion, gitTag, goNode, goRelease, goTemplate, kubernetes, mavenCanaryRelease, mavenIntegrationTest, mavenNode, mavenTemplate, mavenUpdateOrganisationDependencies, mergeAndWaitForPullRequest, params, performCanaryRelease, pipeline, promoteArtifacts, promoteImages, pushParentPomVersionChangePR, pushPomPropertyChangePR, pushPomPropertyChangePROrganisation, releaseNode, releaseProject, releaseTemplate, restGetURL, runSystemTests, scm, stageExtraImages, stageProject, tagImages, updatePropertyVersion, waitUntilArtifactSyncedWithCentral, waitUntilPullRequestMerged]

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:149)

at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)

at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)

at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)

at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)

at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)

at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)

at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)

at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)

at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)

at WorkflowScript.run(WorkflowScript:18)

at clientsNode.call(/var/jenkins_home/jobs/nodejs123/builds/4/libs/github.com/fabric8io/fabric8-pipeline-library/vars/clientsNode.groovy:9)

at cps.transform(Native Method)

at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)

at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)

at com.cloudbees.groovy.cps.Next.step(Next.java:58)

at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)

at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)

at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)

at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)

at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Finished: FAILURE

rawlingsj commented 7 years ago

What does your Jenkinsfile look like? It should be like this which matches the same release version as the shared pipeline library in your logs below https://github.com/fabric8io/fabric8-jenkinsfile-library/blob/v2.2.311/node/CanaryReleaseStage/Jenkinsfile#L18 https://github.com/fabric8io/fabric8-jenkinsfile-library/blob/v2.2.311/node/CanaryReleaseStage/Jenkinsfile#L18

That Jenkinsfile still uses the old getKubernetesJson() so that should work.

On 11 Mar 2017, at 13:05, opotmans notifications@github.com wrote:

Hello,

I'm testing all the versions of your wonderful tool :-) and I'm blocked in the deployment of an app based on nodejs microservices. I work with openshift 1.3 and the last version of fabric8 (0.4.121) and the associated containers. The deployment process works and failed just after the push of the images on the docker registry The error message is : Java.lang.NoSuchMethodError: No such DSL method 'getDeploymentResources' found among steps I checked on your web site/google for this issue and don't find anything about the problem except that this method has replaced the method "getKubernetesJson.groovy " which is deprecated. Maybe a plugin of Jenkins is not present in the docker image provided for fabric8 : fabric8/jenkins-docker:2.2.311? Just to be sure I also updated the plugins of Jenkins but didn't install the last version 2.32.2. Is it required? I also made the same test with a go microservice app and I have the same problem.

Could you please support me in the troubleshooting of this issue

Thanks for your support

Olivier

Here is the extract of the logs generated by Jenkins during the process. As you see the container is built and just after we have error message. Started by user anonymous

/usr/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 4baa2184874d4ab84732f74ddfb1a887077234bc (refs/remotes/origin/master) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f 4baa2184874d4ab84732f74ddfb1a887077234bc /usr/bin/git rev-list 4baa2184874d4ab84732f74ddfb1a887077234bc # timeout=10 Loading library github.com/fabric8io/fabric8-pipeline-library@v2.2.311 Creating git repository in /var/jenkins_home/caches/git-a328a55fee5293c8cf80d5616db2c459 /usr/bin/git init /var/jenkins_home/caches/git-a328a55fee5293c8cf80d5616db2c459 # timeout=10 Setting origin to https://github.com/fabric8io/fabric8-pipeline-library.git https://github.com/fabric8io/fabric8-pipeline-library.git /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10 Fetching origin... Fetching upstream changes from origin /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress origin +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse v2.2.311^{commit} # timeout=10 /usr/bin/git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10 Fetching upstream changes from https://github.com/fabric8io/fabric8-pipeline-library.git https://github.com/fabric8io/fabric8-pipeline-library.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress https://github.com/fabric8io/fabric8-pipeline-library.git https://github.com/fabric8io/fabric8-pipeline-library.git +refs/heads/:refs/remotes/origin/ Checking out Revision d8af29f8af7a498331a244d245fb321003ef110d (v2.2.311) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f d8af29f8af7a498331a244d245fb321003ef110d /usr/bin/git rev-list d8af29f8af7a498331a244d245fb321003ef110d # timeout=10 [Pipeline] echo Runnning on openshift so using S2I binary source and Docker strategy [Pipeline] podTemplate [Pipeline] { [Pipeline] node Running on kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138 in /home/jenkins/workspace/nodejs123 [Pipeline] { [Pipeline] git Cloning the remote Git repository Cloning repository http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git /usr/bin/git init /home/jenkins/workspace/nodejs123 # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git /usr/bin/git --version # timeout=10 /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git # timeout=10 /usr/bin/git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 /usr/bin/git config remote.origin.url http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git # timeout=10 Fetching upstream changes from http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git /usr/bin/git fetch --tags --progress http://gogs/gogsadmin/nodejs123.git http://gogs/gogsadmin/nodejs123.git +refs/heads/:refs/remotes/origin/ /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 4baa2184874d4ab84732f74ddfb1a887077234bc (refs/remotes/origin/master) /usr/bin/git config core.sparsecheckout # timeout=10 /usr/bin/git checkout -f 4baa2184874d4ab84732f74ddfb1a887077234bc /usr/bin/git branch -a -v --no-abbrev # timeout=10 /usr/bin/git checkout -b master 4baa2184874d4ab84732f74ddfb1a887077234bc [Pipeline] stage (Canary release) Using the ‘stage’ step without a block argument is deprecated Entering stage Canary release Proceeding [Pipeline] echo NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node [Pipeline] fileExists [Pipeline] writeFile [Pipeline] container [Pipeline] { [Pipeline] echo NOTE: until we support pushing tags to remote repos with correct secrets lets default to use the short commit sha as the version [Pipeline] sh [nodejs123] Running shell script Executing shell script inside container [clients] of pod [kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138] Executing command: sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' cd /home/jenkins/workspace/nodejs123 sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' exit �[?1034hsh-4.2# cd /home/jenkins/workspace/nodejs123 sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/ pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc ' /home/jenkins/workspace/nodejs123@tmp/durable-f2e320f9/script.sh' > '/home/jenki ns/workspace/nodejs123@tmp/durable-f2e320f9/output.txt' 2> '/home/jenkins/worksp ace/nodejs123@tmp/durable-f2e320f9/jenkins-log.txt'; echo $? > '/home/jenkins/wo rkspace/nodejs123@tmp/durable-f2e320f9/jenkins-result.txt' sh-4.2# exit exit

git rev-parse --short HEAD [Pipeline] echo using new version 4baa218 [Pipeline] kubernetesApply Adapting resources to use pull images from registry: 172.30.147.67:5000 About to apply resource[ImageStream(apiVersion=v1, kind=ImageStream, metadata=ObjectMeta(annotations=null, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=nodejs123, namespace=default, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=null, status=null, additionalProperties={})] [Pipeline] kubernetesApply Adapting resources to use pull images from registry: 172.30.147.67:5000 About to apply resource[BuildConfig(apiVersion=v1, kind=BuildConfig, metadata=ObjectMeta(annotations=null, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, labels=null, name=nodejs123-s2i, namespace=default, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=BuildConfigSpec(completionDeadlineSeconds=null, output=BuildOutput(pushSecret=null, to=ObjectReference(apiVersion=null, fieldPath=null, kind=ImageStreamTag, name=nodejs123:4baa218, namespace=null, resourceVersion=null, uid=null, additionalProperties={}), additionalProperties={}), postCommit=null, resources=null, revision=null, runPolicy=Serial, serviceAccount=null, source=BuildSource(binary=null, contextDir=null, dockerfile=null, git=null, images=[], secrets=[], sourceSecret=null, type=Binary, additionalProperties={}), strategy=BuildStrategy(customStrategy=null, dockerStrategy=null, jenkinsPipelineStrategy=null, sourceStrategy=null, type=Docker, additionalProperties={}), triggers=[], additionalProperties={}), status=null, additionalProperties={})] [Pipeline] sh [nodejs123] Running shell script Executing shell script inside container [clients] of pod [kubernetes-b66e2b46f94c454195c4be13e3943abc-123fa5813138] Executing command: sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt' cd /home/jenkins/workspace/nodejs123 sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt' exit �[?1034hsh-4.2# cd /home/jenkins/workspace/nodejs123 sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/nodejs123@tmp/durable-c4529868/ pid'; jsc=durable-270264ced4cf6f7e147fa1486b7a9636; JENKINS_SERVER_COOKIE=$jsc ' /home/jenkins/workspace/nodejs123@tmp/durable-c4529868/script.sh' > '/home/jenki ns/workspace/nodejs123@tmp/durable-c4529868/jenkins-log.txt' 2>&1; echo $? > '/h ome/jenkins/workspace/nodejs123@tmp/durable-c4529868/jenkins-result.txt' oc start-build nodejs123-s2i --from-dir ../nodejs123 --follow -n default Uploading "../nodejs123" at commit "HEAD" as binary input for the build ... Uploading directory "../nodejs123" as binary input for the build ... nodejs123-s2i-4 Receiving source from STDIN as archive ... Step 1 : FROM node:5.3-onbuild �[91m# Executing 3 build triggers... �[0mStep 1 : COPY package.json /usr/src/app/ ---> Using cache Step 1 : RUN npm install ---> Using cache Step 1 : COPY . /usr/src/app ---> 58a103dd029a Removing intermediate container 3ca2b63ee3cf Step 2 : ENV "OPENSHIFT_BUILD_NAME" "nodejs123-s2i-4" "OPENSHIFT_BUILD_NAMESPACE" "default" ---> Running in 92a3c3b9e629 ---> b37b01eba0de Removing intermediate container 92a3c3b9e629 Successfully built b37b01eba0de Pushing image 172.30.147.67:5000/default/nodejs123:4baa218 ... Pushed 2/11 layers, 18% complete Pushed 3/11 layers, 27% complete Pushed 4/11 layers, 36% complete Pushed 5/11 layers, 45% complete Pushed 6/11 layers, 55% complete Pushed 7/11 layers, 64% complete Pushed 8/11 layers, 73% complete Pushed 9/11 layers, 82% complete Pushed 10/11 layers, 91% complete Pushed 11/11 layers, 100% complete Push successful sh-4.2# exit exit [Pipeline] } [Pipeline] // container [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // podTemplate [Pipeline] End of Pipeline java.lang.NoSuchMethodError: No such DSL method 'getDeploymentResources' found among steps [acceptGitLabMR, addGitLabMRComment, approveReceivedEvent, approveRequestedEvent, archive, bat, build, buildImage, catchError, checkout, container, createEvent, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerLabel, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findFiles, getContext, git, gitlabBuilds, gitlabCommitStatus, hubot, hubotApprove, hubotProject, input, isUnix, kubernetesApply, libraryResource, load, mail, milestone, node, parallel, parameterOrDefault, podTemplate, properties, pushImage, pwd, readFile, readManifest, readMavenPom, readProperties, readTrusted, readYaml, retry, script, sh, sleep, stage, stash, step, svn, tagImage, timeout, timestamps, tool, touch, unarchive, unstash, unzip, updateGitlabCommitStatus, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withPod, wrap, writeFile, writeMavenPom, ws, zip] or symbols [all, always, ant, antFromApache, antOutcome, antTarget, any, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, branch, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, configMapVolume, containerEnvVar, containerTemplate, cron, crumb, defaultView, demand, disableConcurrentBuilds, docker, dockerfile, downloadSettings, downstream, dumb, emptyDirVolume, envVars, environment, expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hostPathVolume, hyperlink, hyperlinkToModels, installSource, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobName, junit, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nfsVolume, nodeProperties, nonStoredPasswordParam, none, overrideIndexTriggers, paneStatus, parameters, password, pattern, persistentVolumeClaim, pipeline-model, pipelineTriggers, plainText, plugin, podEnvVar, pollSCM, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scmRetryCount, search, secretVolume, security, shell, skipDefaultCheckout, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, usernameColonPassword, usernamePassword, viewsTabBar, weather, zfs, zip] or globals [approve, bumpFabric8Versions, clientsNode, clientsTemplate, combineTemplates, currentBuild, deleteGitHubBranch, deployProject, deployRemoteKubernetes, deployRemoteOpenShift, docker, dockerNode, dockerTemplate, dropProject, dropRelease, env, genWebsiteDocs, getKubernetesJson, getNewVersion, gitTag, goNode, goRelease, goTemplate, kubernetes, mavenCanaryRelease, mavenIntegrationTest, mavenNode, mavenTemplate, mavenUpdateOrganisationDependencies, mergeAndWaitForPullRequest, params, performCanaryRelease, pipeline, promoteArtifacts, promoteImages, pushParentPomVersionChangePR, pushPomPropertyChangePR, pushPomPropertyChangePROrganisation, releaseNode, releaseProject, releaseTemplate, restGetURL, runSystemTests, scm, stageExtraImages, stageProject, tagImages, updatePropertyVersion, waitUntilArtifactSyncedWithCentral, waitUntilPullRequestMerged]

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:149)

at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)

at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)

at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)

at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)

at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)

at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)

at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)

at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)

at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)

at WorkflowScript.run(WorkflowScript:18)

at clientsNode.call(/var/jenkins_home/jobs/nodejs123/builds/4/libs/github.com/fabric8io/fabric8-pipeline-library/vars/clientsNode.groovy:9)

at cps.transform(Native Method)

at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)

at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)

at com.cloudbees.groovy.cps.Next.step(Next.java:58)

at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)

at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)

at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)

at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)

at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Finished: FAILURE

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fabric8io/jenkins-pipeline-library/issues/192, or mute the thread https://github.com/notifications/unsubscribe-auth/ABY8HKniCZDU9Dw5p9YwlL695SlcMFbyks5rkpwcgaJpZM4MaMtW.

opotmans commented 7 years ago

Hello, Here is the Jenkins file extracted from Jenkis container in /var/jenkins_home/workspace/nodejs123@script : $ more Jenkinsfile

!/usr/bin/groovy

@Library('github.com/fabric8io/fabric8-pipeline-library@v2.2.311')
def utils = new io.fabric8.Utils()
clientsNode{
def envStage = utils.environmentNamespace('staging')
def newVersion = ''

git 'http://gogs/gogsadmin/nodejs123.git'

stage 'Canary release'
echo 'NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node'
if (!fileExists ('Dockerfile')) {
writeFile file: 'Dockerfile', text: 'FROM node:5.3-onbuild'
}

newVersion = performCanaryRelease {}

def rc = getDeploymentResources {
port = 8080
label = 'nodejs'
icon = 'https://cdn.rawgit.com/fabric8io/fabric8/dc05040/website/src/images/logos/nodejs.svg'
version = newVersion
imageName = clusterImageName
}

stage 'Rollout Staging'
kubernetesApply(file: rc, environment: envStage)

}
but if I compare with the file on the url that you sent to me (This seems to be the same version confirmed by the second line : @Library('github.com/fabric8io/fabric8-pipeline-library@v2.2.311') ), I have exactly the same file except the method getDeploymentRessources which is replaced by getKubernetesJson. So my question (for my understanding) what did I make wrong? Do I forgot to install an additional library ?(where is located the method getDeploymentRessources ?) Which library has this method? I also confirm you that when I replace the method getDeploymentRessources by getDeploymentRessources in jenkinsfile in the Jenkins container, it works! the problem is then there...

thanks for your support Olivier