Skip to content

[JENKINS-72024] Folder gets copied based on current folder instead of empty #714

@jenkins-infra-bot

Description

@jenkins-infra-bot

Summary
The Copy-From input field available via "New Item" interprets an empty field as the root of the current folder it's located in, and attempts to copy everything from there.

Steps to Reproduce
1. Open the "New Item" dialog
2. Enter an arbitrary name
3. Select the type "Folder"
4. Attempt to enter a template (random folder) for the Copy-From input field.
5. Delete the entered text, leaving the field empty.

Expected Results
The newly created folder should be empty.

Actual Results
The (seemingly) empty field is interpreted as the root of the current folder it's located in, and attempts to copy everything from there. Only if the Copy-From is left untouched, it behaves as expected.

The copy is recursive and even includes any empty version of the folder the user wants to create (in this moment).

See also the attached before and after screenshot of the duplication.

In our case, this caused an unexpected recursive folder duplication that was big enough to bring down the whole Jenkins instance (due to the copy/rescan of multiple 100s branches / projects).


Originally reported by degelma, imported from: Folder gets copied based on current folder instead of empty
  • status: Open
  • priority: Major
  • component(s): cloudbees-folder-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251211-141027
Raw content of original issue

Summary The Copy-From input field available via "New Item" interprets an empty field as the root of the current folder it's located in, and attempts to copy everything from there.

Steps to Reproduce 1. Open the "New Item" dialog 2. Enter an arbitrary name 3. Select the type "Folder" 4. Attempt to enter a template (random folder) for the Copy-From input field. 5. Delete the entered text, leaving the field empty.

Expected Results The newly created folder should be empty.

Actual Results The (seemingly) empty field is interpreted as the root of the current folder it's located in, and attempts to copy everything from there. Only if the Copy-From is left untouched, it behaves as expected.

The copy is recursive and even includes any empty version of the folder the user wants to create (in this moment).

See also the attached before and after screenshot of the duplication.

In our case, this caused an unexpected recursive folder duplication that was big enough to bring down the whole Jenkins instance (due to the copy/rescan of multiple 100s branches / projects).

