Disk Quota Exceeded when building custom Java

Hi,

I am trying my best to find a way to build a nix image with Java 21 so I can have this Fall’s students use the new main methods.

void main() {
    printLine("Hello");
}

I’ve continuously run into resource issues building from github and so am trying just downloading a prebuilt image, but even with that I get “disk quota exceeded” messages.

This is the nix file i am trying. Its not Java 21, but if I can get this approach working I can work out hosting a prebuilt JDK somewhere.

{ pkgs }: {
    deps = [
        (pkgs.fetchzip {
          url = "https://builds.shipilev.net/openjdk-jdk/openjdk-jdk-linux-x86_64-server-release-gcc12-glibc2.34.tar.xz";
          sha256="03lwhad8swyh0p0s1h8sackhpzwjmr8zjwgx3yz1a47587g847np";
        })
    ];
}

Is there any workaround? I upgraded to “Hacker” but that didnt fix anything.

Here is the test repl

https://replit.com/@EthanMcCue1/PitifulShowyLocus?v=1

Here is the error i am getting

 cowsay Configure me!
nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
mv: error writing '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jps': Disk quota exceeded
mv: error writing '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jdb': Disk quota exceeded
mv: error writing '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/keytool': Disk quota exceeded
mv: error writing '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jdeprscan': Disk quota exceeded
mv: error writing '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/rmiregistry': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/java': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jfr': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/javadoc': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jmod': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jdeps': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jrunscript': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jstack': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jlink': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jimage': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jmap': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/jcmd': Disk quota exceeded
mv: cannot create regular file '/nix/store/nfn8nl31f4mkcbjjm17nj4gl8ywk1p66-source/bin/serialver': Disk quota exceeded
builder for '/nix/store/zd7vncc0m2qsrjdybx085812n59ddz68-source.drv' failed with exit code 1
error: build of '/nix/store/zd7vncc0m2qsrjdybx085812n59ddz68-source.drv' failed

Hey @EthanMcCue1!

Thank you for the context, we will look into this and will follow up as soon as we have an update!

Thank You! Let me know what I can do to help.

I managed to make a smaller JDK based on the official distributions with jlink

{ pkgs }: {
    deps = [
        (pkgs.fetchzip {
          url = "https://bowbahdoe.github.io/learning-jdks/21-ea-min.zip";
          sha256="1l2f7mcwb4m4yfskl99r1kjdr197v1p221y3qy0vj9i8qcaw6byx";
        })
    ];
}

Which might turn my exact issue more into a nix one (i can’t figure out how to be able to run java with this), but doesn’t nullify the general problem since i needed to come up with my own github action to make that zip.

There isn’t much we can do regarding the 1GB storage space limitation at the moment. However, we are very close to releasing a feature that will allow Repls to take up a portion of your account-level storage, removing the 1GB limitation.

I’ve brought it up with the team so I can get an ETA on when this will be out, or possibly get you into the beta to mitigate the issue as soon as possible!

The team has let me know that account-wide storage would not affect the /nix/store directory, so that won’t work as a solution. I have flagged this to the Nix folks to see if we can fix this issue at it’s core!

(PS: The account-wide storage storage team is tracking the problem of /nix/store not being expandable)

1 Like