firebase-tools
firebase-tools copied to clipboard
Function timed out in v11.3.0-11.4.1
[REQUIRED] Environment info
firebase-tools: 11.4.1
Platform: Linux Mint 20.3
[REQUIRED] Test case
$firebase serve
i functions: Beginning execution of "helloWorld"
⚠ functions: Your function timed out after ~60s. To configure this timeout, see
https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation.
> /usr/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635
> throw new Error("Function timed out.");
> ^
>
> Error: Function timed out.
> at Timeout._onTimeout (/usr/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635:19)
> at listOnTimeout (node:internal/timers:559:17)
> at processTimers (node:internal/timers:502:7)
In v. 11.2.2 function work
[REQUIRED] Steps to reproduce
My func code
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
[REQUIRED] Expected behavior
[REQUIRED] Actual behavior
[2022-08-01T22:52:43.028Z] [worker-pool] addWorker(us-central1-helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(us-central1-helloWorld)"}}
[2022-08-01T22:52:43.036Z] [worker-pool] Adding worker with key us-central1-helloWorld, total=2 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key us-central1-helloWorld, total=2"}}
[2022-08-01T22:52:43.040Z] [worker-pool] submitWork(triggerId=us-central1-helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=us-central1-helloWorld)"}}
[2022-08-01T22:52:43.051Z] [worker-us-central1-helloWorld-4fc8b443-9aca-4ea2-8257-d0eeb92e69b0]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-helloWorld-4fc8b443-9aca-4ea2-8257-d0eeb92e69b0]: BUSY"}}
FirebaseError: Failed to load function.
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
this issue is happening with me too. this issue started after the new update too. I am suffering a lot with this problem. my firebase-tools version is 11.4.1 too.
the issue is happening exactly the same way as this user. This is hampering all my development, causing my websites to have several gateway errors, loading incompletely. i was forced to revert to a previous version
I'm experiencing the same timeout issue at version 11.5.0. Downgrading to 11.2.2 fixes the issue for me.
Hi @JasminDreasond @stdavis , do you mind sharing an example of failure?
I tried to follow @absemetov example, but things are working as expected on my end, and I'm keen on finding another example that I can use to reproduce the error on my side.
Note that we shipped a feature to enforce a timeout in the emulator (as requested in https://github.com/firebase/firebase-tools/issues/2837). This mostly means that if your functions does not return (in case of event functions) or send back a response (in case of http functions) within 60 seconds, you will see a timeout.
I am facing the same issue. The issue is not consistent meaning, it works sometimes and most times it fails. Yesterday i have posted this in StackOverflow and later in the day posted answer as well. It did work for me at that time and today back again with same issue
In package.json
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0",
"firebase-tools": "^1.2.0"
firebase --version 11.5.0
Attached two files - Log when it worked and when it failed. firebase-debug-works.log firebase-debug-failed.log
Can you please let me know the version and commands to downgrade firebase-functions, firebase-admin, firebase-tools
I get timeout error when the NodeJS version is >= 15. downgrading the NodeJS or the firebase resolved the issue. If you want to use latest version of firebase use NodeJS < 15 or if you want to use latest version of NodeJS, downgrade firebase to 11.2.2
@bobbydreamer Based on what I read from your stackoverflow question and your logs, I think the "timeout" issue you are seeing is a different problem. Specifically, I think this error message you are seeing:
[debug] FirebaseError: Failed to load function.
at Timeout._onTimeout (C:\Users\Sushanth\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsRuntimeWorker.js:104:24)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {"metadata":{"emulator":{"name":"functions"},"message":{"name":"FirebaseError","children":[],"exit":1,"message":"Failed to load function.","status":500}}}
This means that your application server couldn't be started within ~7 seconds 🤔. If you open up a new issue, I'll follow up with more detail there.
@rawatnaresh Thanks for the clue here. Do you mind sharing your application setup a little more? I'm beginning to see a pattern where it takes more than ~7seconds for the Functions Emulator to load and startup an internal server to respond to HTTP requests, and I'm wondering if your code has logic at startup that is long running.
I get timeout error when the NodeJS version is >= 15. downgrading the NodeJS or the firebase resolved the issue. If you want to use latest version of firebase use NodeJS < 15 or if you want to use latest version of NodeJS, downgrade firebase to 11.2.2
I tried to change the version of node js, I still have the problem
Hi @taeold! Let's think about what from this list could cause this error v11.3.0 Fix bug where functions:config get command failed on empty variable. (https://github.com/firebase/firebase-tools/pull/4707) Fix invoker type mismatch for https functions. Add multi-tenancy and multi-factor authentication features in Emulator UI Fix bug where not all the event trigger attributes are copied from build to backend (https://github.com/firebase/firebase-tools/pull/4746).
@taeold Here is a simple repro: https://github.com/stdavis/firebase-emulator-timeout-repro. This request times out every time. Thanks for taking a look at this!
Note, I'm running node v16.16.0.
I've also verified that this occurs in the newest release of firebase-tools, v11.6.0.
Hi, I've been getting timeouts from my HTTP functions running in an emulator this whole day. Since it has been some time since my last extensive testing, I can't tell which version might have been broken. Here is what I noticed:
- happens with
functions.https.onRequest
functions running inside an emulator - first 2-3 function invocations after each build (
npm run build
with the emulator still running) end with a timeout, subsequent invocations usually pass - in some functions, code which has been working previously, is now failing, e.g.
new firestore.Timestamp(seconds, nanoseconds)
tells me thatfirestore.Timestamp
is not a constructor, which is - after inspecting the source code - not true (my import looks like this:import {firestore} from 'firebase-admin';
)
My environment:
- firebase-tools: 11.7.0
- node: 16.16.0
@stdavis I'm not sure what I'm missing, but I cloned your repo and I'm unable to reproduce the timeout issue. I called it a few times and received:
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
i functions: Beginning execution of "maps"
> didn't timeout
i functions: Finished "maps" in ~1s
@taeold Can you try out the sample?
@colerogers Yeah I've tried couple of different ways, and I wonder if this is platform specific issue.
I'm using Mac OSX (M1) and I think @colerogers is using a simliar device. For folks experiencing this issue - can you share what platform you are running the functions on?
I recently merged a change that bumped the timeout for starting a new process to run user-functions from 7 seconds to 10 seconds in https://github.com/firebase/firebase-tools/commit/1f710a5b36c499b3ae50f8e9cb11f980f31063af. This might help with some of the timeout issues seen here. I thought 7 seconds would be more than sufficient for waiting for new process to start and serve function requests, but I think I assumed wrong here.
@colerogers Yeah I've tried couple of different ways, and I wonder if this is platform specific issue.
I'm using Mac OSX (M1) and I think @colerogers is using a simliar device. For folks experiencing this issue - can you share what platform you are running the functions on?
I recently merged a change that bumped the timeout for starting a new process to run user-functions from 7 seconds to 10 seconds in 1f710a5. This might help with some of the timeout issues seen here. I thought 7 seconds would be more than sufficient for waiting for new process to start and serve function requests, but I think I assumed wrong here.
Hi @taeold, this happens to me on Windows 10 Enterprise, 10.0.19044.
~~it's working for me now. I'm using:~~ ~~- Node v16.16.0~~ ~~- firebase-tools v11.8.0~~ ~~- firebase-admin 11.0.1~~ ~~- firebase-functions 3.22.0~~
Couple of days ago I downgraded it to 11.2.2 for it work on node js 16 and its working fine.
Today I wanted to test it again so I upgraded firebase-tools to v11.8.0 npm install -g firebase-tools@latest
and ran the app again and it worked :exploding_head:. its so weird that it wasn't working on same configs couple of days ago.
Then, I uninstalled firebase-tools completely npm uninstall -g firebase-tools
and installed it again npm install -g firebase-tools@latest
and its not working anymore.
@taeold could you uninstall the firebase-tools first and then install the latest version again? Also, if you are unable to reproduce the issue please remove the node_modules
and lib
as well. Sometimes the app works on the first try. Try quitting it and remove/reinstall node_modules. It doesn't work after that.
I don't have access to M1 Mac right now. I'm going to test these steps in M1 and will let you know.
Platform
Darwin Nareshs-MacBook-Air.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
I still have this issue. My setup: node: 16.17.0 firebase-tools: 11.8.0 firebase-admin 11.0.1 firebase-functions 3.22.0 macOS: 12.5.1 Intel Core i5
It feels like this mostly happens just after emulator startup. After a couple of minutes the problem usually disappears.
@rawatnaresh @ottob Thanks for more info. I will try my best to reproduce the error on my side.
For folks coming across this issue - the best workaround so far is to downgrade your Firebase CLI to 11.2.2:
npm i -g [email protected]
Apologies for the invconveniene.
Also - for anyone following, it would be fantastic if you can share output for your debug logs.
You can generate the debug log with following command:
$ firebase emulators:start --debug
It will output logs of diagnostic logs. What I'm particularly keen on reading is everything AFTER the log message like this:
[2022-08-26T20:01:00.463Z] Accepted request GET /danielylee-test/us-central1/maps --> us-central1-maps
In an normal operation, sending a request to the emulator:
- Starts a new process that hosts your function
- Prepares an express sever to respond to HTTP request
- Responds to HTTP request.
Here's an example of working setup on my local machine (I'm still having trouble replicating the issue)
[2022-08-26T20:01:00.469Z] [worker-pool] addWorker(us-central1-maps) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(us-central1-maps)"}}
[2022-08-26T20:01:00.469Z] [worker-pool] Adding worker with key us-central1-maps, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key us-central1-maps, total=1"}}
[2022-08-26T20:01:00.469Z] [worker-pool] submitWork(triggerId=us-central1-maps) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=us-central1-maps)"}}
[2022-08-26T20:01:00.469Z] [worker-us-central1-maps-7887649e-2660-4434-9736-033a7df6475f]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-maps-7887649e-2660-4434-9736-033a7df6475f]: BUSY"}}
[2022-08-26T20:01:00.794Z] [runtime-status] [13206] Resolved module firebase-admin
...
# 111111111111111111: Process is spawned and initialized. Ready for action
[2022-08-26T20:01:00.810Z] [runtime-status] [13206] Functions runtime initialized...
# 22222222222222: AT THIS POINT: HTTP server is now spun up. We are ready to accpet HTTP request
[2022-08-26T20:01:00.881Z] [functions] Runtime ready! Sending request! {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Runtime ready! Sending request!"}}
[2022-08-26T20:01:00.828Z] [runtime-status] [13206] Beginning invocation function maps! {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-maps"},"extension":{},"message":"[runtime-status] [13206] Beginning invocation function maps!"}}
i functions: Beginning execution of "maps" {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-maps"},"extension":{},"message":"Beginning execution of \"maps\""}}
# 3333333333333: Now actually forward the request to the process
[2022-08-26T20:01:00.881Z] [functions] Got req.url=/danielylee-test/us-central1/maps, mapping to path=/ {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Got req.url=/danielylee-test/us-central1/maps, mapping to path=/"}}
Thanks everyone for your help and apologies again. We will get to the bottom of the issue soon.
[debug] [2022-08-27T02:53:17.736Z] [work-queue] {"queueLength":1,"workRunningCount":0}
[debug] [2022-08-27T02:53:17.736Z] [work-queue] {"queueLength":0,"workRunningCount":1}
[debug] [2022-08-27T02:53:17.736Z] Accepted request GET /test-f668c/us-central1/helloWorld --> us-central1-helloWorld
[debug] [2022-08-27T02:53:17.866Z] [worker-pool] addWorker(us-central1-helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(us-central1-helloWorld)"}}
[debug] [2022-08-27T02:53:17.878Z] [worker-pool] Adding worker with key us-central1-helloWorld, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key us-central1-helloWorld, total=1"}}
[debug] [2022-08-27T02:53:17.880Z] [worker-pool] submitWork(triggerId=us-central1-helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=us-central1-helloWorld)"}}
[debug] [2022-08-27T02:53:17.881Z] [worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: BUSY"}}
[debug] FirebaseError: Failed to load function.
at Timeout._onTimeout (/Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsRuntimeWorker.js:104:24)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {"metadata":{"emulator":{"name":"functions"},"message":{"name":"FirebaseError","children":[],"exit":1,"message":"Failed to load function.","status":500}}}
[debug] [2022-08-27T02:53:24.968Z] [work-queue] {"queueLength":0,"workRunningCount":0}
[debug] [2022-08-27T02:53:25.013Z] [runtime-status] [95702] Resolved module firebase-admin {"declared":true,"installed":true,"version":"10.3.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.014Z] [runtime-status] [95702] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.021Z] [runtime-status] [95702] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[debug] [2022-08-27T02:53:25.021Z] [runtime-status] [95702] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.302Z] [runtime-status] [95702] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Checked functions.config() {\"config\":{}}"}}
[debug] [2022-08-27T02:53:25.303Z] [runtime-status] [95702] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.22.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js\"}}"}}
[debug] [2022-08-27T02:53:25.304Z] [runtime-status] [95702] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.308Z] [runtime-status] [95702] Resolved module firebase-admin {"declared":true,"installed":true,"version":"10.3.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.309Z] [runtime-status] [95702] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.22.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.22.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[debug] [2022-08-27T02:53:25.312Z] [runtime-status] [95702] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"10.3.0","resolution":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"10.3.0\",\"resolution\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[debug] [2022-08-27T02:53:25.312Z] [runtime-status] [95702] Functions runtime initialized. {"cwd":"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions","node_version":"16.16.0"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Functions runtime initialized. {\"cwd\":\"/Users/nareshrawat/Documents/personal/firebase-timeout-error/functions\",\"node_version\":\"16.16.0\"}"}}
[debug] [2022-08-27T02:53:25.317Z] [runtime-status] [95702] Beginning invocation function helloWorld! {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Beginning invocation function helloWorld!"}}
[info] i functions: Beginning execution of "helloWorld" {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"Beginning execution of \"helloWorld\""}}
[debug] [2022-08-27T02:53:25.318Z] [runtime-status] [95702] Running helloWorld in signature http {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Running helloWorld in signature http"}}
[debug] [2022-08-27T02:53:25.325Z] [runtime-status] [95702] Listening to port: /var/folders/xn/4bggpf4n4996jtd1cj6qgxfh0000gn/T/fire_emu_45455f22c76f5003.sock {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"[runtime-status] [95702] Listening to port: /var/folders/xn/4bggpf4n4996jtd1cj6qgxfh0000gn/T/fire_emu_45455f22c76f5003.sock"}}
[warn] ⚠ functions: Your function timed out after ~60s. To configure this timeout, see
https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation. {"metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"Your function timed out after ~60s. To configure this timeout, see\n https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation."}}
[info] > /Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635 {"user":"/Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m /Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635"}}
[info] > throw new Error("Function timed out."); {"user":" throw new Error(\"Function timed out.\");","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m throw new Error(\"Function timed out.\");"}}
[info] > ^ {"user":" ^","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m ^"}}
[info] > {"user":"","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m "}}
[info] > Error: Function timed out. {"user":"Error: Function timed out.","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m Error: Function timed out."}}
[info] > at Timeout._onTimeout (/Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635:19) {"user":" at Timeout._onTimeout (/Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635:19)","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m at Timeout._onTimeout (/Users/nareshrawat/.nodenv/versions/16.16.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:635:19)"}}
[info] > at listOnTimeout (node:internal/timers:559:17) {"user":" at listOnTimeout (node:internal/timers:559:17)","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m at listOnTimeout (node:internal/timers:559:17)"}}
[info] > at processTimers (node:internal/timers:502:7) {"user":" at processTimers (node:internal/timers:502:7)","metadata":{"emulator":{"name":"functions"},"function":{"name":"us-central1-helloWorld"},"extension":{},"message":"\u001b[90m> \u001b[39m at processTimers (node:internal/timers:502:7)"}}
[debug] [2022-08-27T02:54:25.338Z] [worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: exited"}}
[debug] [2022-08-27T02:54:25.338Z] [worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-us-central1-helloWorld-24177ec6-cc7f-463e-9576-aabf9c66dc67]: FINISHED"}}
[debug] [2022-08-27T02:54:41.323Z] Received signal SIGINT (Ctrl-C) 1
[info]
[info] i emulators: Received SIGINT (Ctrl-C) for the first time. Starting a clean shutdown.
You can generate the debug log with following command
@taeold is there a way for me to share this log file privately with you? email?
Only downgrade to [email protected] has helped to me !
@ottob You can contact me at danielylee at google.com
No issues in M1 macs.
Something really strange has occurred for me since august 24th. I have a firebase functions which accepts 5k invocations/s. Before Aug 24 I had almost zero time outs however after that date a large portion of my functions were timing out.
I am unable to replicate this locally and even calling the cloudfunctions.net endpoint there is no issue however from my logs I have so many occurences of this (no logging at all!)
2022-09-04 18:05:39.685 AEST appp bwj8vkjfeiv Function execution started
2022-09-04 18:05:50.053 AEST app pbwj8vkjfeiv Function execution took 60367 ms. Finished with status: timeout
My Functions is an express app with morgan body logger so even on a timeout I should see the req logged which I don't
This is costing me $100's a day, but what makes this strange is that it only started on a date.
For some reason the instance appears to be getting created, the function gets called but never executes
I have the same issues...sooooo annoying
Going back to "firebase-tools": "^11.2.2" works like a charm. Blasting fast in my emulator
@ludvigaldrin Do you mind sharing your functions-debug log? We are still scratching our heads figuring out what condition triggers this timeout.
Some questions I'd love from folks experiencing the issue:
Q1: What platform are you on? Windows? Mac? Q2: How often is this problem hitting you? Rare? Fairly reliably? Always? Q3: Is your function complicated? Or can you replicate this issue even on a small "hello world" project as couple of other mentioned before?
Hey @absemetov. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I just tried my simple repro at v11.9.0 and it appears to be working correctly!
Just to be sure, I downgraded to v11.6 and verified that it was still broken. So v11.9.0 seems to me to have resolved the issue for me! I'm not sure if there was an intentional fix committed between these two versions or not.
Thanks for the awesome project!
Just for reference: macOS 12.6 Intel processor node: v16.17.0
I just tried my simple repro at v11.9.0 and it appears to be working correctly!
Just to be sure, I downgraded to v11.6 and verified that it was still broken. So v11.9.0 seems to me to have resolved the issue for me! I'm not sure if there was an intentional fix committed between these two versions or not.
Thanks for the awesome project!
Just for reference: macOS 12.6 Intel processor node: v16.17.0
Problem solved. Thanks! node: v16.17.0 OS: Linux Mint 21
@taeold I booted my old laptop today since I saw that some refactoring had happened in recent versions. I updated to 11.10.0 and no longer get the timeouts. Thanks!