We are migrating the jobs from older jenkins environment (version 2.48) to new jenkins environment (2.263), job execution with "jenkinsFile" failed with this below exception, and below is the detail of the jenkinsFile, "basic pipeline" plugin was already installed inthe jenkins yet, its failing. Any solution is appreciated.
#!groovy
pipeline {
agent { label 'acme-label' }
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds()
timestamps()
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Install Dependencies") {
steps {
sh "bundle install --deployment"
}
}
stage("Lint") {
steps {
sh "bundle exec rake"
}
}
}
post {
always {
warnings canRunOnFailed: true, consoleParsers: [[parserName: 'Foodcritic']]
}
failure {
script {
mailer.send('acme')
}
}
}
}
> 11:49:33 java.lang.NoSuchMethodError: No such DSL method 'warnings'
> found among steps [addEmbeddableBadgeConfiguration, ansiColor,
> archive, bat, build, catchError, checkout, checkpoint,
> compareVersions, container, containerLog, copyRemoteArtifacts,
> deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo,
> emailext, emailextrecipients, envVarsForTool, error, fileExists,
> findFiles, getContext, git, httpRequest, input, isUnix, jiraComment,
> jiraIssueSelector, jiraSearch, junit, library, libraryResource, load,
> mail, milestone, node, nodesByLabel, parallel, podTemplate,
> powershell, properties, publishChecks, publishEvent, publishHTML,
> publishIssues, pwd, pwsh, readCSV, readFile, readJSON, readManifest,
> readMavenPom, readProperties, readTrusted, readYaml, recordIssues,
> resolveScm, retry, sauce, sauceconnect, scanForIssues, script, sh,
> sha1, sleep, stage, stash, step, tee, throttle, timeout, timestamps,
> tm, tool, touch, triggerRemoteJob, unarchive, unstable, unstash,
> unzip, validateDeclarativePipeline, waitForQualityGate, waitUntil,
> warnError, withContext, withCredentials, withDockerContainer,
> withDockerRegistry, withDockerServer, withEnv, withMaven, wrap,
> writeCSV, writeFile, writeJSON, writeMavenPom, writeYaml, ws, xunit,
> zip] or symbols [AUnit, BoostTest, CTest, CUnit, Check, CppTest,
> CppUnit, Custom, FPCUnit, GoogleTest, JUnit, MSTest, MbUnit, NUnit2,
> NUnit3, PHPUnit, PVSStudio, QtTest, UnitTest, Valgrind,
> abstractItemDirectoryComponent, acuCobol,
> agentDumpExportTableComponent, agentJVMProcessSystemMetricsComponent,
> agentSystemConfigurationComponent, agentsConfigFileComponent, ajc,
> all, allBranchesSame, allOf, always, androidLintParser,
> anonymizeSupportBundle, ansibleLint, ant, antFromApache, antOutcome,
> antPath, antTarget, any, anyOf, apiToken, architecture,
> archiveArtifacts, armCc, artifactManager, artifactsPublisher,
> authorizationMatrix, aws, awsCredentials, axivion, axivionSuite,
> batchFile, bitbucket, bitbucketBranchDiscovery,
> bitbucketForkDiscovery, bitbucketPublicRepoPullRequestFilter,
> bitbucketPullRequestDiscovery, bitbucketSshCheckout,
> bitbucketTagDiscovery, bitbucketTrustEveryone, bitbucketTrustNobody,
> bitbucketTrustProject, bitbucketTrustTeam,
> bitbucketWebhookConfiguration, bitbucketWebhookRegistration,
> blindlyTrust, booleanParam, branch, brokenBuildSuspects,
> brokenTestsSuspects, buckminster, buildAllBranches, buildAnyBranches,
> buildButton, buildChangeRequests, buildDescription, buildDiscarder,
> buildDiscarders, buildFailureAnalyzer, buildName, buildNamedBranches,
> buildNoneBranches, buildRegularBranches, buildRetention, buildTags,
> buildingTag, cadence, cargo, caseInsensitive, caseSensitive, ccm,
> certificate, changeRequest, changelog, changeset, checkStyle,
> checkoutToSubdirectory, choice, choiceParam, clair, clang,
> clangAnalyzer, clangTidy, cleanWs, clock,
> cloudBeesPipelineTemplatesFolder, cloudBeesRoleBasedAccessControl,
> cmake, cobertura, coberturaAdapter, codeAnalysis, codeNarc, command,
> concordionPublisher, configFile, configFileProvider, configMapVolume,
> containerEnvVar, containerLivenessProbe, containerTemplate, coolflux,
> cpd, cppCheck, cppLint, credentials, cron, crumb, cssLint, cssText,
> cssUrl, culprits, customProbe, default, defaultFolderConfiguration,
> defaultView, demand, dependenciesFingerprintPublisher, detekt,
> developers, diabC, disableConcurrentBuilds, disableResume, docFx,
> docker, dockerCert, dockerLint, dockerServer, dockerTool, dockerfile,
> downstream, doxygen, drMemory, dscanner, dumb, dupFinder,
> durabilityHint, dynamicPVC, eclipse, embUnit, emptyDirVolume,
> emptyDirWorkspaceVolume, envInject, envVar, envVars, envVarsFilter,
> environment, equals, erlc, errorProne, esLint, eventTrigger, exact,
> excludeCategory, excludeFile, excludeMessage, excludeModule,
> excludeNamespace, excludePackage, excludeType, expression, failed,
> faviconUrl, file, fileParam, filePath, findBugs, findbugs,
> findbugsPublisher, fingerprint, fingerprints, flake8, flawfinder,
> flexSdk, frameOptions, freeStyle, freeStyleJob, fromDocker, fromScm,
> fromSource, fromTemplateFactory, fxcop, gcc, gcc3, gcc4, gendarme,
> ghsMulti, git, gitBranchDiscovery, gitHubBranchDiscovery,
> gitHubBranchHeadAuthority, gitHubExcludeArchivedRepositories,
> gitHubExcludePublicRepositories, gitHubForkDiscovery,
> gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery,
> gitHubTopicsFilter, gitHubTrustContributors, gitHubTrustEveryone,
> gitHubTrustNobody, gitHubTrustPermissions, gitTagDiscovery, github,
> githubPush, globalConfigFiles, gnat, gnuFortran, goLint, goVet,
> groovyScript, gtester, hadoLint, headRegexFilter, headWildcardFilter,
> hostPathVolume, hostPathWorkspaceVolume, hyperlink, hyperlinkToModels,
> iar, iarCstat, ibLinter, ideaInspection, includeCategory, includeFile,
> includeMessage, includeModule, includeNamespace, includePackage,
> includeType, infer, inheriting, inheritingGlobal, installSource,
> intel, invalids, invokerPublisher, isRestartedRun, issues,
> istanbulCobertura, istanbulCoberturaAdapter, jacoco, jacocoAdapter,
> jacocoPublisher, java, javaDoc, javadoc, jcReport, jclouds, jdk,
> jdkInstaller, jgit, jgitapache, jgivenPublisher, jmespathQuery, jnlp,
> jobBuildDiscarder, jobDsl, jobName, jsHint, jsLint, jsUrl, jsonEvent,
> junitParser, junitPublisher, junitTestResultStorage, klocWork,
> knownHosts, kotlin, ktLint, kubeconfig, kubernetes,
> kubernetesPodTemplates, label, lastDuration, lastFailure,
> lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM,
> list, local, location, logRotator, loggedInUsersCanDoAnything, mailer,
> manualLaunchOnly, manually, masterBuild,
> masterJVMProcessSystemMetricsComponent,
> masterSystemConfigurationComponent, maven, maven3Mojos, mavenConsole,
> mavenErrors, mavenLinkerPublisher, mavenMojos, mavenWarnings, merge,
> metrowerksCodeWarrior, mineRepository, modelsim, modernSCM, msBuild,
> myPy, myView, nagFortran, namedBranchesDifferent, never,
> newContainerPerStage, nfsVolume, nfsWorkspaceVolume, nioSsh, node,
> nodeProperties, nodeRemoteDirectoryComponent, nonInheriting, none,
> not, onFailure, openTasks, openTasksPublisher, override,
> overrideIndexTriggers, owners, paneStatus, parallelsAlwaysFailFast,
> parameters, passed, password, pattern, pcLint, pep8, perforce,
> perlCritic, permanent, persistentVolumeClaim,
> persistentVolumeClaimWorkspaceVolume, php, phpCodeSniffer, phpStan,
> pipeline-model, pipeline-model-docker, pipelineGraphPublisher,
> pipelineMaven, pipelineTriggers, pit, plainText, plugin, pmdParser,
> podAnnotation, podEnvVar, podLabel, pollSCM, portMapping, prefast,
> preserveStashes, projectNamingStrategy, protoLint, proxy, pruneTags,
> publishCoverage, publishEvent, puppetLint, pyDocStyle, pyLint,
> qacSourceCodeAnalyser, queueItemAuthenticator, quietPeriod, rateLimit,
> rateLimitBuilds, recipients, recordIssues, regex, requestor,
> resharperInspectCode, resourceRoot, retainOnlyVariables, rfLint,
> robocopy, ruboCop, run, runDirectoryComponent, runParam, s3,
> saucePublisher, scala, schedule, scmRetryCount, script,
> scriptApproval, scriptApprovalLink, search, secretEnvVar,
> secretVolume, security, shell, simian, simple-theme-plugin,
> simpleBuildDiscarder, simpleEvent, simpleMatch, skipDefaultCheckout,
> skipStagesAfterUnstable, skipped, slave, snapshotDependencies,
> sonarQube, sourceFiles, sourceRegexFilter, sourceWildcardFilter,
> sphinxBuild, spotBugs, spotbugsPublisher, sshPublicKey,
> sshUserPrivateKey, standard, status, string, stringParam, styleCop,
> sunC, suppressAutomaticTriggering, swapSpace, swiftLint, tag, tagList,
> taskScanner, taskingVx, teamSlugFilter, text, textParam,
> threadDumpsComponent, throttleJobProperty, tiCss, timestamper,
> timestamperConfig, timezone, tmpSpace, tnsdl, toolLocation,
> triggeredBy, trustInitial, tsLint, unsecured, untrusted, upstream,
> upstreamDevelopers, url, usageStatisticsCloudBees, userSeed,
> usernameColonPassword, usernamePassword, viewsTabBar, warningsParsers,
> warningsPlugin, weather, wildcards, withAnt, withAwsCli,
> withSonarQubeEnv, x509ClientCert, xUnitDotNet, xlc, xmlLint, yamlLint,
> yuiCompressor, zfs, zip, zptLint] or globals [btools, currentBuild,
> currentJob, docker, duration, env, generateTestGroup, jenkins, log,
> mailer, mavenBuild, params, pipeline, runTestGroup, scm, shell, slack]
> 11:49:33 at
> org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:202)
> 11:49:33 at
> org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
> 11:49:33 at sun.reflect.GeneratedMethodAccessor1136.invoke(Unknown
> Source) 11:49:33 at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 11:49:33 at java.lang.reflect.Method.invoke(Method.java:498)
> 11:49:33 at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 11:49:33 at
> groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)