Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird no space left error when pushing nextjs app #655

Open
mrdev997 opened this issue Oct 4, 2023 · 1 comment
Open

Weird no space left error when pushing nextjs app #655

mrdev997 opened this issue Oct 4, 2023 · 1 comment

Comments

@mrdev997
Copy link

mrdev997 commented Oct 4, 2023

When I push small nextjs app I get this error:

 gzip: stdout: No space left on device
   /usr/bin/tar: /tmp/output-cache: Wrote only 4096 of 10240 bytes
   /usr/bin/tar: Child returned status 1
   /usr/bin/tar: Error is not recoverable: exiting now
   : exit status 2

4096 MB is the disk_quota I've assigned in manifest.yml and if I change it to fe. 2048MB, the error also changes to "Wrote only 2048 of 10240 bytes".
Is it meant to mean "of 10240 megabytes"? Even if so, why would a small js app (~400MB with node modules and build) need 10GB od space?


What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
cf8.exe version 8.7.3+efd1d03e7.2023-09-12

What version of the buildpack you are using?
1.8.13

If you were attempting to accomplish a task, what was it you were attempting to do?
execute cf push

What did you expect to happen?
successful execution of cf push

What was the actual behavior?

 gzip: stdout: No space left on device
   /usr/bin/tar: /tmp/output-cache: Wrote only 4096 of 10240 bytes
   /usr/bin/tar: Child returned status 1
   /usr/bin/tar: Error is not recoverable: exiting now
   : exit status 2

Can you provide a sample app?
No, but it's a simple next.js app with only few dependencies.

Please confirm where necessary:

  • [+] I have included a log output
  • [+] My log includes an error message
  • [+] I have included steps for reproduction
@tcomte
Copy link

tcomte commented Jan 5, 2024

i face the same problem.

From what i have figure out :
in node_modules/@next, all the SWC optional dependencies/binaries are downloaded, which result in 1.3GB downloaded...

You must have these binaries when you build, so next and SWC can use the proper binary to compile.
But if you compile in standalone mode (doc here) the .next/standalone folder in sufficient and does not need more compiling... When you upload only the content of the standalone folder (which is the recommended way according to next), you should just do node server.js and everything runs.

But the buildpacks always try to to a npm install/npm rebuild. And since the node_modules in the .next/standalone folder contains only the node_modules needed (and not all the binaries), the buildpacks process download again the binaries, resulting in +1.3GB data for nothing...

It would be best to add an option somewhere that tells the buildpacks that we do not need to build our app (hence skipping the npm rebuid/npm install)

To add a bit more:
I tried to do this stackoverflow workaround (which is putting all my dependencies in dev), but next is required in prod dependencies. Since it's next npm modules that download the ~1.3Go binaries, the problem stay.

There really should be an option to disable npm rebuild/npm install in the buildpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants