This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 239142 - java.io.IOException: There is not enough space on the disk
Summary: java.io.IOException: There is not enough space on the disk
Status: RESOLVED DUPLICATE of bug 250365
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: All All
: P1 normal with 1 vote (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks: 219645
  Show dependency tree
 
Reported: 2013-12-05 08:30 UTC by moghrabi
Modified: 2015-08-03 12:54 UTC (History)
11 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter: 203801


Attachments
stacktrace (1.53 KB, text/plain)
2013-12-05 08:30 UTC, moghrabi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description moghrabi 2013-12-05 08:30:45 UTC
Build: NetBeans IDE Dev (Build 201311210002)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 7

User Comments:
tomzi: Did nothing, index was updated in the background

GUEST: Lucene taking more than 2GB in /tmp to uncompress Maven Central Repository index
Index update always fails with this Exception

moghrabi: Hi,

I often get this error "java.io.IOException: There is not enough space on the disk" whereas my disks' spaces are :
C: 8.17 GB free / 59.9 GB
D: 928 GB free / 931 GB
E: 34.6 GB free / 51.7 GB

I launch netbeans by specifiing the following parameters to use the E: drive :
E:\projects\netbeans\7.4-dev\bin\netbeans64.exe --userdir E:\projects\netbeans\instances\7.4-dev\inst1\userdir --cachedir E:\projects\netbeans\instances\7.4-dev\inst1\cache

Any idea ?

GUEST: Netbeans throws this error trying to decompress the maven central repository index.
There's plenty of space available on the device.

GUEST: Maven central repo index unpacking fails.

tomzi: .

GUEST: Exception occurs every time maven updates indexes.
Tried to clean maven local repository and netbeans cache nothing helps




Stacktrace: 
java.io.IOException: There is not enough space on the disk
   at java.io.RandomAccessFile.writeBytes0(RandomAccessFile.java:0)
   at java.io.RandomAccessFile.writeBytes(RandomAccessFile.java:520)
   at java.io.RandomAccessFile.write(RandomAccessFile.java:550)
   at org.apache.lucene.store.FSDirectory$FSIndexOutput.flushBuffer(FSDirectory.java:448)
   at org.apache.lucene.store.BufferedIndexOutput.flushBuffer(BufferedIndexOutput.java:99)
   at org.apache.lucene.store.BufferedIndexOutput.flush(BufferedIndexOutput.java:88)
Comment 1 moghrabi 2013-12-05 08:30:47 UTC
Created attachment 142851 [details]
stacktrace
Comment 2 Tomas Zezula 2014-01-13 09:20:42 UTC
>java.io.IOException: There is not enough space on the disk
The /tmp volume is full.
Comment 3 Milos Kleint 2014-01-13 09:28:46 UTC
lucene/maven indexer is using java.io.tmpdir to unzip the downloaded index and to create the lucene index (which is later moved/copied to netbeans cache dir. We don't have a direct way of influencing this AFAIK.
Comment 4 Milos Kleint 2014-01-13 09:32:05 UTC
the workaround is to set -J-Djava.io.tmp=<path where is enough space> in <nb install directory>/etc/netbeans.conf
Comment 5 tomzi 2014-01-13 13:57:04 UTC
Maybe it would make sense to tell the user in the gui about this functionality, eg in Options->Java->Maven->Index.

There we could have some sort of 'Warning' or other Info if the space in the lucene folder is getting low. Sth like:

'Current Lucene Temp Folder: C:\temp, 1 GB available'
'Warning: There is not enough space for the lucene index to be created'
'Info: You can change the lucene temp directory via the option -J-Djava.io.tmp=<path where is enough space> in <nb install directory>/etc/netbeans.conf

Shall I create a new Enhancement Request for this?
Comment 6 Milos Kleint 2014-01-13 13:59:30 UTC
(In reply to tomzi from comment #5)
> Maybe it would make sense to tell the user in the gui about this
> functionality, eg in Options->Java->Maven->Index.
> 
> There we could have some sort of 'Warning' or other Info if the space in the
> lucene folder is getting low. Sth like:
> 
> 'Current Lucene Temp Folder: C:\temp, 1 GB available'
> 'Warning: There is not enough space for the lucene index to be created'
> 'Info: You can change the lucene temp directory via the option
> -J-Djava.io.tmp=<path where is enough space> in <nb install
> directory>/etc/netbeans.conf
> 
> Shall I create a new Enhancement Request for this?

And how does one figure that out from java code? I mean how many GB are free on a given volume on all supported OS platforms?
Comment 7 tomzi 2014-01-16 15:47:20 UTC
doesn't this work reliably? 
from: http://examples.javacodegeeks.com/core-java/io/file/get-free-disk-space-in-java-example/

package com.javacodegeeks.java.core;

import java.io.File;

public class DiskSpaceDetail {

	public static void main(String[] args) {

		File diskPartition = new File("C:");

		long totalCapacity = diskPartition.getTotalSpace(); 

		long freePartitionSpace = diskPartition.getFreeSpace(); 
		long usablePatitionSpace = diskPartition.getUsableSpace(); 

		System.out.println("**** Sizes in Mega Bytes ****\n");

		System.out.println("Total C partition size : " + totalCapacity / (1024*1024) + " MB");
		System.out.println("Usable Space : " + usablePatitionSpace / (1024 *1024) + " MB");
		System.out.println("Free Space : " + freePartitionSpace / (1024 *1024) + " MB");

		System.out.println("\n**** Sizes in Giga Bytes ****\n");

		System.out.println("Total C partition size : " + totalCapacity / (1024*1024*1024) + " GB");
		System.out.println("Usable Space : " + usablePatitionSpace / (1024 *1024*1024) + " GB");
		System.out.println("Free Space : " + freePartitionSpace / (1024 *1024*1024) + " GB");
	}
}
Comment 8 Milos Kleint 2014-01-16 17:54:42 UTC
Nice, I wasn't aware of this addition to File. However the javadoc is not so encouraging: 
"The number of unallocated bytes on the partition or 0L if the abstract pathname does not name a partition". 

It's likely fairly easy to know what a partition is on windows, however on linux it's not that easy to figure, or am I missing something?
Comment 9 Milos Kleint 2014-01-16 18:39:28 UTC
let's make it an enhancement request and examine possibilities here for the next release
Comment 10 tomzi 2014-01-17 07:53:54 UTC
Yeah, I also get surprised by helpful new JDK addtions here and then :)

I mean - I'd guess these methods are just wrappers for actual system calls - so they should work in any circumstance - at least getFreeSpace()...
Comment 11 Milos Kleint 2014-01-17 08:10:00 UTC
(In reply to tomzi from comment #10)
> Yeah, I also get surprised by helpful new JDK addtions here and then :)
> 
> I mean - I'd guess these methods are just wrappers for actual system calls -
> so they should work in any circumstance - at least getFreeSpace()...

indeed, at least on mac for any existing file/folder it shows the size, on non existing ones 0
Comment 12 daniele.comand 2014-05-22 20:39:27 UTC
I've resolved with a workaround in windows 7.
java.io.tmpdir uses %userprofile%TEMP (or %userprofile%TMP) for java.io.tmpdir.
Disconnect your %userprofile%. As administrator access controlPanel > UserAccounts. 
Select the %userprofile% and "Modify Enviroment Variables". 
Change the path for TMP and TEMP variable to a disk with enough space.
Reconnect your %userprofile%.
Comment 13 ancoron 2015-01-21 09:44:11 UTC
I've also been hit by this regularly.

I'm on linux, so the stuff goes into "/tmp", which is configured for 8 GiB, so plenty of space for indexing - at least I thought so.

The failing index (at least right now) is:
https://oss.sonatype.org/content/repositories/releases/.index/nexus-maven-repository-index.gz

...which is ~257 MiB in size and contains ~2.3 GiB of uncompressed data:

$ gzip -l nexus-maven-repository-index.gz
         compressed        uncompressed  ratio uncompressed_name
          269238983          2479070257  89.1% nexus-maven-repository-index

...nevertheless, the "unpacking" fails with a behavior similar to the good old zip-bomb:

...
[2015-01-21T09:42:05] total=8.0G, used=5.5G, free=2.6G
[2015-01-21T09:42:06] total=8.0G, used=5.6G, free=2.5G
[2015-01-21T09:42:07] total=8.0G, used=5.6G, free=2.5G
[2015-01-21T09:42:08] total=8.0G, used=5.7G, free=2.4G
[2015-01-21T09:42:09] total=8.0G, used=5.7G, free=2.4G
[2015-01-21T09:42:10] total=8.0G, used=6.7G, free=1.4G
[2015-01-21T09:42:11] total=8.0G, used=7.9G, free=154M
[2015-01-21T09:42:12] total=8.0G, used=8.0G, free=96M
[2015-01-21T09:42:13] total=8.0G, used=8.0G, free=47M
[2015-01-21T09:42:14] total=8.0G, used=7.9G, free=190M
[2015-01-21T09:42:15] total=8.0G, used=6.1M, free=8.0G
...
Comment 14 Exceptions Reporter 2015-07-10 09:17:10 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=203801
Comment 15 CMoH 2015-07-10 09:19:52 UTC
I have tmp mounted as tmpfs, size=2G. Can you provide an appropriate value for such a setup?
Comment 16 Tomas Stupka 2015-08-03 12:54:32 UTC

*** This bug has been marked as a duplicate of bug 250365 ***