microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 865 forks source link

ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory #1380

Closed bhaidar closed 6 years ago

bhaidar commented 6 years ago

Agent version: 2.126

I am trying to build an Angular 4 app online with VSTS. Locally, things work fine. The only difference I can see is that locally I am using latest Nodejs v 8.X.

The errors I am getting online from Build process are:

2018-01-21T22:20:45.4209477Z 
2018-01-21T22:20:45.4228778Z npm ERR! Windows_NT 6.3.9600
2018-01-21T22:20:45.4248347Z npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "d:\\a\\1\\s\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--" "--prod" "--aot"
2018-01-21T22:20:45.4312324Z npm ERR! node v6.9.1
2018-01-21T22:20:45.4313178Z npm ERR! npm  v3.10.10
2018-01-21T22:20:45.4313393Z npm ERR! code ELIFECYCLE
2018-01-21T22:20:45.4313625Z npm ERR! abp-zero-template@4.0.0 build: `npm run clean:dist && ng build "--prod" "--aot"`
2018-01-21T22:20:45.4313874Z npm ERR! Exit status 3

Any idea why I would get such errors?

TingluoHuang commented 6 years ago

@bhaidar are you using Hosted agent provided by VSTS? if so you can try install node.js 8 during your build, doc: https://docs.microsoft.com/en-us/vsts/build-release/concepts/process/tasks#tool-installers also, you can check this repos if you think node 8 is required on the image. https://github.com/Microsoft/vsts-image-generation

bhaidar commented 6 years ago

Thanks, @TingluoHuang. It works :-) I installed the version of Node I need.

Question, I am not that familiar with the VSTS agents. Where can I find in depth information about VSTS and how builds or tasks run in which environment, etc.

Thanks

TingluoHuang commented 6 years ago

cool, i will close the issue.

https://docs.microsoft.com/en-us/vsts/build-release/concepts/agents/agents might be a good start point, https://github.com/Microsoft/vsts-agent/tree/master/docs also cover some topic, can you always check the code since the agent is open sourced. :)

bhaidar commented 6 years ago

Hello again @TingluoHuang I am facing the same issue again! I have Node 8.10.0. Locally I can build my Angular 4 app, while on the Hosted Agent, I am not able to build it.

2018-03-08T18:07:31.1346405Z Node#moveTo was deprecated. Use Container#append.
2018-03-08T18:07:35.4483779Z Template parse warnings:
2018-03-08T18:07:35.4484425Z The <template> element is deprecated. Use <ng-template> instead ("
2018-03-08T18:07:35.4484703Z [WARNING ->]<template [ngIf]="!isClosed">
2018-03-08T18:07:35.4485151Z   <div [class]="'alert alert-' + type" role="alert" [ngClass]="classes""): ng:///D:/a/1/s/node_modules/ngx-bootstrap/alert/alert.component.d.ts.AlertComponent.html@1:0
2018-03-08T18:33:28.6170783Z FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
2018-03-08T18:33:28.8442876Z  1: node_module_register
2018-03-08T18:33:28.8443543Z  2: v8::internal::FatalProcessOutOfMemory
2018-03-08T18:33:28.8443768Z  3: v8::internal::FatalProcessOutOfMemory
2018-03-08T18:33:28.8443900Z  4: v8::internal::Factory::NewCodeRaw
2018-03-08T18:33:28.8444074Z  5: v8::internal::Factory::NewCode
2018-03-08T18:33:28.8444243Z  6: v8::internal::modulo
2018-03-08T18:33:28.8444399Z  7: v8::internal::compiler::ControlFlowOptimizer::TryBuildSwitch
2018-03-08T18:33:28.8445356Z  8: v8::internal::interpreter::HandlerTableBuilder::HandlerTableBuilder
2018-03-08T18:33:28.8445564Z  9: v8::internal::compiler::Pipeline::AllocateRegistersForTesting
2018-03-08T18:33:28.8445746Z 10: v8::internal::compiler::ValueNumberingReducer::operator=
2018-03-08T18:33:28.8445929Z 11: v8::internal::CompilationJob::FinalizeJob
2018-03-08T18:33:28.8446093Z 12: v8::internal::compiler::SimplifiedOperatorReducer::factory
2018-03-08T18:33:28.8446254Z 13: v8::internal::Compiler::FinalizeCompilationJob
2018-03-08T18:33:28.8446441Z 14: v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions
2018-03-08T18:33:28.8446605Z 15: v8::internal::StackGuard::HandleInterrupts
2018-03-08T18:33:28.8446763Z 16: v8::internal::wasm::WasmOpcodes::TrapReasonMessage
2018-03-08T18:33:28.8446943Z 17: 000002733E1043C1
2018-03-08T18:33:29.0102876Z 
2018-03-08T18:33:29.0104678Z npm ERR! Windows_NT 6.3.9600
2018-03-08T18:33:29.0105032Z npm ERR! argv "D:\\a\\_tool\\node\\8.10.0\\x64\\node.exe" "D:\\a\\1\\s\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--" "--prod" "--aot"
2018-03-08T18:33:29.0105305Z npm ERR! node v8.10.0
2018-03-08T18:33:29.0105483Z npm ERR! npm  v3.10.10
2018-03-08T18:33:29.0107633Z npm ERR! code ELIFECYCLE
2018-03-08T18:33:29.0108271Z npm ERR! abp-zero-template@4.0.0 build: `npm run clean:dist && ng build "--prod" "--aot"`
2018-03-08T18:33:29.0108495Z npm ERR! Exit status 3
2018-03-08T18:33:29.0108668Z npm ERR! 
2018-03-08T18:33:29.0108865Z npm ERR! Failed at the abp-zero-template@4.0.0 build script 'npm run clean:dist && ng build "--prod" "--aot"'.
2018-03-08T18:33:29.0109095Z npm ERR! Make sure you have the latest version of node.js and npm installed.
2018-03-08T18:33:29.0109302Z npm ERR! If you do, this is most likely a problem with the abp-zero-template package,
2018-03-08T18:33:29.0109488Z npm ERR! not with npm itself.
2018-03-08T18:33:29.0109693Z npm ERR! Tell the author that this fails on your system:
2018-03-08T18:33:29.0109909Z npm ERR!     npm run clean:dist && ng build "--prod" "--aot"
2018-03-08T18:33:29.0110106Z npm ERR! You can get information on how to open an issue for this project with:
2018-03-08T18:33:29.0110318Z npm ERR!     npm bugs abp-zero-template
2018-03-08T18:33:29.0110514Z npm ERR! Or if that isn't available, you can get their info via:
2018-03-08T18:33:29.0110700Z npm ERR!     npm owner ls abp-zero-template
2018-03-08T18:33:29.0110929Z npm ERR! There is likely additional logging output above.
2018-03-08T18:33:29.0121971Z 
2018-03-08T18:33:29.0122831Z npm ERR! Please include the following file with any support request:
2018-03-08T18:33:29.0123090Z npm ERR!     D:\a\1\s\npm-debug.log
TingluoHuang commented 6 years ago

@bhaidar can you repro it all the time? if so, i would suggest open issue at https://github.com/Microsoft/vsts-image-generation and seek help from node.js org

abhishekgoenka commented 5 years ago

I am getting the same error with Angular7 image