java.io.FileNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • If a file in the workspace is a symlink whose target path isn't retrievable (say its absolute and isn't completely contained (relatively) in the workspace, then the task scanner plugin dies. [TASKS] Scanning workspace files for tasks... ERROR: Publisher hudson.plugins.tasks.TasksPublisher aborted due to exception java.io.FileNotFoundException: "symlink source" (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:137) at hudson.FilePath.read(FilePath.java:1250) at hudson.plugins.tasks.parser.WorkspaceScanner.invoke(WorkspaceScanner.java:140) at hudson.plugins.tasks.parser.WorkspaceScanner.invoke(WorkspaceScanner.java:26) at hudson.FilePath.act(FilePath.java:758) at hudson.FilePath.act(FilePath.java:740) at hudson.plugins.tasks.TasksPublisher.perform(TasksPublisher.java:206) at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:310) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635) at hudson.model.Build$RunnerImpl.post2(Build.java:161) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604) at hudson.model.Run.run(Run.java:1400) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:175) [ClearCase] Restored the original build steps. Finished: FAILURE Suggest Tasks Plugin just log something non fatal to console and continue in such circumstances.
    via by Greg Moncreaff,
  • During scan of workspace, with a large number of files, ClamAvRecorder abort scan whith Error: ERROR: Publisher org.jenkinsci.plugins.clamav.ClamAvRecorder aborted due to exception java.io.FileNotFoundException: /home/sonar/.jenkins/jobs/PJ-PORT_PCPLS/workspace/proj/target/test-classes/generated/RESPONSE$DATA$CPLCOMANDOPL.class (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at hudson.FilePath.read(FilePath.java:1739) at org.jenkinsci.plugins.clamav.ClamAvRecorder.perform(ClamAvRecorder.java:117) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) I analyzed the source code and suggest you to manage the file's close() at ClamAvScanner.java:97 with insert a finally block. public ScanResult scan(InputStream file) { if (file == null) { throw new IllegalArgumentException("file is null."); } String response; try { response = instream(file); } catch (IOException e) { return new ScanResult(Status.WARNING, e.getMessage()); } finally { ... file.close(); ... } if (response.contains("FOUND\0")) { String sig = response.substring("stream: ".length(), response.lastIndexOf("FOUND") - 1); return new ScanResult(Status.INFECTED, sig); } return new ScanResult(Status.PASSED); }
    via by fabio farronato,
  • I've tried boosting the maximum number of open files to >1000000, and still get this error. But I may not have upped the limit properly (although "ulimit -n" for tomcat does show the updated limit). {code} ... Publish artifacts to S3 Bucket bucket=testing-content-pugpig, file=video.css region=eu-west-1, will be uploaded from slave=false managed=false , server encryption false ERROR: Failed to upload files java.io.IOException: Call fails for Destination [bucketName=testing-content-pugpig, objectName=templatestest/generic/generated/page-256.html]: java.io.FileNotFoundException: /home/tomcat/.jenkins/jobs/kaldor-templatestest-server-dev/workspace/templatestest/generic/generated/page-256.html (Too many open files):: Failed after 1 tries. at hudson.plugins.s3.S3Profile.repeat(S3Profile.java:249) at hudson.plugins.s3.S3Profile.upload(S3Profile.java:156) at hudson.plugins.s3.S3BucketPublisher.parallelUpload(S3BucketPublisher.java:241) at hudson.plugins.s3.S3BucketPublisher.perform(S3BucketPublisher.java:170) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:403) at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:345) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.Run.run(Run.java:1676) at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:284) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.io.FileNotFoundException: /home/tomcat/.jenkins/jobs/kaldor-templatestest-server-dev/workspace/templatestest/generic/generated/page-256.html (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:138) at hudson.FilePath.read(FilePath.java:1751) at hudson.plugins.s3.MD5.generateFromFile(MD5.java:19) at hudson.plugins.s3.callable.S3UploadCallable.invoke(S3UploadCallable.java:30) at hudson.plugins.s3.S3Profile$1.call(S3Profile.java:163) at hudson.plugins.s3.S3Profile$1.call(S3Profile.java:156) at hudson.plugins.s3.S3Profile.repeat(S3Profile.java:245) ... 12 more build hudson.plugins.s3.S3BucketPublisher@6820b43b UNSTABLE {code}
    via by Stephen Hartley,
  • If a file in the workspace is a symlink whose target path isn't retrievable (say its absolute and isn't completely contained (relatively) in the workspace, then the task scanner plugin dies. [TASKS] Scanning workspace files for tasks... ERROR: Publisher hudson.plugins.tasks.TasksPublisher aborted due to exception java.io.FileNotFoundException: "symlink source" (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:137) at hudson.FilePath.read(FilePath.java:1250) at hudson.plugins.tasks.parser.WorkspaceScanner.invoke(WorkspaceScanner.java:140) at hudson.plugins.tasks.parser.WorkspaceScanner.invoke(WorkspaceScanner.java:26) at hudson.FilePath.act(FilePath.java:758) at hudson.FilePath.act(FilePath.java:740) at hudson.plugins.tasks.TasksPublisher.perform(TasksPublisher.java:206) at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:310) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:682) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:657) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:635) at hudson.model.Build$RunnerImpl.post2(Build.java:161) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:604) at hudson.model.Run.run(Run.java:1400) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:175) [ClearCase] Restored the original build steps. Finished: FAILURE Suggest Tasks Plugin just log something non fatal to console and continue in such circumstances.
    via by Greg Moncreaff,
  • During scan of workspace, with a large number of files, ClamAvRecorder abort scan whith Error: ERROR: Publisher org.jenkinsci.plugins.clamav.ClamAvRecorder aborted due to exception java.io.FileNotFoundException: /home/sonar/.jenkins/jobs/PJ-PORT_PCPLS/workspace/proj/target/test-classes/generated/RESPONSE$DATA$CPLCOMANDOPL.class (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at hudson.FilePath.read(FilePath.java:1739) at org.jenkinsci.plugins.clamav.ClamAvRecorder.perform(ClamAvRecorder.java:117) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) I analyzed the source code and suggest you to manage the file's close() at ClamAvScanner.java:97 with insert a finally block. public ScanResult scan(InputStream file) { if (file == null) { throw new IllegalArgumentException("file is null."); } String response; try { response = instream(file); } catch (IOException e) { return new ScanResult(Status.WARNING, e.getMessage()); } finally { ... file.close(); ... } if (response.contains("FOUND\0")) { String sig = response.substring("stream: ".length(), response.lastIndexOf("FOUND") - 1); return new ScanResult(Status.INFECTED, sig); } return new ScanResult(Status.PASSED); }
    via by fabio farronato,
    • java.io.FileNotFoundException: /Users/saiprasanthrajavarapu/.jenkins/workspace/maven2/Users/saiprasanthrajavarapu/Documents/devops/Samplejava/SampleExample/pom.xml (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at hudson.FilePath.read(FilePath.java:1779) at jenkins.plugins.maveninfo.extractor.properties.PomPropertiesFinder.findProperties(PomPropertiesFinder.java:50) at jenkins.plugins.maveninfo.extractor.MavenInfoExtractor.extract(MavenInfoExtractor.java:58) at jenkins.plugins.maveninfo.extractor.MavenInfoEnvironment.tearDown(MavenInfoEnvironment.java:42) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:882) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)

    Users with the same issue

    jstrayer
    1 times, last one,
    jf-ast
    2 times, last one,
    carloscharx
    2 times, last one,
    arturgajowy
    1 times, last one,
    batwalrus76
    2 times, last one,
    187 more bugmates