Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

57%
+2 −1
Q&A Jenkins failed to delete a file - why? How to prevent?

We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results. The pro...

2 answers  ·  posted 4y ago by anatolyg‭  ·  last activity 2y ago by anatolyg‭

Question jenkins
#4: Post edited by user avatar anatolyg‭ · 2021-06-08T11:05:31Z (over 3 years ago)
Replaced the error message with a newer similar one, with more details
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • The problem is, sometimes downloading from Perforce fails:
  • > 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...
  • In the error message, P4 is a common abbreviation for Perforce. We have a [Jenkins plugin called P4](https://plugins.jenkins.io/p4/) which downloads files from Perforce; I guess it's this plugin that writes this error message. I think something is holding the file open, that's why it couldn't be deleted.
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • The problem is, sometimes downloading from Perforce fails:
  • `12:46:19 operating system will not allow deletion of file c:\Jenkins\...(redacted)...\p4j5949332513673726584.tmp on client.
  • `
  • In the error message, P4 is a common abbreviation for Perforce. We have a [Jenkins plugin called P4](https://plugins.jenkins.io/p4/) which downloads files from Perforce; I guess it's this plugin that writes this error message. I think something is holding the temporary file open, that's why it couldn't be deleted.
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
#3: Post edited by user avatar anatolyg‭ · 2020-11-22T21:20:48Z (almost 4 years ago)
more info
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • The problem is, sometimes downloading from Perforce fails:
  • > 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • The problem is, sometimes downloading from Perforce fails:
  • > 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...
  • In the error message, P4 is a common abbreviation for Perforce. We have a [Jenkins plugin called P4](https://plugins.jenkins.io/p4/) which downloads files from Perforce; I guess it's this plugin that writes this error message. I think something is holding the file open, that's why it couldn't be deleted.
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
#2: Post edited by user avatar anatolyg‭ · 2020-11-22T15:15:12Z (almost 4 years ago)
fixed an inaccuracy; removed unnecessary details
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • To prevent confusion, the Jenkins job deletes all files from the target directory before downloading the scripts. The problem is, sometimes this fails:
  • > 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
  • We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.
  • The problem is, sometimes downloading from Perforce fails:
  • > 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...
  • What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?
  • Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?
#1: Initial revision by user avatar anatolyg‭ · 2020-11-22T14:59:49Z (almost 4 years ago)
Jenkins failed to delete a file - why? How to prevent?
We are using Jenkins to run our system tests on a regular schedule. The Jenkins job downloads some python scripts from Perforce, runs them and compares the outputs with known-good results.

To prevent confusion, the Jenkins job deletes all files from the target directory before downloading the scripts. The problem is, sometimes this fails:

> 20:29:53 P4 Task: failed: java.io.IOException: Unable to delete file: c:\Jenkins\blahblah\...

What can I do to prevent this? I imagine that it can be caused by an antivirus, some person quietly browsing in the Jenkins's file system, a random cosmic ray, etc. How can I even start investigating this?

Did we do something fundamentally wrong in configuring our Jenkins job this way? Something which would completely prevent this issue from happening?