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

Next build raises no error on OOM failure #282

Closed
evantahler opened this issue Nov 21, 2016 · 5 comments
Closed

Next build raises no error on OOM failure #282

evantahler opened this issue Nov 21, 2016 · 5 comments

Comments

@evantahler
Copy link
Contributor

evantahler commented Nov 21, 2016

If next build fails on a deployment server which memory limits (think Heroku, Doku, or Flynn), it fails without reporting anything. This makes debugging SUPER hard.

As a note, at least the now deployment process reports this, as your runner (@zeit/ace) does watch for child-process crashes:

> ▲ npm run build
> <--- JS stacktrace --->
> ==== JS stack trace =========================================
>     2: arguments adaptor frame: 2->1
> Security context: 0x3d224adcfb51 <JS Object>
>     3: _visit [0x3d224ad04381 <undefined>:1257] [pc=0x37955b4af2d2] (this=0x133d7d7a391 <a TreeWalker with map 0x288abbcb9379>,node=0x32cb149cda11 <an AST_Binary with map 0x1ede8fc31389>,descend=0x133d7d6ca61 <JS Function (SharedFunctionInfo 0x37931f345b61)>)
>     4: _walk [0x3d224ad04381 <undefined>:1022] [pc=0x37955c7fd55a] (this=0x32cb149cda11 <an AST_Bina...
> FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
> <--- Last few GCs --->
>   293670 ms: Mark-sweep 397.6 (407.1) -> 397.6 (412.1) MB, 424.7 / 0.0 ms [allocation failure] [GC in old space requested].
>   294202 ms: Mark-sweep 397.6 (412.1) -> 397.6 (412.1) MB, 532.3 / 0.0 ms [allocation failure] [GC in old space requested].
>   294770 ms: Mark-sweep 397.6 (412.1) -> 407.7 (407.1) MB, 568.0 / 0.0 ms [last resort gc].
>   295494 ms: Mark-sweep 407.7 (407.1) -> 417.7 (407.1) MB, 724.0 / 0.0 ms [last resort gc].
> Aborted (core dumped)
> Error Error: Command next build ended with code 134
>     at ChildProcess.<anonymous> (/usr/lib/node_modules/@zeit/ace/build/lib/run.js:1:599)
>     at emitTwo (events.js:106:13)
>     at ChildProcess.emit (events.js:191:7)
>     at maybeClose (internal/child_process.js:877:16)
>     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
> (node:136) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Command next build ended with code 134
> ▲ npm start
> Killed
> Error Error: Command next build ended with code 137
>     at ChildProcess.<anonymous> (/usr/lib/node_modules/@zeit/ace/build/lib/run.js:1:599)
>     at emitTwo (events.js:106:13)
>     at ChildProcess.emit (events.js:191:7)
>     at maybeClose (internal/child_process.js:877:16)
>     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
> (node:306) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Command next build ended with code 137
@LarryLuTW
Copy link
Contributor

I have the same problem. Is there any temporary way to solve this?

@arunoda
Copy link
Contributor

arunoda commented Mar 31, 2017

Currently the process needs to have enough memory to build. May be around 1GB. (Or enable swap).

@LarryLuTW
Copy link
Contributor

I built my next app on my EC2, which has only 1GB memory. Sometimes it succeed but sometimes doesn't, so I would like to build it on local and push the .next/ to the server side. Is it a good way to solve it?

@arunoda
Copy link
Contributor

arunoda commented Apr 2, 2017

@Larry850806 yes. That's a pretty good way to do it.

@timneutkens
Copy link
Member

I'm going to close this as next build should now give proper error messages for most errors. There was a bug where process.exit was called before console.error/console.log could be executed.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants