Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Function example crashes emulator #323

Open
marksmits opened this issue Apr 20, 2019 · 1 comment
Open

Function example crashes emulator #323

marksmits opened this issue Apr 20, 2019 · 1 comment

Comments

@marksmits
Copy link

The function emulator seems to crash on the firebase nextjs-with-firebase-hosting function example. Strange thing is that when run with inspect it does not seems to crash. The crash is cuases by the "await app.prepare()" from next dependency.

$ functions start
Google Cloud Functions Emulator RUNNING
┌────────┬──────┬─────────┬──────────────────────────────────────────────────────────┐
│ Status │ Name │ Trigger │ Resource │
├────────┼──────┼─────────┼──────────────────────────────────────────────────────────┤
│ READY │ next │ HTTP │ http://localhost:5000/test-next/us-central1/next
└────────┴──────┴─────────┴──────────────────────────────────────────────────────────┘
$ functions call next
ExecutionId: fe286d3b-3cc4-455b-bf47-ccb51bcf4420
Error: { error:
{ code: 500,
status: 'INTERNAL',
message: 'function crashed',
errors: [ 'socket hang up' ] } }
$ functions inspect next
Debugger for next listening on port 9229.
$ functions call next
ExecutionId: 964c6366-ec00-4e07-a87e-f51441e08f17
Error: Not Implemented
$ functions logs read
2019-04-20T09:39:58.902Z - error: Function worker killed by signal: SIGTERM
2019-04-20T09:55:03.706Z - error: Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
2019-04-20T09:55:03.707Z - info: DEV true
2019-04-20T09:55:04.337Z - info: User function triggered, starting execution
2019-04-20T09:55:04.337Z - info: File: /
2019-04-20T09:55:04.348Z - info: Execution took 837 ms, finished with status: 'crash'
2019-04-20T09:55:04.358Z - error: Function worker killed by signal: SIGTERM
2019-04-20T09:55:19.288Z - error: Debugger listening on ws://127.0.0.1:9229/e66d0a61-7209-41ba-aafa-edfde33bf0ca
For help see https://nodejs.org/en/docs/inspector
2019-04-20T09:55:19.448Z - error: Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
2019-04-20T09:55:19.449Z - info: DEV true
2019-04-20T09:55:19.895Z - info: Debugger (via --inspect) for projects/test-next/locations/us-central1/functions/next listening on port 9229.
2019-04-20T09:55:23.684Z - info: User function triggered, starting execution
2019-04-20T09:55:23.684Z - info: File: /
2019-04-20T09:55:25.131Z - info: Execution took 1448 ms, user function completed successfully

Environment details

  • OS: MacOs 10.14
  • Node.js version: v8.15.1
  • npm version: 6.4.1
  • @google-cloud/functions-emulator version: 1.0.0-beta.6

Steps to reproduce

  1. install functions: git clone [email protected]:firebase/functions-samples.git
  2. move to example folder: cd functions-samples/nextjs-with-firebase-hosting
  3. update next@beta dependisy in function and app folder package.json to a valid version. beta does not seem to exist anymore. Changed it to "next": "^8.1.0"
  4. yarn install in root folder
    5 functions start && functions call next

Thanks!
Mark

@bluet
Copy link

bluet commented Apr 23, 2019

I use express.js and I experienced lots of Function worker killed by signal: SIGTERM too during firebase serve.

It seem to be happened randomly, I need to keep trying Ctrl-C and start again till it has success.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants