Coder Social home page Coder Social logo

Comments (27)

laurenzlong avatar laurenzlong commented on June 12, 2024 1

Hey @ahaverty thanks for the detailed repro instructions. This is definitely a bug, and I'll try to reproduce it on my end and figure out how to fix it. Will keep you updated on this thread. Here are the answers to your questions:

Can someone clarify if a function fails to deploy, what state is it left in (if a previous deployment was a success) are the other functions updated?

It depends on exactly how the error occurred. The best way to check is to go to https://console.cloud.google.com/functions/list. There will be check marks or x's next to the functions depending on their current state. Clicking on the name of the function, then navigating to the "source" tab will show you the current code that's deployed.

I could see inconsistent deployments causing issues if one function depended on another function. It looks like function deployment is independent at the moment?

Yes, the functions deployment is independent at the moment, since they happen in parallel.

Could I suggest some kind of flag like --rollback-on-fail to allow all or nothing deployments?

That's a great suggestion and something that we've been thinking about. Unfortunately it's a non-trivial effort for us due to our current technical constraints. We don't version control your functions yet, so it would not be feasible to do roll backs at the moment. This is still a really great feature request and something that we'd like to support in the future.

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024 1

@laurenzlong Awesome, I didn't know cloud.google console was linked like that! independent deploys aren't such a big deal with the console then. Just to note, I had no issues deploying the same functions 5 minutes later to another one of my projects. Let me know if I can help with debuggingπŸ‘ Thanks againπŸ‘Œ

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Update: On my third deployment attempt, 16/17 deployed successfully, but a different function failed due to the same issue.

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Update 2: That deployment actually resulted in a different error

⚠  functions[merchantSettingsTask]: Deploy Error: Operation interrupted.

And here's what happens on the log for that function.
Although it seems like that functions previous deployment is still running regardless of the failure?:
screen shot 2017-03-22 at 13 49 36

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Update 3: All 17 functions had a deployment success on attempt 4 (without any changes to code or the command used).
Can someone clarify if a function fails to deploy, what state is it left in (if a previous deployment was a success) are the other functions updated?
I could see inconsistent deployments causing issues if one function depended on another function. It looks like function deployment is independent at the moment?
Could I suggest some kind of flag like --rollback-on-fail to allow all or nothing deployments? πŸ‘

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

That's good to hear! Did you save the firebase-debug.log file from the failed deploy? (It gets automatically created in the working directory when there's a failure) That would be really helpful.

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

@laurenzlong I don't have it in the working directory or in my trash. Is it removed on each new deploy? Can I grab anything from google cloud logs?

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

Unfortunately it gets written over in successive deploys so it's gone now :(

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Sorry @laurenzlong 😞, I never thought of it. I'll save and send if it happens again.

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

Not a problem! Yes that would be great, thanks!

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

Hey @ahaverty I'm unable to reproduce the bug. A new release for the runtime went to prod today, so I think that probably resolved the issue. I'm going to close this issue for now, but feel free to re-open it if you see the errors again.

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Thanks @laurenzlong haven't hit it since anyway, but will do!

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Hi @laurenzlong
I hit a similar issue today again on a different project

⚠ functions[merchantSettingsTask]: Deploy Error: Failure in the execution environment

But there was no firebase-debug.log in my working directory, project folder or functions folder so I'm not sure what else I can do. πŸ€”

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Strange, the firebase-debug.log appeared after calling another firebase deploy afterwards. I'll send a private bug report with the log and reference here πŸ‘Œ

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

No I'm wrong, that debug log wasn't for the previous deploy. This may be a bug with firebase-tools? I'd have no way of verifying/testing unfortunately.
Also, the second deploy here started all functions correctly.

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

Hey @ahaverty I was mistaken. CLI typically generates a firebase-debug.log for errors, but doesn't do so for functions deploy errors unless you ran the command with the --debug flag.

Next time you encounter a deploy error, can you run it again with "firebase deploy --debug"?

As for the error you saw, it seemed to be a one-off. (We're working hard to eliminate these!)

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Good to know πŸ‘Œ Does running firebase deploy --debug create a log for the previous deployment or the current deploy? Catching these intermittent fails would be hard unless I ran --debug everytime, right?
(Functions will massively help our team, and yourself and firebase are doing a great job, especially for a betaπŸ€—!) Thanks for all the help

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Hi @laurenzlong this issue is actually happening to me quite often, sometimes up to 4 functions fail to deploy. I finally had the foresight to run with the --debug flag and manage to catch one! I'll send the log over a support ticket

from firebase-functions.

ahaverty avatar ahaverty commented on June 12, 2024

Responded to the original ticket support I opened with Gabriel, asked for him to pass it on to you. Thanks again

from firebase-functions.

Abrahamh08 avatar Abrahamh08 commented on June 12, 2024

I'm having the same problem right now with one of my firebase functions. It was working earlier, but now every time I deploy (after a minor update) I get:

⚠ functions[functionName]: Deploy Error: Failed to retrieve function source code

from firebase-functions.

laurenzlong avatar laurenzlong commented on June 12, 2024

@Abrahamh08 can you file a support ticket? https://firebase.google.com/support/

from firebase-functions.

Abrahamh08 avatar Abrahamh08 commented on June 12, 2024

@laurenzlong done

from firebase-functions.

dallen4 avatar dallen4 commented on June 12, 2024

Not sure if this will help, but I was having the same issue and found this on Stack Overflow. Changing the node/npm version you install firebase-tools with seemed to fixed for me.

from firebase-functions.

dodomui avatar dodomui commented on June 12, 2024

I'm having the same error now.
And it only happens to one of my project another project is just working fine.
Submitted ticket to firebase 6 hours ago, but didn't solved yet, my project get stuck here.
Change different npm version doesn't help on my case.

firebase-admin: ^8.10.0,
firebase-functions: ^3.6.1,
firebase-tools: 8.9.2

from firebase-functions.

stevehwg avatar stevehwg commented on June 12, 2024

@dodomui it could be billing issues. I found this SO here which solved my problem after upgrade to Blaze pay as you go plan.

from firebase-functions.

dongido001 avatar dongido001 commented on June 12, 2024

I'm on "Blaze pay as you go plan" but I still get this error

from firebase-functions.

8gb avatar 8gb commented on June 12, 2024

Tried all the steps above, didnt worked for me. What work for me is:

  1. Rename all functions.
  2. Deploy and say yes to delete all the old functions.
  3. Rename it back to the original functions name.
  4. Deploy and delete all the old functions deployed in step 2.

from firebase-functions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.