Ad

Firebase Cloud Function Exits With Code 16 What Is Error Code 16 And Where Can I Find More Info?

- 1 answer

one of my cloud functions on firebase exits with code 16 as an error.

I tried to google and find out what that code is but no luck at all.

Error: Process exited with code 16
    at process.on.code (/srv/node_modules/@google-cloud/functions-framework/build/src/invoker.js:393:29)
    at process.emit (events.js:189:13)
    at process.EventEmitter.emit (domain.js:441:20)
    at process.exit (internal/process/per_thread.js:168:15)
    at logAndSendError (/srv/node_modules/@google-cloud/functions-framework/build/src/invoker.js:184:9)
    at process.on.err (/srv/node_modules/@google-cloud/functions-framework/build/src/invoker.js:390:13)
    at process.emit (events.js:189:13)
    at process.EventEmitter.emit (domain.js:441:20)
    at emitPromiseRejectionWarnings (internal/process/promises.js:119:20)
    at process._tickCallback (internal/process/next_tick.js:69:34)

Where can I find those error codes reported so I can understand why my function exits?

Ad

Answer

The code for the function framework is actually public in the GoogleCloudPlatform/functions-framework-nodejs repository (although not advertised anywhere).

In particular you can see there the cases where killInstance is used, which is the one triggering exit code 16:

const killInstance = process.exit.bind(process, 16);

These cases are (at the time of writing):

Ad
source: stackoverflow.com
Ad