Firebase-tools: Deployment error with no details after updating to Node 8 and firebase-tools@^4.0.0

Created on 2 Aug 2018  ·  113Comments  ·  Source: firebase/firebase-tools

Version info

^4.0.0

Platform Information

Ubuntu 14.04.5 LTS (on Travis CI)

Steps to reproduce

firebase deploy --except hosting with lots of functions (in our case 52) running on Node 8 runtime.

Expected behavior

Before we updated firebase-tools to version 4 and higher (we had the exact same behavior for versions 4.0.0, 4.0.1 and 4.0.2) and using Node 8, updating correctly all of our cloud functions never failed.
We expect it to continue since this happens when deploying our application in production.

Actual behavior

Since this update, there is always at least one or two functions that fail deploying with the following error:

⚠  functions[<our-function-name>(us-central1)]: Deployment error.
Build failed: Build error details not available

During the last deployment running with [email protected], 4 functions failed to update.

functions ongoing bug

Most helpful comment

Hey @thechenky, I did:

Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}

I waited about 5 mins as I read this thread online, deployed again and it worked fine.

Is there a reason why the build might still fail at times?

Still experiencing exactly the same issue today. (2020 - 01 - 07)

All 113 comments

Hi, I think the issue is likely due to the number of functions you are deploying, and not due to the firebase-tools version (you can of course test this by downgrading). Please deploy a subset of your functions at once instead of all of them, see https://firebase.google.com/docs/cli/#deploy_specific_functions

getting the same error and only deploying 12 functions. Never had these deployment issues until upgrading to node 8.

..if there's a limit to the number you can deploy, shouldn't it be documented somewhere?

Same here. Getting it when deploying only one function with node 8.

Ok interesting, thanks for the additional datapoints. So it seems like it's not due to the new versions of firebase-tools per se, but due to deploying to Node 8 vs Node 6. (So using the same firebase-tools but deploying to Node 6 will reduce errors). I've filed a bug internally with the team responsible for the runtime.

This is a pretty annoying bug. My function deployments fail 9 out of 10 times now it seems 😞. Glad to hear it's on peoples radar though. I'm moving back to Node.js 6 for now.

@jpreynat @0x80 Does the entire deployment fail or some functions deploy and some fail?
(_Investigating whether we should upgrade our 100+ functions to Node v8_)

@ahaverty In my case, this is only 3 or 4 functions on 52 that fail.
But I'd rather have the deployment fail completely so all our application functions are always on the same version.

@jpreynat I agree, we're running deploys via CI, and could live with complete fails but not partial. Thanks for confirming, I'm going to hold off upgrading until this is resolved.

This is still happening and it affects our staging and production environments.
We just redeployed the whole application a minute ago, and one of the function failed deploying for no apparent reason.

As @ahaverty also states, the CLI should at least rollback all functions that were successfully deployed to prevent instability in the whole application.
@laurenzlong Do you have any update about the reason of the failure and an ETA for a fix release?
We are about to deploy a critical update to production and need to be sure that it is either fully or not deployed at all, so we can relaunch it and the app won't crash.

I would recommend deploying your functions in small groups or individually
to minimize potential bad partial deploy states. Rollback is not a feature
on the near-term horizon.

On Thu, Aug 16, 2018, 10:07 AM Johan Preynat notifications@github.com
wrote:

This is still happening and it affects our staging and production
environments.
We just redeployed the whole application a minute ago, and one of the
function failed deploying for no apparent reason.

As @ahaverty https://github.com/ahaverty also states, the CLI should at
least rollback all functions that were successfully deployed to prevent
instability in the whole application.
@laurenzlong https://github.com/laurenzlong Do you have any update
about the reason of the failure and an ETA for a fix release?
We are about to deploy a critical update to production and need to be sure
that it is either fully or not deployed at all, so we can relaunch it and
the app won't crash.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/853#issuecomment-413557599,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAD_gn6e0hkZXlbiM_hv-oBf2T8_Iujks5uRXySgaJpZM4Vsn0E
.

I can confirm that I am also having this issue with Node 8. I will switch back to Node 6.

After switching to Node 8...

  1. ~3% invocation failure
  2. ~4x increased time to deploy
  3. ~80% deploy failure due to 2 of 24 functions failing to deploy

