Seeing error "Error: Client is Offline" in firebase functions?

4,888 views
Skip to first unread message

Phil Hodey

unread,
Mar 2, 2021, 5:47:34 AM3/2/21
to Firebase Google Group
Hi,

I have recently noticed lots of failing firebase functions when reading or writing to the realtime database. I've raised this with support but in the meantime, has anybody else seen this message?

I've never seen it before and as it seems to be widespread across all functions I am not sure where to start looking to debug the issue. I am using 9.5.0 firebase-admin.


Phil Hodey

unread,
Mar 2, 2021, 6:00:10 AM3/2/21
to Firebase Google Group
I've investigated further and the errors go back to the 20th February, this is the date I updated all realtime database functions to use the .get() syntax released in 9.5.0. 

I've reverted to 9.4.0 and .once('value') syntax and I have not yet seen a recurrence of the issue. Anybody else seen a similar issue?

Ryan Bagwell

unread,
Apr 12, 2021, 10:43:34 AM4/12/21
to Firebase Google Group
I experienced the same issue in version 9.6.0. Using the .get() method failed intermittently for unknown reasons. I reverted back to 9.4.0 and used the .once method, and that seemed to fix the issue.

Dan Oved

unread,
May 9, 2021, 11:21:43 AM5/9/21
to Firebase Google Group
I have the same issue as well.  Also for calling `get` from firestore. reverting from 9.5.0 to 9.4.0 seemed to do the trick

mrsc...@google.com

unread,
May 10, 2021, 11:10:34 AM5/10/21
to Firebase Google Group
Hello!  
Thanks for the reports. We were wondering if you were able to collect any logs for these errors? This would help us determine whether this is a known issue that we are working on (a missing index lookup) or something new.

Thanks
Sebastian

Xing Liu

unread,
May 27, 2021, 5:32:48 AM5/27/21
to Firebase Google Group

I found a temporary fix by declaring db = admin.database().ref() instead of db=admin.database() on initialization, then calling db.child() instead of db.ref() in the deployed functions.

Xing Liu

unread,
May 27, 2021, 5:32:51 AM5/27/21
to Firebase Google Group
Getting the same error here about 80% of the time.
---
index.js:
---
const app = admin.initializeApp({
     ...functions.config().firebase,
        databaseURL: 'https://ahs-app.firebaseio.com'
}, 'main' )
const db = admin.database(app)
exports.publishStory = functions.database.instance('ahs-app').ref('/storys/{storyID}').onWrite( async changes => {
     // ...
     const schemas = await db.ref('schemas').get().then(x=>x.value()) 
     // ...
})
---
Log:
----
Error: Process exited with code 16
     at process. (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/invoker.js:275:22)
     at process.emit (events.js:315:20)
     at process.EventEmitter.emit (domain.js:467:12)
     at process.exit (internal/process/per_thread.js:169:15)
     at Object.sendCrashResponse (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/logger.js:37:9)
     at process. (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/invoker.js:271:22)
     at process.emit (events.js:315:20)
     at process.EventEmitter.emit (domain.js:467:12)
     at processPromiseRejections (internal/process/promises.js:245:33)
     at processTicksAndRejections (internal/process/task_queues.js:94:32)
---
On Monday, May 10, 2021 at 8:10:34 AM UTC-7 mrsc...@google.com wrote:
Reply all
Reply to author
Forward
0 new messages