Comments (27)
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.
@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.
Update: On my third deployment attempt, 16/17 deployed successfully, but a different function failed due to the same issue.
from firebase-functions.
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?:
from firebase-functions.
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.
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.
@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.
Unfortunately it gets written over in successive deploys so it's gone now :(
from firebase-functions.
Sorry @laurenzlong π, I never thought of it. I'll save and send if it happens again.
from firebase-functions.
Not a problem! Yes that would be great, thanks!
from firebase-functions.
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.
Thanks @laurenzlong haven't hit it since anyway, but will do!
from firebase-functions.
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.
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.
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.
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.
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.
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.
Responded to the original ticket support I opened with Gabriel, asked for him to pass it on to you. Thanks again
from firebase-functions.
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.
@Abrahamh08 can you file a support ticket? https://firebase.google.com/support/
from firebase-functions.
@laurenzlong done
from firebase-functions.
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.
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.
@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.
I'm on "Blaze pay as you go plan" but I still get this error
from firebase-functions.
Tried all the steps above, didnt worked for me. What work for me is:
- Rename all functions.
- Deploy and say yes to delete all the old functions.
- Rename it back to the original functions name.
- Deploy and delete all the old functions deployed in step 2.
from firebase-functions.
Related Issues (20)
- Log incorrectly prints [Circular] for object property when it shares reference with another property in the same object HOT 1
- When crating a user, beforeSignIn may be called multiple times with uids not corresponding to firebase users HOT 3
- DataSnapshot.val() throws error for nested child which doesn't exist HOT 3
- Property 'child' in type 'DataSnapshot' is not assignable to the same property in base type 'DataSnapshot'. after updating `firebase-admin` to v12.0.0 HOT 5
- TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"] HOT 4
- regression in "Build failed with error TS2416 in firebase-functions" HOT 7
- Bug in database.d.ts HOT 3
- Deploy function with the name test-helloWorld fails when using v2 HOT 6
- Inconsistend behaviour of defineList in deploy/emulator HOT 4
- TypeError: Cannot read properties of null (reading 'seconds') HOT 15
- Firebase Functions Encoding Failure for Self-Referencing Objects Leads to Maximum call stack size exceeded HOT 15
- Function execution took 58984 ms, finished with status: 'timeout' HOT 2
- [Firestore] Error: 4 DEADLINE_EXCEEDED: Deadline exceeded HOT 1
- HTTPS Request returns CORS errors even with the domain added as allowed origin HOT 4
- How to deploy function with latest secrets at RUNTIME? HOT 2
- DocumentOptions do not allow parameterized configuration values HOT 2
- Various Firebase functions started reporting crash: Maximum call stack size exceeded HOT 10
- regression with firebase-functions-test wrapping a v1 scheduled function HOT 2
- Please move `node-fetch` as a `devDependency` HOT 1
- `getDownloadURL` function fails in emulator mode if storage rules are not allowed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-functions.