https://stackoverflow.com/questions/52056953/functions-issues-with-node-8-lts/52058796#52058796

I switched to Node 8 to gain access to the spread operator so I could build a library like this. I'm not sure if this is contributing to my lack of success with Node 8.

https://stackoverflow.com/questions/43486278/how-do-i-structure-cloud-functions-for-firebase-to-deploy-multiple-functions-fro/52056785#52056785

I'm having the same issue on firebase-tools v4.2.1 using Node 8.

Downgrading back to Node 6 allowed me to deploy.

@michaelauderer Same happening here. Seems to be flakey over the past few hours so it might be a cloud issue.

@michaelauderer @mulhoon Same here with Node 8.

I have the same issue, but it's weird because these very same functions (4 out of 4) used to deploy successfully yesterday.

@yuliankarapetkov Yes, mine were working fine yesterday.
FYI I've been installing node modules with yarn on node v8.9.4, then switching to node v9.4.0 and deploying. Seemed to be going well.

Same here, but I had this working this morning, I think for our case, this is related to the GCF status right now: https://status.firebase.google.com/incident/Functions/18034 @mulhoon @yuliankarapetkov @urkopineda @michaelauderer

woa I thought I'm the only one having this issue. How did you guys solve this?

@jojonarte There is no quick fix currently, the current massive errors are due to the Firebase platform encountering a service disruption as stated by @gautier-gdx.
However, we still have problems deploying all our functions at once with Node 8 when Firebase is up.

@jojonarte the only resolution I found was to refactor back to Node 6, deploy an empty index.js to delete all functions (otherwise they remain Node 8 functions), and then deploy the Node 6 index.js

Yes, the problem is that if you have a lot of functions that make use of async/await (or any other Node 8 features), you'll have to spend tremendous amount of time refactoring them.

Same here. Node 8 tried to deploy 13 functions at once. This issue did not occur yesterday with the same amount of functions.

Same problem here. It occurs when tried to update two exist Node 6 functions to Node 8 in this 12 hours.
Using [email protected], Solved by deleting exist functions by deploying empty index.js and re-deploying with configuration "engines": { "node": "6" } inside package.json as it was described previous comments.

Any updates on this? This issue is happening for us still as of 9/25. We have 47 functions and anywhere from 0-5 on average will fail to deploy.

It's working for me, but this really isn't great for firebase functions.

Does anyone have any good techniques for using a dev environment? e.g. a blue-green deployment to reduce downtime. At the moment I deploy to the live functions, so a deployment failure leads to real app downtime. Thanks

You could blue-green with two Firebase apps.

+1 Same problem

Still ongoing.

Build failed: Build error details not available

Hi all, thank you for these reports. We are aware of this issue and there is ongoing work in the pipeline to mitigate this pain point. I cannot share timelines, but please know we hear you, we know this issue is frustrating, and we're prioritizing work that will reduce these errors.

Internal bug reference: 117124663

Late is better than never. Thanks for acknowledging the issue.

Since this is a known issue it'd probably be helpful if it's mentioned in this blog post https://firebase.googleblog.com/2018/08/cloud-functions-for-firebase-config-node-8-timeout-memory-region.html where it talks about the steps required to upgrade, but doesn't mention that you probably shouldn't.

Actually, everything seems fine now.
I think that Google has stabilized the Cloud Function Node 8 runtime since I opened the issue.
However, I’ll let the Firebase team close the issue when they find it relevant.

I just switched over to the lastest version of firebase tools, Node 8, and firebase functions last night and unfortunately ran into the same issues mentioned here.

Same - this seems to have cropped up for me on a deployment last night as well 😭

We have been using node 8 on 32 functions since it was available and only started having this issue last night. Deploying fails for between 1 and 5 functions, and they seem to be different every time.

Doesn’t seem to match your timing, but there was an issue with Cloud Functions deployments on March 11th.

I suppose it brings some comfort knowing that maybe it was a "one off", but had I been deploying to production that would have really made a mess. Some were successful others weren't and it was so much slower than the node 6 deployment.

Sure, but this kind of platform problem could also occur when deploying on the Node 6 runtime.
However, what I think firebase-tools is critically missing, that our team has been pushing for a long time and the community should really engage into is transactional deployments (see #699).

As described in the linked issue, we’ve set some best practices in place in our deployment process to prevent critical errors and have been lucky enough that our production deployments always ended well. But we clearly shouldn’t be worried everytime we are releasing our app.

I can't disagree with that at all it "could" occur when deploying on Node 6, but in over the year + since my application has been in production and running on Node 6 I just hadn't seen it. I'll take a look at #699 for sure! Have a great evening @jpreynat

Thanks. For information, we opened this issue because it happened for our deployments on Node 6 too.
Anyways, good to see people wanting and pushing improvements on this matter too!
Good evening to you too @sboyd

Hi @thechenky, has there been any update?
This bug is starting to affect our project as other libraries start dropping node v6 support, we're having to do a lot of workarounds staying on node v6, with this bug being the only blocker from upgrading to v8.

Hi @ahaverty sorry to hear you're still having this issue. I've re-read through this thread and am trying to make sure I have the right understanding of the issue. Does this problem affect only Node 8 deployments? And does this issue go away sometimes or is it always present? I have been unable to recreate this with Node 8 deployments, as the functions I've tried to deploy with Node 8 seem to deploy okay.

The bug that I referenced earlier in https://github.com/firebase/firebase-tools/issues/853#issuecomment-456701673 that should make this situation better is more of an infrastructure change in how we build and deploy the function that should make deployments faster. I'm curious now to see whether the issues folks have been seeing are isolated to the Node 8 runtime. I will bring this up with the relevant teams and see if we can get more information on this. Thanks for everyone's patience!

Can someone confirm if this is still happening with the latest firebase-tools and firebase-functions?

Also, if anyone is willing to share their code, we can see if we can deploy that function in Node8 to see whether this is something source-related.

From the graphs we are seeing similar deployment success rates for Node 6 and Node 8, so we think this might be impacting specific projects (maybe some projects got in a bad state) - does this occur on a new project that is created? There have been a couple Cloud Build outages that would affect the build step in the deployment of a Node 8 function, but that would not explain constant inabilities to deploy Node 8 functions. I would advise to help us investigate further, that people who are still having consistent issues deploying with Node 8 open a support ticket (report deploy related functions issues at https://support.google.com/firebase/contact/support?page=/functions/deploy) so that we can dig deeper into your specific project and take a look at what's going on.

im using node v11 lol, updated firebase-tools,
initial pubsub.schedule didnt deployed, rerun works now

@u007 that's great to hear that your issue was resolved! Is anyone else still experiencing these issues (with updated firebase-functions and firebase-tools)?

Hey @thechenky, I did:

Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}

I waited about 5 mins as I read this thread online, deployed again and it worked fine.

Is there a reason why the build might still fail at times?

@Adrian-Samuel this may have been a transient error - hopefully you don't run into this again. If you do, please open a new issue.

I'm going to close this out as it looks like the original issue has been resolved. Please feel free to open a new issue if you encounter any other problems.

I am having this problem out of the blue, without having changed anything on my end. I believe something changed recently and now I am unable to deploy.
My package.json declares node 8, and I am running node 8 on my computer.

@afuggini if you're having deploy errors please file a new issue or write in to Firebase support.

If you are a newbie hitting this issue (like myself), double-check your function definitions.

In my case, there were some issues with function import paths in the root-level index.js, and I was getting this exact same error upon deployment.

This was on raw Cloud Functions, but it would probably be applicable for any other platforms built on the same - like Firebase Functions.

Hey @thechenky, I did:

Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}

I waited about 5 mins as I read this thread online, deployed again and it worked fine.

Is there a reason why the build might still fail at times?

Still experiencing exactly the same issue today. (2020 - 01 - 07)

Same here. But it doesn't worked after waiting for some time...

Hey @thechenky, I did:
Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}
I waited about 5 mins as I read this thread online, deployed again and it worked fine.
Is there a reason why the build might still fail at times?

Still experiencing exactly the same issue today. (2019 - 01 - 07)

Yep I have the same issue as well

Hey @thechenky, I did:
Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}
I waited about 5 mins as I read this thread online, deployed again and it worked fine.
Is there a reason why the build might still fail at times?

Still experiencing exactly the same issue today. (2019 - 01 - 07)

*2020-01-07 probably;) And yes I am too experiencing this for some time now..

Yep, just experienced this, and landed here from search results

Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "{{hashCode}}", "type": "docker_layer_cache", "level": "project"}]}

I think it's a different issue?

Google just confirmed they are having deployment issues with cloud functions

Same problem here. Bad time for that tho

Build failed: {"cacheStats": [{"status": "MISS", "hash": "{{hash}}", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "{{hash}}", "type": "docker_layer_cache", "level": "project"}]}

Hi,

I am also getting a similar error

Deployment error. Build failed: {"cacheStats": [{"status": "MISS", "hash": "{hashCode}", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "{hashCode}", "type": "docker_layer_cache", "level": "project"}]}

From Google Support

"We're currently having an issue with Cloud Functions deployment. Our engineering team is currently working on this to put back the services the soonest possible time. I'll get back to you with more updates.

Apologies for the inconvenience this may have caused you."

I have just checked the google services on the following link that they have claimed all are up.
https://status.cloud.google.com/
We have to spend three hours for issue investigation.
Please update the confirm status with some URL here
Thanks,

I have just checked the google services on the following link that they have claimed all are up.
https://status.cloud.google.com/
We have to spend three hours for issue investigation.
Please update the confirm status with some URL here
Thanks,

They've updated the page now

I managed to deploy all my functions after a lot of retries but it's still unstable though

😖

We still have the issue, both on app engine and cloud function

looks like they are fixing something

Same here. Also having the same problem:

!  functions[createUserAccount(us-central1)]: Deployment error.
Build failed: {"cacheStats": [{"status": "MISS", "hash": "e03d8d6f6bf22fcb1cf50f4e12b3e3a3b59954fade707db62e79562c9dbac3ef", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "e03d8d6f6bf22fcb1cf50f4e12b3e3a3b59954fade707db62e79562c9dbac3ef", "type": "docker_layer_cache", "level": "project"}]}


Functions deploy had errors with the following functions:
        createUserAccount

with the following code:

await database.collection('members').where('Email', '==', user.email).limit(1).get()
    .then(snapshot => {
      snapshot.forEach(doc => {
        console.log(doc.id, '=>', doc.data())
      })
    }).catch(err => console.error(err))

I happened to have a backup file in the functions directory. Removing that file seemed to fix the deploy.

I happened to have a backup file in the functions directory. Removing that file seemed to fix the deploy.

Backup file as in functions/lib?

I can confirm that removing the folder functions/lib fixed the issue for me :)

Is it safe to delete functions/lib ? Does it get regenerated every time with firebase deploy?

Is it safe to delete functions/lib ? Does it get regenerated every time with firebase deploy?

It is completely safe to delete that folder. Whenever you run firebase deploy, it will automatically create that folder with the contents inside.

Deleting functions/lib didn't fix anything for me. Still getting functions[getVerificationCode(us-central1)]: Deployment error. Build failed: {"cacheStats": [{"status": "MISS", "hash": ...

Error: Functions did not deploy properly.

Deleting functions/lib didn't fix anything for me. Still getting functions[getVerificationCode(us-central1)]: Deployment error. Build failed: {"cacheStats": [{"status": "MISS", "hash": ...

Error: Functions did not deploy properly.

Your best bet is to keep re-trying the request. I've had the same issue as well but all I needed to do is keep running firebase deploy until it worked.

P.S. It might take a while for it go through -- not sure what Google's Team is up to tbh.

I have one function that doesn't get deployed/updated even after retrying over and over. But just that one function. I guess that's fine for me now since I am not testing that function.

https://status.cloud.google.com/ still pretends everything is up
But last I tried, _none_ of my functions deployed 😬

The status page currently says:

We've received a report of an issue with Google Cloud Functions and Google App Engine deployments failing for some customers.

The team is investigating and will post an issue on the dashboard if it's warranted as they learn more. In the meantime if you're having a deployment issue with Cloud Functions please write in to Firebase or Google Cloud support! Thank you all for your patience.

