Skip to content

Build Hangs at "Creating an optimized production build" on Multi-Node Cluster #80

@omur00

Description

@omur00

Description
I am experiencing an issue where a Next.js (Turbopack) deployment consistently hangs/fails at the final build stage: Creating an optimized production build .... My setup consists of a multi-node cluster managed via QuickStack/Longhorn.

Current Environment
Node A (Master/Small): ~48GB Disk, 4 ram. Currently showing high resource usage.

Node B (Worker/Large): 352GB Disk, 6 ram. Mostly empty.

Platform: QuickStack

Storage: Longhorn v1.7.2

The Issue
Build Failure: The deployment reaches the npm run build stage but terminates or hangs indefinitely during the optimization phase. No specific error code is given, suggesting an OOM (Out of Memory) kill by the OS.

Scheduling: Despite having a second, much larger node available, the build job appears to be pinned to the smaller, resource-constrained node.

Storage Conflict: Initially, the small node was marked "Unschedulable" due to high replica counts (defaulting to 4). Even after reducing replicas to 2 and freeing disk space, the build still fails.

Steps to Reproduce
Connect two VPS nodes of unequal size.

Attempt to deploy a standard Next.js project using next build --turbopack.

Observe the build log output until it reaches the optimization step.

Expected Behavior
The build should either:

Successfully complete by utilizing available RAM.

Automatically schedule the Build Job onto the node with the most available resources (the larger node).

Logs
Plaintext
[2026-04-02T22:11:30.999Z] #8 1.908 Creating an optimized production build ...
[2026-04-02T22:14:53.248Z]: [END] Log stream ended for build process: build-app-frontend-...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions