Skip to content

[JENKINS-65327] File parameters no longer overwrite previous files #11989

Closed

Description

@jenkins-infra-bot

This is a regression in 2.278, it worked in 2.277.

Steps to reproduce:

  1. Create a freestyle job
  2. Define a file parameter
  3. Trigger a build, uploading a file
  4. Trigger another build, uploading a file

Expected behavior: The file is replaced, the build is successful (2.277 and earlier)

Actual result: The build fails with:

Building in workspace /var/jenkins_home/workspace/fs
Copying file to f
FATAL: Destination '/var/jenkins_home/workspace/fs/f' already exists
org.apache.commons.io.FileExistsException: Destination '/var/jenkins_home/workspace/fs/f' already exists
	at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2266)
	at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
	at hudson.FilePath.copyFrom(FilePath.java:1092)
	at hudson.model.FileParameterValue$2.setUp(FileParameterValue.java:173)
	at hudson.model.Build$BuildExecution.doRun(Build.java:157)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
	at hudson.model.Run.execute(Run.java:1907)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE 

Originally reported by danielbeck, imported from: File parameters no longer overwrite previous files
  • assignee: basil
  • status: Closed
  • priority: Major
  • component(s): core
  • label(s): 2.277.4-rejected, regression
  • resolution: Fixed
  • resolved: 2021-04-15T18:07:03+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

This is a regression in 2.278, it worked in 2.277.

Steps to reproduce:

  1. Create a freestyle job
  2. Define a file parameter
  3. Trigger a build, uploading a file
  4. Trigger another build, uploading a file

Expected behavior: The file is replaced, the build is successful (2.277 and earlier)

Actual result: The build fails with:

Building in workspace /var/jenkins_home/workspace/fs
Copying file to f
FATAL: Destination '/var/jenkins_home/workspace/fs/f' already exists
org.apache.commons.io.FileExistsException: Destination '/var/jenkins_home/workspace/fs/f' already exists
	at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2266)
	at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
	at hudson.FilePath.copyFrom(FilePath.java:1092)
	at hudson.model.FileParameterValue$2.setUp(FileParameterValue.java:173)
	at hudson.model.Build$BuildExecution.doRun(Build.java:157)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
	at hudson.model.Run.execute(Run.java:1907)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE 

Activity

  1. jenkins-infra-bot commented on Apr 9, 2021

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Apr 15, 2021

    @jenkins-infra-bot
    Author
    basil:

    Fixed in jenkinsci/jenkins#5411.

  3. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions