-
Bug
-
Resolution: Not A Defect
-
Blocker
-
None
-
Jenkins version: Jenkins 2.319.2
Pipeline
2.6
Pipeline Graph Analysis
1.10
Pipeline: API
1136.v7f5f1759dc16
Pipeline: Basic Steps
2.24
Pipeline: Build Step
2.15
Pipeline: Declarative
1.9.3
Pipeline: Declarative Extension Points API
1.9.3
Pipeline: GitHub Groovy Libraries
1.0
Pipeline: Groovy
2648.va9433432b33c
Pipeline: Input Step
446.vf27b_0b_83500e
Pipeline: Job
1145.v7f2433caa07f
Pipeline: Milestone Step
1.3.1
Pipeline: Model API
1.9.3
Pipeline: Multibranch
2.24
Pipeline: Nodes and Processes
2.40
Pipeline: REST API Plugin
2.21
Pipeline: SCM Step
2.13
Pipeline: Shared Groovy Libraries
552.vd9cc05b8a2e1
Pipeline: Stage Step
291.vf0a8a7aeeb50
Pipeline: Stage Tags Metadata
1.9.3
Pipeline: Stage View Plugin
2.21
Pipeline: Step API
622.vb_8e7c15b_c95a_
Pipeline: Supporting APIs
813.vb_d7c3d2984a_0
Jenkins version: Jenkins 2.319.2 Pipeline 2.6 Pipeline Graph Analysis 1.10 Pipeline: API 1136.v7f5f1759dc16 Pipeline: Basic Steps 2.24 Pipeline: Build Step 2.15 Pipeline: Declarative 1.9.3 Pipeline: Declarative Extension Points API 1.9.3 Pipeline: GitHub Groovy Libraries 1.0 Pipeline: Groovy 2648.va9433432b33c Pipeline: Input Step 446.vf27b_0b_83500e Pipeline: Job 1145.v7f2433caa07f Pipeline: Milestone Step 1.3.1 Pipeline: Model API 1.9.3 Pipeline: Multibranch 2.24 Pipeline: Nodes and Processes 2.40 Pipeline: REST API Plugin 2.21 Pipeline: SCM Step 2.13 Pipeline: Shared Groovy Libraries 552.vd9cc05b8a2e1 Pipeline: Stage Step 291.vf0a8a7aeeb50 Pipeline: Stage Tags Metadata 1.9.3 Pipeline: Stage View Plugin 2.21 Pipeline: Step API 622.vb_8e7c15b_c95a_ Pipeline: Supporting APIs 813.vb_d7c3d2984a_0
The 'when' condition used to work, but now it does not. I have updated Jenkins and all Pipeline: related plugins to the latest versions.
Here is the error:
java.lang.NoSuchMethodError: No such DSL method 'when' found among steps [archive, bat, bbs_checkout, build, catchError, checkout, container, containerLog, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, dockerNode, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findBuildScans, getContext, git, input, isUnix, junit, library, libraryResource, load, lock, mail, milestone, node, parallel, podTemplate, powershell, properties, publishChecks, pwd, pwsh, readFile, readTrusted, resolveScm, retry, script, setGitHubPullRequestStatus, sh, slackSend, slackUploadFile, slackUserIdFromEmail, slackUserIdsFromCommitters, sleep, sshCommand, sshGet, sshPut, sshRemove, sshScript, stage, stash, step, timeout, timestamps, tm, tool, unarchive, unstable, unstash, validateDeclarativePipeline, waitForQualityGate, waitUntil, warnError, withChecks, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withGradle, wrap, writeFile, ws] or symbols [BbS, BitbucketSCMStep, BitbucketWebhookMultibranchTriggerImpl, BitbucketWebhookTriggerImpl, Number, Open, all, allBranchesSame, allOf, allowRunOnStatus, always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, asIsGITScm, attach, authorizationMatrix, batchFile, bitbucket, bitbucketBranchDiscovery, bitbucketForkDiscovery, bitbucketPublicRepoPullRequestFilter, bitbucketPullRequestDiscovery, bitbucketSshCheckout, bitbucketTagDiscovery, bitbucketTrustEveryone, bitbucketTrustNobody, bitbucketTrustProject, bitbucketTrustTeam, bitbucketWebhookConfiguration, bitbucketWebhookRegistration, booleanParam, branch, branchCreated, branches, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, buildDiscarders, buildParameter, buildRetention, buildSelector, buildUser, buildingTag, builtInNode, caseInsensitive, caseSensitive, certificate, changeRequest, changelog, changeset, checkoutToSubdirectory, choice, choiceParam, cleanWs, clock, close, command, commentPattern, commit, commitChanged, commitMessagePattern, configMapVolume, containerEnvVar, containerLivenessProbe, containerTemplate, copyArtifactPermission, copyArtifacts, copyartifact, created, credentials, cron, crumb, culprits, default, defaultFolderConfiguration, defaultView, deleted, demand, description, developers, disableConcurrentBuilds, disableResume, docker, dockerCert, dockerServer, dockerTool, dockerfile, downstream, dumb, durabilityHint, dynamicPVC, email-ext, emptyDirVolume, emptyDirWorkspaceVolume, envVar, envVars, envVarsFilter, environment, equals, expression, file, fileParam, filePath, fingerprint, fingerprints, frameOptions, freeStyle, freeStyleJob, fromDocker, fromScm, fromSource, git, gitBranchDiscovery, gitHub, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubEvents, gitHubExcludeArchivedRepositories, gitHubExcludePublicRepositories, gitHubForkDiscovery, gitHubPRStatus, gitHubPlugin, gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery, gitHubTopicsFilter, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitTagDiscovery, github, githubBranches, githubPRAddLabels, githubPRClosePublisher, githubPRComment, githubPRMessage, githubPRRemoveLabels, githubPRStatusPublisher, githubPlugin, githubPullRequests, githubPush, gradle, hashChanged, headRegexFilter, headWildcardFilter, hostPathVolume, hostPathWorkspaceVolume, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, isRestartedRun, javadoc, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobBuildDiscarder, jobName, junitTestResultStorage, kubeconfig, kubernetes, label, labels, labelsAdded, labelsExist, labelsNotExist, labelsPatternExists, labelsRemoved, lastCompleted, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, lastSuccessful, lastWithArtifacts, latestSavedBuild, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, masterBuild, maven, maven3Mojos, mavenErrors, mavenGlobalConfig, mavenMojos, mavenWarnings, merge, message, modernSCM, myView, namedBranchesDifferent, never, newContainerPerStage, nfsVolume, nfsWorkspaceVolume, noGITScm, node, nodeProperties, nonInheriting, nonMergeable, none, not, oauth-consumer-create, onFailure, override, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameters, password, pattern, permalink, permanent, persistentVolumeClaim, persistentVolumeClaimWorkspaceVolume, pipeline, pipeline-model, pipeline-model-docker, pipelineTriggers, plainText, plugin, podAnnotation, podEnvVar, podLabel, pollSCM, portMapping, preserveStashes, projectNamingStrategy, proxy, pruneTags, pullRequest, pullRequests, queueItemAuthenticator, quietPeriod, rateLimit, rateLimitBuilds, recipients, requestor, resourceRoot, restriction, restrictions, retainOnlyVariables, run, runParam, sSHLauncher, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, secretEnvVar, secretVolume, security, shell, simpleBuildDiscarder, skipDefaultCheckout, skipStagesAfterUnstable, slackNotifier, slave, sourceRegexFilter, sourceWildcardFilter, specific, ssh, sshPublicKey, sshUserPrivateKey, standard, status, statusOnPublisherError, string, stringParam, suppressAutomaticTriggering, swapSpace, tag, tags, teamSlugFilter, text, textParam, timestamper, timestamperConfig, timezone, tmpSpace, toolLocation, triggeredBy, unsecured, untrusted, upstream, upstreamDevelopers, userSeed, usernameColonPassword, usernamePassword, viewsTabBar, weather, withAnt, withSonarQubeEnv, workspace, x509ClientCert, zip] or globals [currentBuild, docker, env, params, pipeline, scm] at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:216) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...
Here is a snippet of my pipeline:
stage('Deployment'){ when { triggeredBy 'SCMTrigger'} stage('Deploy to TestEnvironment'){ def remote = [:] remote.name = 'TestEnv' remote.host = '10.100.100.100' } }