KRE crashes saying "java.io.IOException: There is not enough space on the disk", but the disk is not full

Hello,

We run KRE on a Windows VM.
We periodically make sure that this VM has enough space.
We did it a couple of days ago: we have 14+ GB available on the (only) C:\ drive.

Our test base includes test scripts requiring explicit usage of temporary stuff in the temporary directory:

Path userDataDirectory = ChromeDriverUtils.getChromeUserDataDirectory()
Path tempUDataDirectory = Files.createTempDirectory(“User Data”)
Path tempProfileDirectory = tempUDataDirectory.resolve(profileName)
FileUtils.copyDirectory(profileDirectory.toFile(), tempProfileDirectory.toFile())

(Many thanks to @kazurayam !!)

Last night, it failed at this very place… with a nice stack trace explaining:
Reason:

org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: There is not enough space on the disk
at (…)
Caused by: java.io.IOException: There is not enough space on the disk
at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1131)
at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1424)
at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1422)
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1366)
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1246)
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1215)
at org.apache.commons.io.FileUtils$copyDirectory.call(Unknown Source)
at kazurayam_inspired_code.ChromeDriverFactoryImpl.newChromeDriverWithProfile(ChromeDriverFactoryImpl.groovy:166)
at (…)

Again, this machine had 14+ GB disk space available.

Our hypothesis: We have hit a limit, not on the overall disk space, but on the space allocated for the Windows temporary directory (aka %TEMP%, aka C:\Users\userLogin\AppData\Local\Temp>), which is where Katalon operates upon Files.createTempDirectory().

Hence, the message should have been “There is not enough space in the temporary directory”.

Has anybody already hit such a specific limit? Where is it set? Is it related to the JVM, or is it Windows?

The solution is trivial: As part of our VM monitoring/hygiene, periodically cleanse the %TEMP% directory.

Cheers,
– Michel

Windows has a limit of number of files in a folder:

How many files do you have under C:\Users\userLogin\AppData\Local\Temp ?

Hello,

Thanks for the feedback.
Unfortunately, we had not noted the number of files at the moment of the incident.

A typical run of our entire test base leaves behind ~130 K files. So assuming it’s multiplied by a few number of runs since the last cleanup, we may had up to a few hundreds of thousands of files, but no more.

The FS is NTFS, so per the link you provided, “Maximum number of files in a single folder: 4,294,967,295”

It’s an AWS EC2 VM, maybe this adds some extra constraint?

Hopefully, we will never reproduce this weird incident.

Many cheers,
–Michel

I hope so as well.