Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

My Bitbucket pipeline started failing the "firebase deploy" command with "JavaScript heap out of me"

marce1o
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2025

Recently my Bitbucket pipeline started failing the "firebase deploy" command with "JavaScript heap out of me".

This is basically the script:

export FIREBASE_CREDENTIALS="${FIREBASE_CREDENTIALS}"
export GOOGLE_APPLICATION_CREDENTIALS="firebase-credentials.json"
apt-get update && apt-get install -y curl jq
curl -sL https://firebase.tools | bash
echo "$FIREBASE_CREDENTIALS" > firebase-credentials.json
PROJECT_ID=$(cat .firebaserc | jq -r '.projects.default')
firebase use --add "$PROJECT_ID"
firebase deploy --only hosting

And this is the full error:

<--- Last few GCs --->


[370:0x4562350]   728369 ms: Scavenge (reduce) 2044.2 (2082.3) -> 2043.3 (2082.3) MB, 2.00 / 0.00 ms  (average mu = 0.308, current mu = 0.345) allocation failure; 

[370:0x4562350]   728373 ms: Scavenge (reduce) 2044.2 (2082.3) -> 2043.3 (2082.3) MB, 1.92 / 0.00 ms  (average mu = 0.308, current mu = 0.345) allocation failure; 

[370:0x4562350]   728376 ms: Scavenge (reduce) 2044.2 (2082.3) -> 2043.3 (2082.5) MB, 1.64 / 0.00 ms  (average mu = 0.308, current mu = 0.345) allocation failure; 


<--- JS stacktrace --->


FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

----- Native stack trace -----


 1: 0x9c6f1d node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/bin/firebase]

 2: 0x15a3720 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/firebase]

 3: 0x15a3a07 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/firebase]

 4: 0x17b5de5  [/usr/local/bin/firebase]

 5: 0x17b6374 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/firebase]

 6: 0x17cd254 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/usr/local/bin/firebase]

 7: 0x17cda6c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/firebase]

 8: 0x17a3d91 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/firebase]

 9: 0x17a4f25 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/firebase]

10: 0x1782576 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/firebase]

11: 0x1bddc96 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/firebase]

12: 0x1feaef6  [/usr/local/bin/firebase]

Any ideas of how to solve it or why this only started happening now? I tried adding

  export NODE_OPTIONS="--max-old-space-size=4096" 

but it did not work.

Thank you.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
yesterday at 7:04 AM

Hello @marce1o ,

and welcome to the Community! 

Based on the logs you've shared with us, it seems your firebase command is failing because of insufficient memory.

In this case, what usually helps is to increase the step size on your pipeline, as this will increase the value of allocated memory. Following is an example of how this can be configured in the pipeline step

pipelines:
  default:
    - step:
        size: 2x # This step will be allocated 8GB of memory
        script:
          - echo "This step gets double the memory!"

 You can find details of all the available step size and their respective memory/CPU allocation at the below article:

I hope that helps! Let us know in case you have any questions.

Thank you, @marce1o !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events