environment
Jenkins: 2.401.3<br/>
OS: Linux - 4.15.0-213-generic<br/>
Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)<br/>
---<br/>
ace-editor:1.1<br/>
active-directory:2.33<br/>
analysis-model-api:11.6.0<br/>
ant:497.v94e7d9fffa_b_9<br/>
antisamy-markup-formatter:162.v0e6ec0fcfcf6<br/>
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757<br/>
artifact-manager-s3:822.vf129d4836c31<br/>
artifactory:3.18.9<br/>
authentication-tokens:1.53.v1c90fd9191a_b_<br/>
aws-credentials:218.v1b_e9466ec5da_<br/>
aws-global-configuration:128.ve2c5685a_09c3<br/>
aws-java-sdk:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-cloudformation:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-codebuild:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-ec2:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-ecr:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-ecs:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-efs:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-elasticbeanstalk:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-iam:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-kinesis:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-logs:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-minimal:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-secretsmanager:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-sns:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-sqs:1.12.529-406.vdeff15e5817d<br/>
aws-java-sdk-ssm:1.12.529-406.vdeff15e5817d<br/>
blueocean:1.27.6<br/>
blueocean-autofavorite:1.2.5<br/>
blueocean-bitbucket-pipeline:1.27.6<br/>
blueocean-commons:1.27.6<br/>
blueocean-config:1.27.6<br/>
blueocean-core-js:1.27.6<br/>
blueocean-dashboard:1.27.6<br/>
blueocean-display-url:2.4.2<br/>
blueocean-events:1.27.6<br/>
blueocean-git-pipeline:1.27.6<br/>
blueocean-github-pipeline:1.27.6<br/>
blueocean-i18n:1.27.6<br/>
blueocean-jira:1.27.6<br/>
blueocean-jwt:1.27.6<br/>
blueocean-personalization:1.27.6<br/>
blueocean-pipeline-api-impl:1.27.6<br/>
blueocean-pipeline-editor:1.27.6<br/>
blueocean-pipeline-scm-api:1.27.6<br/>
blueocean-rest:1.27.6<br/>
blueocean-rest-impl:1.27.6<br/>
blueocean-web:1.27.6<br/>
bootstrap4-api:4.6.0-6<br/>
bootstrap5-api:5.3.0-1<br/>
bouncycastle-api:2.29<br/>
branch-api:2.1122.v09cb_8ea_8a_724<br/>
build-monitor-plugin:1.14-744.v35fd6fa_a_26b_2<br/>
build-timeout:1.31<br/>
buildtriggerbadge:251.vdf6ef853f3f5<br/>
built-on-column:1.4<br/>
caffeine-api:3.1.8-133.v17b_1ff2e0599<br/>
checks-api:2.0.0<br/>
cloudbees-bitbucket-branch-source:832.v43175a_425ea_6<br/>
cloudbees-folder:6.848.ve3b_fd7839a_81<br/>
cobertura:1.17<br/>
code-coverage-api:4.7.0<br/>
command-launcher:107.v773860566e2e<br/>
commons-lang3-api:3.13.0-62.v7d18e55f51e2<br/>
commons-text-api:1.10.0-78.v3e7b_ea_d5a_fe1<br/>
conditional-buildstep:1.4.3<br/>
config-file-provider:953.v0432a_802e4d2<br/>
configuration-as-code:1700.v6f448841296e<br/>
copyartifact:722.v0662a_9b_e22a_c<br/>
credentials:1271.v54b_1c2c6388a_<br/>
credentials-binding:631.v861c06d062b_4<br/>
cron_column:1.7<br/>
cvs:2.19.1<br/>
data-tables-api:1.13.5-1<br/>
dependency-check-jenkins-plugin:5.4.2<br/>
dependency-track:4.3.1<br/>
display-url-api:2.3.9<br/>
docker-commons:439.va_3cb_0a_6a_fb_29<br/>
docker-workflow:572.v950f58993843<br/>
durable-task:523.va_a_22cf15d5e0<br/>
echarts-api:5.4.0-5<br/>
email-ext:2.100<br/>
emailext-template:1.5<br/>
envinject:2.908.v66a_774b_31d93<br/>
envinject-api:1.199.v3ce31253ed13<br/>
external-monitor-job:207.v98a_a_37a_85525<br/>
favorite:2.4.3<br/>
font-awesome-api:6.4.0-2<br/>
forensics-api:2.3.0<br/>
git:5.2.0<br/>
git-client:4.4.0<br/>
git-parameter:0.9.19<br/>
git-server:99.va_0826a_b_cdfa_d<br/>
github:1.37.3<br/>
github-api:1.314-431.v78d72a_3fe4c3<br/>
github-branch-source:1732.v3f1889a_c475b_<br/>
gitlab-api:5.3.0-91.v1f9a_fda_d654f<br/>
gitlab-branch-source:671.v67b_7169092ca_<br/>
gitlab-plugin:1.7.15<br/>
gradle:2.8.2<br/>
handlebars:3.0.8<br/>
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953<br/>
htmlpublisher:1.32<br/>
instance-identity:173.va_37c494ec4e5<br/>
ionicons-api:56.v1b_1c8c49374e<br/>
ivy:2.5<br/>
jackson2-api:2.15.2-350.v0c2f3f8fc595<br/>
jakarta-activation-api:2.0.1-3<br/>
jakarta-mail-api:2.0.1-3<br/>
javadoc:243.vb_b_503b_b_45537<br/>
javax-activation-api:1.2.0-6<br/>
javax-mail-api:1.6.2-9<br/>
jaxb:2.3.8-1<br/>
jdk-tool:73.vddf737284550<br/>
jenkins-design-language:1.27.6<br/>
jenkins-multijob-plugin:623.v03401733c9a_9<br/>
jersey2-api:2.40-1<br/>
jira:3.10<br/>
jjwt-api:0.11.5-77.v646c772fddb_0<br/>
jnr-posix-api:3.1.17-1<br/>
jobConfigHistory:1227.v7a_79fc4dc01f<br/>
jquery:1.12.4-1<br/>
jquery-detached:1.2.1<br/>
jquery3-api:3.7.0-1<br/>
jsch:0.2.8-65.v052c39de79b_2<br/>
junit:1217.v4297208a_a_b_ce<br/>
kerberos-sso:1.11<br/>
kubernetes:3985.vd26d77b_2a_48a_<br/>
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9<br/>
kubernetes-credentials:0.10.0<br/>
ldap:694.vc02a_69c9787f<br/>
lockable-resources:1185.v0c528656ce04<br/>
mailer:463.vedf8358e006b_<br/>
mapdb-api:1.0.9-28.vf251ce40855d<br/>
matrix-auth:3.1.10<br/>
matrix-project:808.v5a_b_5f56d6966<br/>
maven-plugin:3.23<br/>
mercurial:1260.vdfb_723cdcc81<br/>
metrics:4.2.18-442.v02e107157925<br/>
mina-sshd-api-common:2.10.0-69.v28e3e36d18eb_<br/>
mina-sshd-api-core:2.10.0-69.v28e3e36d18eb_<br/>
minio:1.3.3-rc93.9e92f846d4cf<br/>
momentjs:1.1.1<br/>
monitoring:1.95.0<br/>
notification:1.17<br/>
nsiqcollector:1.3.3<br/>
oic-auth:2.6<br/>
okhttp-api:4.11.0-157.v6852a_a_fa_ec11<br/>
pam-auth:1.10<br/>
parameterized-scheduler:255.v73827fcdf618<br/>
parameterized-trigger:2.46<br/>
pipeline-build-step:505.v5f0844d8d126<br/>
pipeline-github-lib:42.v0739460cda_c4<br/>
pipeline-graph-analysis:202.va_d268e64deb_3<br/>
pipeline-groovy-lib:685.v8ee9ed91d574<br/>
pipeline-input-step:477.v339683a_8d55e<br/>
pipeline-milestone-step:111.v449306f708b_7<br/>
pipeline-model-api:2.2144.v077a_d1928a_40<br/>
pipeline-model-definition:2.2144.v077a_d1928a_40<br/>
pipeline-model-extensions:2.2144.v077a_d1928a_40<br/>
pipeline-rest-api:2.33<br/>
pipeline-stage-step:305.ve96d0205c1c6<br/>
pipeline-stage-tags-metadata:2.2144.v077a_d1928a_40<br/>
pipeline-stage-view:2.33<br/>
pipeline-utility-steps:2.16.0<br/>
plain-credentials:143.v1b_df8b_d3b_e48<br/>
plugin-usage-plugin:4.1<br/>
plugin-util-api:3.3.0<br/>
popper-api:1.16.1-3<br/>
popper2-api:2.11.6-2<br/>
prism-api:1.29.0-7<br/>
pubsub-light:1.17<br/>
resource-disposer:0.23<br/>
reverse-proxy-auth-plugin:1.7.7<br/>
run-condition:1.7<br/>
s3:0.12.3445.vda_704535b_5a_d<br/>
saml:4.429.v9a_781a_61f1da_<br/>
scm-api:676.v886669a_199a_a_<br/>
script-security:1275.v23895f409fb_d<br/>
snakeyaml-api:2.2-111.vc6598e30cc65<br/>
sse-gateway:1.26<br/>
ssh-agent:333.v878b_53c89511<br/>
ssh-credentials:308.ve4497b_ccd8f4<br/>
ssh-slaves:2.916.vd17b_43357ce4<br/>
sshd:3.312.v1c601b_c83b_0e<br/>
structs:325.vcb_307d2a_2782<br/>
subversion:2.17.3<br/>
test-results-aggregator:1.2.16<br/>
test-results-analyzer:0.4.0<br/>
test-stability:2.3<br/>
timestamper:1.26<br/>
token-macro:384.vf35b_f26814ec<br/>
trilead-api:2.84.v72119de229b_7<br/>
variant:60.v7290fc0eb_b_cd<br/>
view-job-filters:369.ve0513a_a_f5524<br/>
warnings-ng:10.4.0<br/>
windows-slaves:1.8.1<br/>
workflow-aggregator:596.v8c21c963d92d<br/>
workflow-api:1267.vd9b_a_ddd9eb_47<br/>
workflow-basic-steps:1042.ve7b_140c4a_e0c<br/>
workflow-cps:3774.v4a_d648d409ce<br/>
workflow-cps-global-lib:609.vd95673f149b_b<br/>
workflow-durable-task-step:1289.v4d3e7b_01546b_<br/>
workflow-job:1326.ve643e00e9220<br/>
workflow-multibranch:756.v891d88f2cd46<br/>
workflow-scm-step:415.v434365564324<br/>
workflow-step-api:639.v6eca_cd8c04a_a_<br/>
workflow-support:848.v5a_383b_d14921<br/>
ws-cleanup:0.45
2 attachments

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions