Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] ENOSPC: no space left on device, during bundling cache assets on cf worker infra #560

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

Open
numdefined opened this issue Apr 9, 2025 · 3 comments
Labels
bug Something isn't working triage

Comments

@numdefined
Copy link

Describe the bug

When I try to build and deploy my opennext app on cloudflare, i'm hitting a disk space limit.

...
22:06:53.885 | ┌──────────────────────────────┐
-- | --
22:06:53.885 | │ OpenNext — Generating bundle │
22:06:53.885 | └──────────────────────────────┘
22:06:53.885 |  
22:06:53.902 | Bundling middleware function...
22:06:53.996 | Bundling static assets...
22:06:55.827 | Bundling cache assets...
22:06:58.750 | node:fs:3004
22:06:58.751 | binding.copyFile(
22:06:58.752 | ^
22:06:58.752 |  
22:06:58.752 | Error: ENOSPC: no space left on device, copyfile '/opt/buildhome/repo/.next/standalone/.next/server/app/cs/czechrepublic/party/TOP09/timeline.rsc' -> '/opt/buildhome/repo/.open-next/cache/hNKeabg4RyOjFviwV-RAi/cs/czechrepublic/party/TOP09/timeline.rsc'
-- | --
22:06:58.752 | at copyFileSync (node:fs:3004:11)
22:06:58.752 | at copyFile (node:internal/fs/cp/cp-sync:104:3)
22:06:58.752 | at onFile (node:internal/fs/cp/cp-sync:83:25)
22:06:58.752 | at getStats (node:internal/fs/cp/cp-sync:72:12)
22:06:58.752 | at copyDir (node:internal/fs/cp/cp-sync:170:9)
22:06:58.752 | at mkDirAndCopy (node:internal/fs/cp/cp-sync:145:3)
22:06:58.752 | at onDir (node:internal/fs/cp/cp-sync:139:25)
22:06:58.752 | at getStats (node:internal/fs/cp/cp-sync:68:12)
22:06:58.752 | at copyDir (node:internal/fs/cp/cp-sync:170:9)
22:06:58.752 | at mkDirAndCopy (node:internal/fs/cp/cp-sync:145:3) {
22:06:58.752 | errno: -28,
22:06:58.752 | code: 'ENOSPC',
22:06:58.752 | syscall: 'copyfile',
22:06:58.752 | path: '/opt/buildhome/repo/.next/standalone/.next/server/app/cs/czechrepublic/party/TOP09/timeline.rsc',
22:06:58.752 | dest: '/opt/buildhome/repo/.open-next/cache/hNKeabg4RyOjFviwV-RAi/cs/czechrepublic/party/TOP09/timeline.rsc'
22:06:58.753 | }
22:06:58.753 |  
22:06:58.753 | Node.js v22.9.0
...

I've asked in the opennext discord and they said:

Open an issue in the cloudflare repo, it should not copy .rsc file

Steps to reproduce

  1. have open-next.config.ts using staticAssetsIncrementalCache as incrementalCache
  2. have app with tons of static routes (using generateStaticParams, Generating static pages (7553/7553))

I can also send someone a reproduction if needed. It's not open source yet.

Expected behavior

It probably shouldn't use copyFile but rename instead as it won't create copies on disk which might be unwanted for the cf build infrastructure

@opennextjs/cloudflare version

1.0.0-beta.2

Wrangler version

4.9.1

next info output

Binaries:
  Node: 20.18.2
  npm: 10.8.2
  Yarn: 1.22.19
  pnpm: 10.1.0
Relevant Packages:
  next: 15.2.5 // There is a newer version (15.3.0) available, upgrade recommended! 
  eslint-config-next: 15.2.5
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.3.0) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

No response

@numdefined numdefined added bug Something isn't working triage labels Apr 9, 2025
@vicb
Copy link
Contributor

vicb commented Apr 10, 2025

@conico974 we do ~copy the rsc files, right?

@conico974
Copy link
Collaborator

Ho right, we are copying and removing the whole app and pages data later https://github.com/opennextjs/opennextjs-aws/blob/73281c958d43d865fdded0d5d86dd82747365fee/packages/open-next/src/build/createAssets.ts#L75-L89, its a bit wasteful to do it like that (it's a remainder of when we used the data as is).

Anyway the underlying issue will likely remain, we still need to merge and create a new .cache file anyway and we don't want to delete the standalone data (so the ENOSPC issue will likely remain)

I'll create an issue in the aws repo to not copy everything

@KodingDev
Copy link

Any updates on this? The issue opennextjs/opennextjs-aws#822 here is still open with no response. Do we have any workaround I could do to temporarily mitigate the issue in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

4 participants