Same here. Any attempt to deploy even only the default helloWorld firebase function throws the same error:
Deployment error. Build failed: {"cacheStats": [{"status": "MISS", "hash": "...", "type": "docker_layer_cache", "level": "global"}

Same here. Any attempt to deploy even only the default helloWorld firebase function throws the same error:
Deployment error. Build failed: {"cacheStats": [{"status": "MISS", "hash": "...", "type": "docker_layer_cache", "level": "global"}

I am seeing this too

Same here.
Deployment error.
Build failed: {"cacheStats": [{"status": "MISS", "hash": "hash", "type": "docker_layer_cache", "level": "global"}, {"status": "MISS", "hash": "hash", "type": "docker_layer_cache", "level": "project"}]}

After a whole night of trying to find my mistake on what went wrong finally i was able to deploy my functions. Worked for me 👍

AND IT WORKS !

Sorry to bring this topic back up. But I do have the same problem.

Everytime I deploy, anywhere from 1 - 5 functions would fail with message like this:
image

There isn't a function that consistently fails to deploy, it seems like random functions fail at different times. Maybe 1 in 12 tries I might get all the functions to deploy at once.

Any hints as to any work arounds besides deploying multiple times for failed functions? And I appreciate all the work thats put into this tool. TY

Build failed: {"cacheStats": [{"status": "MISS", "hash": "d77e8c491b10d7f6c295d44d41963365d20c4b63b5a98586acce25c13826ff34", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "d77e8c491b10d7f6c295d44d41963365d20c4b63b5a98586acce25c13826ff34", "type": "docker_layer_cache", "level": "project"}]}

Facing the same issue today. Was working well till yesterday.

Those error codes are the exact ones we received previously when Google's Cloud Function systems had an internal error of themselves.

My best solution for you is either:

  1. Keep attempting to deploy until it works (should take not more than 14 retries)
  2. Contact Google about the issue and let them check their infrastructure for issues

I am still getting the same error about HIT and MISS on cache stats. This is happening whole day.

Guys, please report deploy issues here, so they might resolve it finally. @pragati27gupta, @taronaeo, @acoyfellow, @MikeWeiZhou
https://firebase.google.com/support/troubleshooter/functions/deploy

So, firebase uses docker. That's fun to know.

Thanks for reaching out! Your request has been submitted and we'll reach out to you soon.

@selvinfehric has the right idea.

btw. I opened issue at cloudfunctions issue tracker about that: https://issuetracker.google.com/issues/154260223
Please, comment / star the issue to get more traction there.

Same here!

Same here, we have the latest version of firebase tools running on a GitLab runner and this keeps happening. It's such a big annoyance to keep retrying. Our whole CI/CD pipeline is broken due to this, causing such a waste of developer time, tracking the jobs and clicking retry to eternity.

Worst of it, the Firebase Support team hasn't been helpful at all and have pointed to some bunch of random docs, totally ignoring the randomness of function deployment errors.

Happens to us too, when locally on Ubuntu 16.04 with firebase-tools 7.12.1 or via Azure DevOps Task with the latest 8.1.1.
Ridiculous that this issue is closed and nobody (Google side) seems to do care less.

this is happening to us, too. We've been battling it for nearly a year. We only have about 30 functions (of all types, https, firestore triggers, pub sub subscribers, auth triggers). It mostly happens when we deploy via CI/CD (circleci), but it happens sometimes when we deploy from our local machines, too (although we do it so infrequently it's hard to say).

I'm running node 8, because of a bug firebase had a few months ago with node 10. Typically, probably 8 or 9 times out of 10, one or two of our functions will just fail to deploy. It seems to be a random one each time - never a consistent failure. This happens without making _any_ changes to our functions code - we may just be deploying a front-end change (via hosting, but we want to keep versions in sync across files via hosting and the API). So, we know it's not our code.

I finally bit the bullet today and spend half of the day breaking out our "large number" (~30) of functions into smaller groups that deploy on their own, with each group having less than 10. THIS SITLL DOES NOT WORK. I've had several failures in a row. in my first group of functions, which only has 6 items. This "group" is actually declared using the firebase deploy --only functions:func1,functions:func2,...functions:func6 syntax, not a group defined in the main export.

Same here
Deployment error.
Anywhere between 1-5 different functions fail to deploy:
Build failed: {"cacheStats": [{"status": "MISS", ...

Anyone experiencing this error please +1 and weigh in on this from the
public Cloud issue tracker: https://issuetracker.google.com/issues/154260223

On Sat, Apr 25, 2020, 4:49 AM chenlevy notifications@github.com wrote:

Same here
Deployment error.
Anywhere between 1-5 different functions fail to deploy:
Build failed: {"cacheStats": [{"status": "MISS", ...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/853#issuecomment-619367267,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAAH7RZHEUCY2EAR2ABU3DROLE23ANCNFSM4FNSPUCA
.

image

I have found that, when creating new project, for my previous one I didn't have the "google analytics" enabled, and every single of my deployments was failing. I just tested it with brand new project and everything works, when I do enable google-analytics

Whether Analytics is enabled or not will not affect this error, that's
likely just been a coincidence.

On Sat, Apr 25, 2020, 12:17 PM erykos111 notifications@github.com wrote:

[image: image]
https://user-images.githubusercontent.com/47335304/80288700-94ee1680-8731-11ea-8f57-66598893458e.png

I have found that, when creating new project, for my previous one I didn't
have the "google analytics" enabled, and every single of my deployments was
failing. I just tested it with brand new project and everything works, when
I do enable google-analytics


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/853#issuecomment-619427952,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAAH7TAOV2IOQG7NUDBXFTROMZMHANCNFSM4FNSPUCA
.

As stated in the above comment, enabling Google Analytics does not change the failed deployment of functions. What you have probably done is created a new project in a server that does not have their Cloud Functions server failing to operate.

Just ran into the same issue - deployments were working fine until we got these, reliably on two functions - started sometime today:

⚠ functions[legacyFeedRedirect(us-central1)]: Deployment error.
Build failed: {"cacheStats": [{"status": "MISS", "hash": "526b4459b8b6ae9cc7de4bbed53b2d24a8c5fcf1737f07f27a44e4029d472306", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "526b4459b8b6ae9cc7de4bbed53b2d24a8c5fcf1737f07f27a44e4029d472306", "type": "docker_layer_cache", "level": "project"}]}
⚠ functions[updateUserOnboardingFlags(us-central1)]: Deployment error.
Build failed: {"cacheStats": [{"status": "MISS", "hash": "526b4459b8b6ae9cc7de4bbed53b2d24a8c5fcf1737f07f27a44e4029d472306", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "526b4459b8b6ae9cc7de4bbed53b2d24a8c5fcf1737f07f27a44e4029d472306", "type": "docker_layer_cache", "level": "project"}]}

To anyone that still encounter deployment errors:

After first fixing our deployments by switching on Node 10 and running with the latest version of firebase-tools, we recently (about 2 weeks ago) encountered errors again with an opaque Build error: details not available. We were completely stuck because this happened constantly for all of our functions on all our environments.

After investigating, we noticed that the build time for cloud functions had been reduced on GCP from 10 minutes to only 5 minutes.

To improve build time, GCP uses caching to re-install node_modules based on the hash of either the package-lock.json or the yarn.lock files, depending on which you are using.
But if your dependencies are updated and this file changes, GCP has to re-install all of them, which was taking too long in our case, especially since we have many native modules that need to be rebuilt. I think this is what we can see in the Node 8 error details with the "status": "MISS".

We ended up building our own tooling to compile our functions separately, bundling all non-native modules in our main function code using webpack, and having a trimmed package.json file for each function with only the missing dependencies for each of them.

Now our deployments work well every time, and take 1 to 2 minutes max per function.

+1

+1
Same error.
Build failed: {"cacheStats": [{"status": "MISS", "hash": "8c20b0a9a3a6bd52591da4f39acf1b59e56da60640e148a5d96a494617066c6d", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "8c20b0a9a3a6bd52591da4f39acf1b59e56da60640e148a5d96a494617066c6d", "type": "docker_layer_cache", "level": "project"}]}

We have been seriously impacted by this issue and were unable to deploy since last week. _Details can be found in my comment on Google Issue Tracker._

We come up with a custom deployment script which retries deployment of failed Cloud Functions. Leaving it here, so it may give you an idea, or you can use it directly. We already deployed to Staging environment more than 20 times using this script.

Hope this helps someone until this issue is fixed.

@fatihacet As I mentioned earlier, the build errors mostly happen because of a timeout during the deploy process, which has been reduced from 10 to 5 minutes by GCP about 2 weeks ago.

We also had a retry system in place, implemented in a fork of firebase-tools (and usable) here (PR for official firebase-tools is here #1977).

However, we had been stuck with our deployments for more than 2 weeks due to the recent timeout decrease, and retries wouldn't solve the problem for us, as we couldn't deploy a single function on any of our environments, even with 3 to 5 retries, during this period.

The only fix is to reduce the amount of dependencies that you are using for your cloud functions.
In our case, we had to compile them separately and bundle all that could be in the function's code using webpack.

With this update on the build system timeout, the firebase model of using a single entry point for all of the functions to be deployed simply doesn't work anymore.

I just updated firebase-cli version 8.2.0
However, I continue to encounter this error
Build failed: {"cacheStats": [{"status": "MISS", "hash": "8c20b0a9a3a6bd52591da4f39acf1b59e56da60640e148a5d96a494617066c6d", "type": "docker_layer_cache", "level": "global"}, {"status": "HIT", "hash": "8c20b0a9a3a6bd52591da4f39acf1b59e56da60640e148a5d96a494617066c6d", "type": "docker_layer_cache", "level": "project"}]}

@Trinhlvtq, upgrading firebase-tools won’t solve this issue.

Out of curiosity, how many node dependencies do you use in your project?
Do you use native ones in your project?

We've been having this issue for the last 2 weeks now.
In our case we only get
build failed: build error details not available
and when we check the logs on GCP we see a status code of 13.

@sunnixx This issue has already been resolved in Google's Issue tracker #154260223. If you think that your problem is related to this issue, please post your issue there.

This just started for me today. Node 10. No clue what caused it but every attempt to deploy functions from CI results in this error.

@devth Please copy & paste the output here, so that the team can understand what is going on.

@taronaeo here's the output:

i  functions: updating Node.js 10 function onCreate(us-central1)...
 i  functions: updating Node.js 10 function createUser(us-central1)...
 i  functions: updating Node.js 10 function onDocCreate(us-central1)...
 i  functions: updating Node.js 10 function onSub1DocCreate(us-central1)...
 i  functions: updating Node.js 10 function onSub2DocCreate(us-central1)...
 i  functions: updating Node.js 10 function next(us-central1)...
 ⚠  functions[createUser(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 ⚠  functions[onCreate(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 ⚠  functions[onSub1DocCreate(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 ⚠  functions[next(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 ⚠  functions[onSub2DocCreate(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 ⚠  functions[onDocCreate(us-central1)]: Deployment error.
 Build failed: Build error details not available.
 Functions deploy had errors with the following functions:
    createUser
    next
    onCreate
    onDocCreate
    onSub1DocCreate
    onSub2DocCreate
 To try redeploying those functions, run:
     firebase deploy --only functions:createUser,functions:next,functions:onCreate,functions:onDocCreate,functions:onSub1DocCreate,functions:onSub2DocCreate
 To continue deploying other features (such as database), run:
     firebase deploy --except functions
 Error: Functions did not deploy properly.
 error Command failed with exit code 1.

~Update 1: It seems to fail consistently with firebase deploy. If I instead firebase deploy --only functions it will sometimes work / sometimes fail with the same error.~
Update 2: well today it seems to just fail all the time.

Thanks.

@devth have a look at this message.

So apparently it has to do with too many deps. I'm running Nextjs on Firebase Functions, so I need my entire web stack's deps. This is a fairly small and new app too, so it's only going to grow.

Side note: this problem has broken my current functions, which took down my site (everything just 404s now). Seems like a major problem. If this was prod I'd be fully down with no solution.

Hi folks, if you are experiencing this error please search for a similar bug or file a new bug on the public issue tracker for Cloud Functions. This issue has already been closed and we won't be able to help you resolve it.

Was this page helpful?
0 / 5 - 0 ratings