jenkinsci / jenkinsci/workflow-durable-task-step-plugin
"cannot find current thread in CpsStepContext"
- Dominant language
- Java
- Stars
- 46
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
### Jenkins and plugins versions report
Environment
```text
Jenkins: 2.516.2
OS: Linux - 6.14.0-1020-gcp
Java: 21.0.10 - Ubuntu (OpenJDK 64-Bit Server VM)
---
Matrix-sorter-plugin:1.3
allure-jenkins-plugin:2.34.0
analysis-model-api:13.8.0-902.v26f80296f743
ansicolor:1.0.6
ant:518.v8d8dc7945eca_
antisamy-markup-formatter:173.v680e3a_b_69ff3
any-buildstep:14.ve115ec1484f0
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.6-183.ve5a_8a_b_e71e59
artifactdeployer:1.2
asm-api:9.8-163.vb_2a_96d3f9c3c
authentication-tokens:1.144.v5ff4a_5ec5c33
aws-credentials:254.v978a_5e206a_d7
aws-java-sdk:1.12.772-477.v650d756dcf6d
aws-java-sdk-api-gateway:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-autoscaling:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-cloudformation:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-cloudfront:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-cloudwatch:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-codebuild:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-codedeploy:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ec2:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ecr:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ecs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-efs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-elasticbeanstalk:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-elasticloadbalancingv2:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-iam:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-kinesis:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-lambda:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-logs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-minimal:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-organizations:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-secretsmanager:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-sns:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-sqs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ssm:1.12.780-480.v4a_0819121a_9e
aws-java-sdk2-autoscaling:2.31.63-54.vcf1e5a_c56c49
aws-java-sdk2-cloudformation:2.31.63-54.vcf1e5a_c56c49
aws-java-sdk2-core:2.31.63-54.vcf1e5a_c56c49
aws-java-sdk2-ec2:2.31.63-54.vcf1e5a_c56c49
aws-java-sdk2-netty-nio-client:2.31.63-54.vcf1e5a_c56c49
aws-java-sdk2-s3:2.31.63-54.vcf1e5a_c56c49
azure-cli:0.9
azure-container-agents:372.v073266fff4a_7
azure-credentials:357.v6447d38fb_007
azure-keyvault:282.v43b_691a_13d19
azure-sdk:243.v4a_0d23a_c71a_7
azure-vm-agents:1043.v6c34a_871003d
badge:2.9.1
basic-branch-build-strategies:275.vde2351b_4a_58b_
blueocean:1.27.21
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.21
blueocean-commons:1.27.21
blueocean-config:1.27.21
blueocean-core-js:1.27.21
blueocean-dashboard:1.27.21
blueocean-display-url:2.4.4
blueocean-events:1.27.21
blueocean-git-pipeline:1.27.21
blueocean-github-pipeline:1.27.21
blueocean-i18n:1.27.21
blueocean-jira:1.27.21
blueocean-jwt:1.27.21
blueocean-personalization:1.27.21
blueocean-pipeline-api-impl:1.27.21
blueocean-pipeline-editor:1.27.21
blueocean-pipeline-scm-api:1.27.21
blueocean-rest:1.27.21
blueocean-rest-impl:1.27.21
blueocean-web:1.27.21
bootstrap5-api:5.3.8-890.v1c5cf4fa_178e
bouncycastle-api:2.30.1.81-264.v95c79c0e772c
branch-api:2.1244.vf95c81f1641c
build-blocker-plugin:166.vc82fc20b_a_ed6
build-failure-analyzer:2.6.1
build-monitor-plugin:1.14-985.v7b_f37b_3d0b_f5
build-pipeline-plugin:2.0.2
build-timeout:1.38
build-user-vars-plugin:195.v8c35f9d5c3dc
build-with-parameters:76.v9382db_f78962
built-on-column:1.5
caffeine-api:3.2.2-178.v353b_8428ed56
checks-api:402.vca_263b_f200e3
cloud-stats:377.vd8a_6c953e98e
cloudbees-bitbucket-branch-source:936.4.4
cloudbees-folder:6.1037.v4cb_8573b_72a_a_
cobertura:1.17
code-coverage-api:4.99.0
command-launcher:123.v37cfdc92ef67
commons-collections4-api:4.5.0-8.va_d5448ef9011
commons-compress-api:1.28.0-1
commons-httpclient3-api:3.1-3
commons-lang3-api:3.20.0-109.ve43756e2d2b_4
commons-text-api:1.14.0-194.v804a_dc3a_1b_d8
conditional-buildstep:1.5.0
config-file-provider:994.v3d4a_5fa_f353a_
configuration-as-code:2006.v001a_2ca_6b_574
convert-to-pipeline:1.0
copy-project-link:106.veb_028794a_844
copy-to-slave:1.4.4
copyartifact:770.va_6c69e063442
coverage:2.2912.v3dea_6a_4a_73f7
credentials:1453.v9b_a_29777a_b_fd
credentials-binding:702.vfe613e537e88
dashboard-view:2.537.v5132851f6ca_f
data-tables-api:2.3.3-1383.va_5607a_a_3f3c2
disk-usage:1.3
display-url-api:2.217.va_6b_de84cc74b_
distfork:1.8
docker-commons:457.v0f62a_94f11a_3
docker-java-api:3.5.3-122.v156e51f30c0a_
docker-plugin:1274.vc0203fdf2e74
docker-workflow:621.va_73f881d9232
dtkit-api:3.0.3
durable-task:595.ve87b_f1318d67
ec2:1911.vccb_5a_56f62e6
ec2-fleet:3.2.0
echarts-api:6.0.0-1146.v5c8f3b_8f0573
eddsa-api:0.3.0.1-19.vc432d923e5ee
email-ext:1925.v1598902b_58dd
emailext-template:233.v1eb_88fc160b_5
embeddable-build-status:602.v766a_264519c7
emoji-symbols-api:16.0-26.v9818ff7423f0
envinject:2.926.v69c9b_3896a_96
envinject-api:1.235.va_14c74f8f487
extended-read-permission:61.vf24570ff3b_e9
external-monitor-job:223.vb_fddcf42c9b_3
external-workspace-manager:1.3.1
favorite:2.237.v79163ca_8b_892
flexible-publish:0.16.1
folder-properties:62.v1636b_4a_84608
font-awesome-api:7.0.0-851.vd1feb_218a_a_63
forensics-api:3.1754.v2a_6613b_77002
generic-webhook-trigger:2.4.1
git:5.7.0
git-client:6.5.0
git-parameter:444.vca_b_84d3703c2
git-server:137.ve0060b_432302
github:1.45.0
github-api:1.330-492.v3941a_032db_2a_
github-branch-source:1917.v9ee8a_39b_3d0d
github-checks:634.v371dc6d978a_3
github-oauth:651.v135e939e8b_60
github-organization-folder:1.6
golang:1.4
google-compute-engine:4.683.v0ce26579a_ee7
google-metadata-plugin:0.6.70.v87a_e90994a_32
google-oauth-plugin:1.335.ve6de40e2db_18
google-storage-plugin:1.371.vc3434e76e0c4
groovy-label-assignment:1.2.0
groovy-postbuild:272.v52a_03efb_8653
gson-api:2.13.2-173.va_a_092315913c
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-36.v85e4cb_234a_13
htmlpublisher:427
http_request:1.20
instance-identity:203.v15e81a_1b_7a_38
instant-messaging:2.868.v404b_2669f077
ionicons-api:94.vcc3065403257
jackson2-api:2.20.1-423.v13951f6b_6532
jakarta-activation-api:2.1.3-2
jakarta-mail-api:2.1.3-3
jakarta-xml-bind-api:4.0.6-10.v9b_7e1d1fc40b_
javadoc:354.vee1a_660b_4990
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-133.vb_ec76a_73f706
jclouds-jenkins:2.42
jdk-tool:83.v417146707a_3d
jenkins-design-language:1.27.21
jenkins-multijob-plugin:662.vd2e0001f6b_b_d
jersey2-api:2.47-165.ve7809a_3e87e0
jira:3.21
jjwt-api:0.11.5-120.v0268cf544b_89
jnr-posix-api:3.1.20-166.v50a_50932c65b_
job-restrictions:216.v0732cc7fb_076
jobConfigHistory:1352.va_201a_8389340
jobcacher:732.ve164e3059a_a_a_
joda-time-api:2.14.0-149.v1c3ce991d1b_9
jquery:1.12.4-3
jquery-detached:1.2.1
jquery-ui:1.0.2
jquery3-api:3.7.1-594.vb_3864f326cf0
jsch:0.2.16-95.v3eecb_55fa_b_78
json-api:20251224-185.v0cc18490c62c
json-path-api:2.9.0-178.vca_b_c71881321
jsoup:1.21.2-66.v6ea_38164b_8a_2
junit:1369.v15da_00283f06
keep-slave-disconnected:1.0
ldap:780.vcb_33c9a_e4332
lockable-resources:1412.v3f305a_fb_a_117
log-file-filter:119.vef6c84f663c7
log-parser:2.5.0
lucene-search:425.v2ccf4cc3a_d55
mailer:522.va_995fa_cfb_8b_d
mapdb-api:1.0.9-44.va_1e1310c9118
matrix-auth:3.2.8
matrix-combinations-parameter:1.3.3
matrix-project:870.v9db_fcfc2f45b_
matrixtieparent:1.2
maven-plugin:3.27
mercurial:1323.ve69d2a_db_8a_b_d
metrics:4.2.37-489.vb_6db_69b_ce753
mina-sshd-api-common:2.16.0-167.va_269f38cc024
mina-sshd-api-core:2.16.0-167.va_269f38cc024
mina-sshd-api-scp:2.15.0-161.vb_200831a_c15b_
miniorange-saml-sp:2.4.8
momentjs:1.1.1
multi-module-tests-publisher:1.44
multiple-scms:0.8
netty-api:4.1.118.Final-9.v776038d601a_7
node-iterator-api:72.vc90e81737df1
nodelabelparameter:759.vb_b_e95db_f3251
oauth-credentials:0.657.v7d8dd90b_0382
okhttp-api:4.12.0-195.vc02552c04ffd
oracle-cloud-infrastructure-compute:1.0.18
oss-symbols-api:392.v27a_482d90083
pam-auth:1.12
parallel-test-executor:535.v0343a_314327b_
parameter-separator:296.v9b_a_90c81160d
parameterized-scheduler:285.ve611986d4c48
parameterized-trigger:873.v8b_e37dd8418f
percentage-du-node-column:0.1.0
perfpublisher:8.09
pipeline-build-step:571.v08a_fffd4b_0ce
pipeline-github:2.8-162.382498405fdc
pipeline-github-lib:65.v203688e7727e
pipeline-graph-analysis:241.vc3d48fb_b_2582
pipeline-graph-view:661.v6003f4542123
pipeline-groovy-lib:752.vdddedf804e72
pipeline-input-step:534.v352f0a_e98918
pipeline-milestone-step:138.v78ca_76831a_43
pipeline-model-api:2.2265.v140e610fe9d5
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:2.2265.v140e610fe9d5
pipeline-model-extensions:2.2265.v140e610fe9d5
pipeline-multibranch-defaults:2.1
pipeline-rest-api:2.38
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2265.v140e610fe9d5
pipeline-stage-view:2.38
pipeline-utility-steps:2.19.0
plain-credentials:199.v9f8e1f741799
plugin-usage-plugin:4.10
plugin-util-api:6.1167.v022176c7e0ca_
popper-api:1.16.1-3
popper2-api:2.11.6-5
postbuild-task:78.v24529f1f5cdb_
postbuildscript:3.4.1-695.vf6b_0b_8053979
prism-api:1.30.0-609.vf0a_df102d9a_f
prometheus:819.v50953a_c560dd
promoted-builds:992.va_00888f21b_74
pubsub-light:1.19
rebuild:338.va_0a_b_50e29397
resource-disposer:0.25
role-strategy:799.v5b_e7b_ecc231e
run-condition:243.v3c3f94e46a_8b_
s3:498.v4c32ea_de55c2
saml:4.590.v6170b_1013da_f
scm-api:707.v749f968369d4
scoring-load-balancer:202.ve8d1e11694e2
script-security:1385.v7d2d9ec4d909
scriptler:425.v09a_dc03401b_0
shared-objects:0.44
shelve-project-plugin:3.3196.v0052de37a_8d3
simple-priority-sorter:8.v96183e297829
simple-theme-plugin:211.v5424a_5510e47
slack:795.v4b_9705b_e6d47
slave-prerequisites:1.0
slave-setup:129.vee7cd5a_0e204
snakeyaml-api:2.3-125.v4d77857a_b_402
sse-gateway:1.28
ssh-agent:386.v36cc0c7582f0
ssh-credentials:361.vb_f6760818e8c
ssh-slaves:3.1071.v0d059c7b_c555
sshd:3.374.v19b_d59ce6610
structs:362.va_b_695ef4fdf9
template-project:1.5.2
test-results-aggregator:3.2
test-results-analyzer:309.vda_3a_a_f100542
throttle-concurrents:2.18
timestamper:1.30
token-macro:477.vd4f0dc3cb_cf1
trilead-api:2.209.v0e69b_c43c245
uno-choice:2.8.8
variant:70.va_d9f17f859e0
view-job-filters:401.va_809f6a_b_0c26
warnings-ng:12.9783.ve1cb_9f060738
windows-azure-storage:469.v75a_3db_ea_d2b_a_
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1384.vdc05a_48f535f
workflow-basic-steps:1079.vce64b_a_929c5a_
workflow-cps:4183.v94b_6fd39da_c1
workflow-cps-global-lib:615.vb_b_0664a_b_19f3
workflow-durable-task-step:1452.v0ee719c104a_7
workflow-job:1559.va_a_533730b_ea_d
workflow-multibranch:811.vcd33d074c2a_0
workflow-scm-step:437.v05a_f66b_e5ef8
workflow-step-api:710.v3e456cc85233
workflow-support:1010.vb_b_39488a_9841
ws-cleanup:0.49
xunit:3.1.6
```
### What Operating System are you using (both controller, and any agents involved in the problem)?
Linux (Fedora)
### Reproduction steps
I have a fairly complex pipeline. At one point it reaches this step:
```groovy
sh '''
if ls jenkins_test* 1> /dev/null 2>&1; then
echo "Removing old tests jenkins_test*"
rm -Rf jenkins_test*
fi
'''
```
It executes (there happens to be no file that matches the pattern). Immediately afterwards I get
```
19:23:11 spider7.cloudius-systems.com seems to be removed or offline (java.io.IOException: cannot find current thread in CpsStepContext[1142:sh]:scylla-master/scylla-ci#25429); will wait for 5 min 0 sec for it to come back online
```
And there is no recovery from that.
The next step is quite complicated:
```groovy
def testCommand
if (runPytest) {
testCommand = "pytest --test-py-init ${includeTests} --mode=${testMode} -n=${clusterPoolSize} --repeat=${numOfRepeats} --maxfail=${maxFailures}"
} else {
testCommand = "./test.py --tmpdir=/scylladir/testlog/$architecture --artifacts_dir_url ${env.BUILD_URL}artifact -q --repeat $numOfRepeats $includeTests --max-failures ${maxFailures} --cluster-pool-size ${clusterPoolSize}"
if (testMode) {
testCommand += " --mode=${testMode}"
}
if (markers) {
testCommand += " --markers=${markers}"
}
if (gatherMetrics) {
testCommand += " --gather-metrics"
} else {
testCommand += " --no-gather-metrics"
}
if (args.sessionTimeout) {
testCommand += " --session-timeout=${args.sessionTimeout}"
}
}
try {
withCredentials([
file(credentialsId: 'GCP_KMS_TESTS_USER_1_CREDENTIALS', variable: 'GCP_USER_1_CREDENTIALS'),
file(credentialsId: 'GCP_KMS_TESTS_USER_2_CREDENTIALS', variable: 'GCP_USER_2_CREDENTIALS'),
string(credentialsId: 'jenkins2-aws-secret-key-id', variable: 'AWS_ACCESS_KEY_ID'),
string(credentialsId: 'jenkins2-aws-secret-access-key', variable: 'AWS_SECRET_ACCESS_KEY'),
usernamePassword(credentialsId:'azure-vault-tests-user-1-secret', usernameVariable: 'AZURE_USER_1_CLIENT_ID', passwordVariable: 'AZURE_USER_1_CLIENT_SECRET'),
file(credentialsId: 'azure-vault-tests-user-1-certificate', variable: 'AZURE_USER_1_CLIENT_CERTIFICATE'),
usernamePassword(credentialsId:'azure-vault-tests-user-2-secret', usernameVariable: 'AZURE_USER_2_CLIENT_ID', passwordVariable: 'AZURE_USER_2_CLIENT_SECRET'),
file(credentialsId: 'azure-vault-tests-user-2-certificate', variable: 'AZURE_USER_2_CLIENT_CERTIFICATE'),
]) {
general.runOrDryRunSh (dryRun, "bash -c 'set -o pipefail; $dbuildCommand -v `pwd`:/scylladir -- $testCommand 2>&1 | tee $testOutputFile'", "Testing Scylla in $testMode mode")
}
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException interruptEx) {
currentBuild.result = 'ABORTED'
testsFailed = true
shared.logError ("Aborting the job. Error: |$interruptEx|")
} catch (Exception err) {
jenkins.cleanContainersLeftovers(testMode: testMode)
if (env.JOB_NAME.contains("next")) {
currentBuild.result = 'UNSTABLE'
} else {
currentBuild.result = 'FAILURE'
testsFailed = true
shared.logWarn ("Error: test failed, error: |$err|.")
}
} finally {
if (! dryRun) {
// Always publish xunit/junit XML files and test results
publishFailed |= artifact.publishArtifactsStatus(xunitFilesPath, scyllaFolderPath)
publishFailed |= artifact.publishArtifactsStatus(pytestJunitFilesPath, scyllaFolderPath)
publishFailed |= publishTestResults(true, xunitFilesPath, "junit", scyllaFolderPath)
publishFailed |= publishTestResults(true, pytestJunitFilesPath, "junit", scyllaFolderPath)
// Always upload sqlite database files
publishFailed |= artifact.publishArtifactsStatus("${generalConfig.testsFilesDir}/${architecture}/sqlite_*.db", scyllaFolderPath)
}
}
```
Could it be that some internal limit is reached?
Note that these steps are run for three modes (the `testMode` variable) and if a failure happens, it's always for testMode=='release'. Sometimes it succeeds.
### Expected Results
No exception and failure.
### Actual Results
This nice `java.io.IOException: cannot find current thread in CpsStepContext[1142:sh]:scylla-master/scylla-ci#25429`
### Anything else?
_No response_
### Are you interested in contributing a fix?
If I could help I would, but I have no idea how to even approach it.
Contributor guide
Assessment
This issue has not been assessed yet.